Getting started
Python SDK
pip install sqube-agent-guard
from sqube_agent_guard import Decision, ExecutionGuard
def policy(action, resource, agent_id, **ctx):
if action.startswith("admin_"):
return Decision.BLOCK
return Decision.ALLOW
guard = ExecutionGuard(policy=policy)
@guard.wrap_action(action="file.read", resource="file:/tmp/demo.txt")
def read_demo():
return "ok"
read_demo()
Inspect the ledger:
sqube-agent-guard executions --limit 5
sqube-agent-guard ledger verify
Control plane (optional)
Fleet dashboard and HTTP APIs for agents, policies, executions, and approvals:
pip install "sqube-agent-guard[control-plane]"
sqube-agent-guard serve --data-dir .sqube --port 8080
- Open http://127.0.0.1:8080/setup and create the first admin (you choose the username).
- Register agents/policies via API or examples under
examples/python/. - Optional:
export SQUBE_CONTROL_PLANE_URL=http://127.0.0.1:8080so the Python SDK exports events to the plane.
See Control plane and Event ingestion.
Node.js
npm install sqube-agent-guard
import { ExecutionGuard } from "sqube-agent-guard";
const guard = new ExecutionGuard();
const run = guard.wrapAction({ action: "file.read" }, () => "ok");
await run();
Rust
Clone the repository and build from rust/.