Tool Policy • AI Agent SDK
tool_policy: Build the :class:`ToolPolicy` this binding declares, if any.
tool_policy
Method
</div>
This is a method of the RouteBinding class in the protocols module.
Build the :class:ToolPolicy this binding declares, if any.
Returns `None when the binding does not constrain the toolset, so callers can cheaply skip the apply/restore dance for trusted routes. The untrusted trust tier seeds a conservative substring deny-list; explicit allow_tools / deny_tools` layer on top of it.
Signature
def tool_policy() -> Optional['ToolPolicy']Returns
ResponseField
Optional['ToolPolicy']The result of the operation.
Uses
ToolPolicy
Source
View on GitHubpraisonaiagents/gateway/protocols.py at line 2452