Agent policy and enforcement: where the guard runs
How an agent's policy is enforced by the Sigill SDK inside your own process, what Sigill checks afterwards, what happens when Sigill is unreachable, and what leaves your systems.
Agent policy and enforcement: where the guard runs
Two things happen, in two places.
- In your agent: a guard in the Sigill SDK applies the policy before each action. It can refuse a tool call or halt the run, and it records every decision in the run's evidence.
- In Sigill: when the run has ended, Sigill checks the record against the approved policy, seals that evaluation and alerts your team to findings.
Sigill never stops an action itself. Enforcement is done by your own SDK, in your own process.
A policy
A policy is a control set: Cedar rules plus what they refer to. This rule refuses one tool outright.
"no-file-deletion": {
"effect": "forbid",
"principal": { "op": "All" },
"action": { "op": "==", "entity": { "type": "Action", "id": "tool_call" } },
"resource": { "op": "==", "entity": { "type": "Tool", "id": "fs.delete" } },
"conditions": [],
"annotations": { "id": "no-file-deletion", "effect": "deny" }
}
A rule's effect is observe, deny or halt. The control set's enforcement.mode decides whether the guard acts (enforce) or only reports matches (observe). You register the policy under Evidence → Agents so an owner can approve it before the first run.
Turning the guard on
from sigill_sdk import AgentPolicy, CedarEngine, Enforcement, PolicyDenied, RunHalted
run = client.start_agent_run(agent, certificate_id=cert_id, activity="refund",
control_set=AgentPolicy.control_set_from_document(document),
enforcement=Enforcement(CedarEngine()))
try:
result = run.invoke_tool("payments.refund", args_json, lambda: refund(args_json),
consequential=True) # refund() runs only if the call is allowed
except PolicyDenied as denied:
print(denied.reason, denied.rules)
except RunHalted:
pass # the run is over; stop the agent
Install with pip install "sigill-sdk[policy]". The Cedar engine is the official Cedar core, bundled as a WebAssembly module and run in-process with no network, filesystem or clock access. A decision does not call Sigill.
What happens when something is unreachable
- Sealing a step needs Sigill. If a step cannot be sealed, the SDK breaks the run and the tool does not run.
- Showing the run in Sigill never stops it. Uploads to your evidence index are retried at later steps. In the worst case, with the index unreachable, a step can take up to 10 seconds longer and the end of the run up to 30 seconds.
- A decision has no timeout. An engine that does not answer holds the run; an engine that fails halts it.
What leaves your systems
Sealing sends digests only. If you also deliver the run so it shows in Sigill, each step's signed envelope is uploaded: agent and run identifiers, step types and times, tool names, decisions and rule ids, model names and token counts, object sizes and types, and any detail text you wrote.
Never uploaded: arguments, results, prompts, outputs. The policy document is uploaded only if you choose to disclose it.
What it does and does not show
- A refusal means the SDK refused the call. It does not mean the tool could not be reached another way.
- The evidence shows the refusal and that no result was recorded. It does not prove the tool did not run.
- Anyone with the control set and the signed events can recompute every decision.
- Model calls the SDK cannot recognise are not recorded, so no rule sees them.
- An approval is registered and sealed by Sigill. It shows that Sigill recorded the owner's approval and when, not that the owner signed it personally.
Where it runs today
- SDKs for Python and .NET, both at version 0.x. The guard is available from SDK 0.14.0.
- Model calls are recorded automatically for clients built on httpx: Anthropic, OpenAI, Azure OpenAI, Amazon Bedrock, Gemini API and Vertex AI.
- A ready-made plugin exists for Claude Code and OpenAI Codex; see Agents seal their own work. For other agents you wrap your own tool loop with
invoke_tool.
The full reference is in the API docs and in the SDK's README.