Allow-lists and default deny
Default deny is the policy engine's starting point: an engine with no rules refuses every tool, and you open it up by naming, per role, exactly what may run.
Last updated: 14 Oct, 2026 · Agent Governance Toolkit 4.1.0
The One choke point for every tool call lesson built a policy with one allow-list and moved on. This lesson looks at what that allow-list does, and at what an engine with no allow-list does, which is the opposite of the fail-open default govern() had in the first part.
An engine that has never heard of a role
A brand new PolicyEngine knows about no roles. Ask whether a role may use a tool and the method the kernel calls for you, check_violation, refuses.
from agent_control_plane import PolicyEngine
policy = PolicyEngine() # nothing configured yet
print(policy.check_violation("support", "order_status", {}))Role support cannot use tool order_status
check_violation returns None when the call is allowed and a sentence when it is refused, the same convention the gate itself uses. A role the engine has never seen has no tools, so a forgotten configuration fails shut rather than open.
Naming what a role may call
add_constraint(role, allowed_tools) gives a role its allow-list. Everything on the list is permitted; everything else follows from that, with no need to list what is forbidden.
policy = PolicyEngine()
policy.add_constraint("support", ["order_status", "refund"])
for tool in ["order_status", "refund", "delete_account", "reply"]:
print(f"{tool:16} {policy.check_violation('support', tool, {})}")order_status None refund None delete_account Role support cannot use tool delete_account reply Role support cannot use tool reply
Two tools were allowed and two refused, and the refused tools were never named anywhere. You write down what is permitted; a tool added to the agent later is refused until someone decides it should run.
A second call replaces the list
add_constraint sets the complete list for a role, so a second call for the same role replaces the first rather than adding to it.
policy.add_constraint("support", ["reply"]) # a second call for the same role
print(policy.check_violation("support", "order_status", {}))
print(policy.check_violation("support", "reply", {}))Role support cannot use tool order_status None
order_status is refused now, because it is not in the list the second call set. When a role needs one more tool, pass its whole list again with the new tool in it.
Allow-list or deny-list
There are two ways to write down which tools an agent may use, and they differ on exactly one case.
- A deny-list names what is forbidden, and everything else is allowed. A tool added later is allowed by accident.
- An allow-list names what is permitted, and everything else is refused. A tool added later is refused until someone adds it.
add_constraintwrites this kind.
| A tool the list was written before | Deny-list | Allow-list |
|---|---|---|
delete_account (named in the deny-list) | Refused | Refused |
wire_transfer (added to the agent later) | Allowed | Refused |
Both refuse the tool the deny-list names. But a tool added after the list was written sails through a deny-list, because forbidding it was never written down, while the allow-list refuses it until someone asks. That is why the engine uses allow-lists.
Where default deny matters
- A new deployment, where a missing or half-written policy should block every call rather than wave it through.
- An agent that grows new tools over time, so each new tool is refused until it is deliberately allowed.
- Several roles on one engine, where a read-only role is given a short list and everything else is denied.
check_violation("suport", ...) is treated as a role with no permissions, so every call is silently refused and the program keeps running. A signed identity, which An agent that can prove who it is builds, is the toolkit's answer to a role you can mistype.Related
- Previous: One choke point for every tool call
- Next: Checking a tool's arguments
- Add a
readonlyrole that may only callorder_statusand confirm it cannot refund. - Misspell the role in
check_violationand watch every call come back refused with no error. - Give
supportone more tool by callingadd_constraintagain with its whole new list.
This is what real progress feels like.