Tool Policy • AI Agent SDK

ToolPolicy: Declarative, per-route scope applied to an agent's tool surface.

ToolPolicy

Defined in the protocols module.

AI Agent

Declarative, per-route scope applied to an agent’s tool surface.

Mirrors the scheduler’s `RunPolicy.filter_tools contract (wrapper layer) but lives in core so :class:RouteBinding` can declare the scope without importing any heavy wrapper code. The wrapper inbound path applies it via a small apply/restore helper, exactly as the scheduler already does for unattended runs.

Attributes: allow_tools: If set, only tools whose name is in this set are kept; everything else is removed. `None means "allow all except deny_tools / the trust deny-list". deny_tools: Exact tool names removed before the run. deny_substrings: Case-insensitive substrings; a tool whose name contains any of them is removed (used by the untrusted` tier).

Diagram

uses

returns

Agent

Tool: ToolPolicy

Result

Properties

ResponseField Optional

No description available.

ResponseField Set[str]

No description available.

ResponseField List[str]

No description available.

Methods

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 2241


Related Documentation