Skip to content

Tool Gating

Tool gating controls which tools your agent is allowed to call during execution.

policies:
tools:
allowed: [web_search, calculator, pdf_reader]
deny_by_default: true
FieldTypeDefaultDescription
allowedlist[str][]Tool names the agent is permitted to use
deny_by_defaultbooltrueWhen true, any tool not in allowed is blocked. When false, all tools are permitted.

The is_tool_allowed() function (in both dockrion_policy/tool_guard.py and RuntimePolicyEngine):

if deny_by_default is false → allow all tools
if deny_by_default is true → only allow tools in the allowed list
deny_by_defaultallowed listTool “web_search”Tool “send_email”
true[web_search, calculator]AllowedBlocked
true[] (empty)BlockedBlocked
false[web_search]AllowedAllowed
false[]AllowedAllowed
Section titled “Strict allowlist (recommended for production)”
policies:
tools:
allowed: [web_search, calculator, database_query]
deny_by_default: true

Only the three listed tools can be called. Any other tool call is blocked.

policies:
tools:
deny_by_default: false

All tools are allowed. Useful during development when you’re iterating on which tools the agent needs.

policies:
tools:
allowed: []
deny_by_default: true

No tools can be called. The agent can only use its own logic without external tool calls.

Tool gating is advisory — the runtime provides the is_tool_allowed() check, but enforcement depends on how the adapter/framework is configured:

  • LangGraph: Your graph can check is_tool_allowed() before executing tool nodes
  • Handler mode: Your handler function can call the policy engine to check tool permissions
  • Future: Automatic tool interception at the adapter level is planned

Source: ToolPolicy in packages/schema/dockrion_schema/dockfile_v1.py; is_tool_allowed() in packages/policy-engine/dockrion_policy/tool_guard.py


Previous: Output Controls | Up: Policies Overview