> ## 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.

# Route Binding • AI Agent SDK

> RouteBinding: A single declarative inbound-routing rule.

# RouteBinding

> Defined in the [**protocols**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) module.

AI Agent

A single declarative inbound-routing rule.

A binding maps a set of optional inbound conditions to a handling agent.
Bindings are evaluated most-specific-first so operators get deterministic,
debuggable routing across a fleet of agents behind one gateway.

All condition fields are optional; `None` means "do not constrain on this
field". A binding matches a set of :class:`RouteFacts` only when *every*
non-`None` condition equals the corresponding fact.

Attributes:
agent: The agent id to route to when this binding matches.
chat\_type: Chat type ("dm" | "group" | "channel").
peer: Sender/user id (most specific).
role: Role / guild-role membership of the sender.
channel\_id: Specific chat/channel id. Also matches a message whose
parent channel is this id (a thread/forum-post under it), so a
channel-level route naturally covers the threads beneath it
without listing each thread by hand (Issue #4839).
thread\_id: Specific thread / forum-post id (most specific unit — one
triage-spun support thread can route to a specialist agent,
Issue #4839).
guild\_id: Server / workspace id. One rule covers every current and
future channel in the guild, so an operator can multiplex by the
tenant boundary they actually think in (Issue #4839).
account: Receiving bot account (for multi-account channels).
priority: Higher wins; ties are broken by specificity then order.
trust: Optional trust tier ("untrusted" | "standard" | "trusted").
`untrusted` advertises a conservative, read-only-leaning toolset
to the model so dangerous tools are never offered on third-party /
stranger / generic-webhook routes (Issue #2298). `None` /
`standard` / `trusted` apply no tier deny-list.
allow\_tools: If set, only these tool names are exposed on this route.
deny\_tools: Tool names removed before the run on this route.
profile: Optional isolated tenant-profile name (Issue #3189). Names a
per-route isolation scope the wrapper enters for the turn (e.g. its
own memory namespace / secret scope / home), so one gateway can
safely multiplex tenants. `None` means the route is unscoped; the
wrapper must fail closed (never fall back to another tenant's
profile) rather than silently share memory/secrets.

## Properties

**agent** `str`

No description available.

**chat\_type** `Optional[str]`

No description available.

**peer** `Optional[str]`

No description available.

**role** `Optional[str]`

No description available.

**channel\_id** `Optional[str]`

No description available.

**account** `Optional[str]`

No description available.

**priority** `int`

No description available.

**trust** `Optional[str]`

No description available.

**allow\_tools** `Optional`

No description available.

**deny\_tools** `Optional`

No description available.

**profile** `Optional[str]`

No description available.

**thread\_id** `Optional[str]`

No description available.

**guild\_id** `Optional[str]`

No description available.

## Methods

> [card] [specificity()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/RouteBinding-specificity.md)
>
> Sum of weights for the conditions this binding constrains on.

> [card] [matches()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/RouteBinding-matches.md)
>
> Return True if every constrained condition equals the facts.

> [card] [tool\_policy()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/RouteBinding-tool_policy.md)
>
> Build the :class:`ToolPolicy` this binding declares, if any.

> [accordion] Internal & Generic Methods
>
> * **from\_dict**: Create a binding from a YAML/dict mapping.

## Source

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


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