Skip to main content

RouteBinding

Defined in the protocols 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. 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

str
No description available.
Optional[str]
No description available.
Optional[str]
No description available.
Optional[str]
No description available.
Optional[str]
No description available.
Optional[str]
No description available.
int
No description available.
Optional[str]
No description available.
Optional
No description available.
Optional
No description available.
Optional[str]
No description available.

Methods

specificity()

Sum of weights for the conditions this binding constrains on.

matches()

Return True if every constrained condition equals the facts.

tool_policy()

Build the :class:ToolPolicy this binding declares, if any.
  • from_dict: Create a binding from a YAML/dict mapping.

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 1672