Governance
Policies
Policies decide what an agent may do. Antraft is default-deny: only what you explicitly allow (or a rule permits) can run.
Allow / deny
policy.py
runtime = ( Antraft.agent(model, tools, task="...") .allow(["search_web", "read_file"]) .deny(["shell_execute"]) .build())Note
Anything not allowed (and not matched by a rule) is denied. A denied action stops the run.
Decisions
| Decision | Effect |
|---|---|
allow | The tool runs. |
deny | The action is blocked; the run stops. |
pause | Execution pauses for human approval (HITL). |
DSL rules
Rules add conditional logic on an action's parameters and runtime context.
policy.yaml
allow: - wire_transferrules: - trigger: "action:wire_transfer" checks: ["amount > 1000"] enforce: pause # allow | deny | pause message: "Large transfer needs approval"load.py
Antraft.agent(model, tools, task="...").load_policy("policy.yaml").build()Prerequisites & limits
Policies can require that one action ran before another, and cap totals such asmax_actions. Budgets (tokens and dollars) are covered on the next page.
policy.yaml
prerequisites: read_data: ["authenticate"] # must authenticate before readinglimits: hard: max_actions: 50Dynamic updates
Policies can be updated on a running agent (continuous authorization) via the control plane.
shell
PUT /agents/{agent_id}/policy # new policy JSON