Agent Governance ToolkitAgent Governance Toolkit 4.1.0 · Python 3.10+
Dashboard
0%

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.

ExampleA fresh engine refuses a role it has never heard of
from agent_control_plane import PolicyEngine

policy = PolicyEngine()                       # nothing configured yet
print(policy.check_violation("support", "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.

ExampleTwo tools allowed, the rest refused by default
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, {})}")

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.

ExampleThe new list wins; order_status is gone
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", {}))

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_constraint writes this kind.
A tool the list was written beforeDeny-listAllow-list
delete_account (named in the deny-list)RefusedRefused
wire_transfer (added to the agent later)AllowedRefused

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.
Watch out. A misspelt role name raises no error. 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.
Try it yourself
  • Add a readonly role that may only call order_status and confirm it cannot refund.
  • Misspell the role in check_violation and watch every call come back refused with no error.
  • Give support one more tool by calling add_constraint again with its whole new list.

This is what real progress feels like.