> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Tool Policy • AI Agent SDK

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

# ToolPolicy

> Defined in the [**protocols**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) 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).

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%

graph LR
    agent["Agent"] -- "uses" --> tool["Tool: ToolPolicy"]
    tool -- "returns" --> result["Result"]
    style tool fill:#189AB4,color:#fff
    style agent fill:#8B0000,color:#fff
    style result fill:#8B0000,color:#fff
```

## Properties

**allow\_tools** `Optional`

No description available.

**deny\_tools** `Set[str]`

No description available.

**deny\_substrings** `List[str]`

No description available.

## Methods

> [card] [is\_noop()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ToolPolicy-is_noop.md)
>
> `True` when the policy would never remove any tool.

> [card] [is\_tool\_allowed()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ToolPolicy-is_tool_allowed.md)
>
> Return `True` if `tool` may be exposed on this route.

> [card] [filter\_tools()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ToolPolicy-filter_tools.md)
>
> Return a copy of `tools` with denied/disallowed tools removed.

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L2241)
>
> `praisonaiagents/gateway/protocols.py` at line 2241

***

## Related Documentation

> [card] [Tools Concept](https://praison.ai/docs/docs/concepts/tools)

> [card] [Create Custom Tools](https://praison.ai/docs/docs/guides/tools/create-custom-tools)

> [card] [Tool Development](https://praison.ai/docs/docs/tutorials/advanced-tool-development)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.