pub struct EffectiveBindingPolicy {Show 25 fields
pub binding_index: Option<usize>,
pub allowed_tools: Vec<String>,
pub outbound_allowlist: OutboundAllowlistConfig,
pub skills: Vec<String>,
pub model: ModelConfig,
pub system_prompt: String,
pub sender_rate_limit: Option<SenderRateLimitConfig>,
pub allowed_delegates: Vec<String>,
pub remote_triggers: Vec<RemoteTriggerEntry>,
pub language: Option<String>,
pub link_understanding: LinkUnderstandingConfig,
pub web_search: WebSearchPolicy,
pub pairing: PairingPolicy,
pub dispatch_policy: DispatchPolicy,
pub proactive: ProactiveConfig,
pub role: Option<String>,
pub lsp: LspPolicy,
pub team: TeamPolicy,
pub config_tool: ConfigToolPolicy,
pub repl: ReplConfig,
pub auto_approve: bool,
pub workspace_path: Option<PathBuf>,
pub channel: Option<String>,
pub account_id: Option<String>,
pub tool_rate_limits: Option<ToolRateLimitsConfig>,
}Expand description
Concrete capability snapshot for one session attached to one binding.
Held behind an Arc so it can be cheaply cloned into session tasks,
tool handlers, and rate-limiter lookups.
Fields§
§binding_index: Option<usize>Index of the matched binding in AgentConfig::inbound_bindings
when the runtime resolved the event to a concrete binding.
None for policies synthesised from agent-level defaults
(legacy bindingless agents, delegation receive, heartbeat).
Used for tracing/telemetry and as the cache key for per-binding
tool registries and sender rate limiters.
allowed_tools: Vec<String>Replaces AgentConfig::allowed_tools for this session. The special
value ["*"] means “every registered tool”; any other content is
matched with the usual trailing-* glob convention.
outbound_allowlist: OutboundAllowlistConfig§skills: Vec<String>§model: ModelConfig§system_prompt: StringFully composed system prompt (agent base + optional addendum).
sender_rate_limit: Option<SenderRateLimitConfig>Resolved rate limit: None means “no per-sender cap on this
binding”, Some(cfg) means “apply cfg”. Both the Disable
keyword and an absent agent-level limit resolve to None.
allowed_delegates: Vec<String>§remote_triggers: Vec<RemoteTriggerEntry>Phase 79.8 — resolved RemoteTrigger destination allowlist.
InboundBinding::remote_triggers replaces the agent-level list when
present; otherwise the agent-level remote_triggers is inherited.
language: Option<String>Output language for LLM replies. None = no directive (model
picks based on user input). When Some(lang), the runtime
renders a # OUTPUT LANGUAGE system block telling the model
to reply in that language while keeping workspace docs
(English) as-is.
link_understanding: LinkUnderstandingConfigPhase 21 — resolved link-understanding config (per-binding override over agent-level default). Disabled by default; operators opt in per agent or per channel.
web_search: WebSearchPolicyPhase 25 — resolved web-search policy. Disabled by default.
provider == "auto" (or empty) lets the router pick by
available credentials.
pairing: PairingPolicyPhase 26 — pairing policy. Default auto_challenge=false,
i.e. the inbound gate is a no-op. Per-binding config can flip
this on for user-facing surfaces (whatsapp / telegram).
dispatch_policy: DispatchPolicyPhase 67.D.1 — resolved project-tracker dispatch policy.
mode == None (default) keeps program_phase and friends
unregistered for this binding; read_only exposes the
query tools; full exposes the dispatch surface. The
DispatchGate (67.D.2) consumes this together with the
pairing trust signal before admitting a program_phase
call.
proactive: ProactiveConfigPhase 77.20 — resolved proactive tick-loop config for this binding.
role: Option<String>Optional binding role tag (coordinator, worker, proactive).
lsp: LspPolicyPhase 79.5 — resolved LSP policy. Per-binding override replaces
the agent-level lsp block; binding None inherits.
team: TeamPolicyPhase 79.6 — resolved team policy. Per-binding override replaces
the agent-level team block.
config_tool: ConfigToolPolicyPhase 79.10 — resolved config-tool policy (gates self-edit,
allowed_paths, approval_timeout). Per-binding override replaces
the agent-level config_tool block.
repl: ReplConfigPhase 79.12 — resolved REPL config. Per-binding override replaces
the agent-level repl block. Closes a latent bug: the override
was already declared on InboundBinding::repl but never consumed
by the resolver before C1.
auto_approve: boolPhase 80.17 — resolved auto-approve dial. false (default)
keeps the existing interactive-approval behaviour; true
enables auto-allow for the curated tool subset (read-only +
scoped writes + notifications + multi-agent coordination).
Destructive bash, writes outside workspace_path, ConfigTool,
REPL, remote_trigger, schedule_cron and unknown tools always
fall through to the interactive prompt regardless of this
flag. Composes with Phase 16 binding policy: the flag never
adds tools to the binding’s surface, only skips approval for
tools already on the surface AND in the curated subset.
workspace_path: Option<PathBuf>Phase 80.17 — canonical workspace path used by the auto-approve
dial to scope FileEdit / FileWrite. None disables the
workspace-bounded auto-allow path (those tools always ask).
Set at boot from agent.workspace.
channel: Option<String>Phase 82.1 Step 2 — channel name copied from
InboundBinding.plugin ("whatsapp" / "telegram" /
"email" / "web" / …) when the runtime resolved the
inbound to a concrete binding. None for synthesised
policies (delegation receive, heartbeat, tests). Feeds
the BindingContext propagated to tool calls so
extensions and MCP servers can route per-channel.
account_id: Option<String>Phase 82.1 Step 2 — account / instance discriminator
copied from InboundBinding.instance. None when the
binding declared no instance (single-account default)
or for synthesised policies.
tool_rate_limits: Option<ToolRateLimitsConfig>Phase 82.7 — resolved per-binding tool rate-limit
overrides. None (default) inherits the global
AgentConfig.tool_rate_limits (or unlimited if neither
is set). Some(map) FULLY REPLACES the global decision
for this binding — no fall-through to global patterns.
Operators wanting per-binding tighter caps with global
fallback must explicitly include the global patterns in
the binding map.
Implementations§
Source§impl EffectiveBindingPolicy
impl EffectiveBindingPolicy
Sourcepub fn binding_id(&self) -> Option<String>
pub fn binding_id(&self) -> Option<String>
Phase 82.1 Step 2 — render the stable
<channel>:<account_id|"default"> binding identifier.
Returns None when the policy has no channel match
(synthesised — delegation / heartbeat / tests).
Reusable across tests and downstream consumers; the
binding_context_from_effective free fn calls this
helper to fill the BindingContext.binding_id field.
Source§impl EffectiveBindingPolicy
impl EffectiveBindingPolicy
Sourcepub fn resolve(agent: &AgentConfig, binding_index: usize) -> Self
pub fn resolve(agent: &AgentConfig, binding_index: usize) -> Self
Build the effective policy for the binding_index-th binding of
agent. Out-of-range indices fall back to the agent-level defaults
so callers in legacy/unbound code paths can still produce a policy.
Sourcepub fn from_agent_defaults(agent: &AgentConfig) -> Self
pub fn from_agent_defaults(agent: &AgentConfig) -> Self
Build a policy that simply mirrors agent-level settings, used by
code paths that don’t have a matched binding (delegation intake,
heartbeat wake-ups, tests). binding_index is None so the
cache key space for real bindings (0..N) stays disjoint from
the legacy/unbound path.
Sourcepub fn resolved(agent: &AgentConfig, binding_index: usize) -> Arc<Self> ⓘ
pub fn resolved(agent: &AgentConfig, binding_index: usize) -> Arc<Self> ⓘ
Convenience helper for the common Arc-wrapped usage.
Sourcepub fn tool_allowed(&self, name: &str) -> bool
pub fn tool_allowed(&self, name: &str) -> bool
Check whether a tool name is permitted by this binding’s
allowlist. Rules:
- empty list → every tool allowed (back-compat: agents that don’t narrow the set).
"*"entry → every tool allowed.- pattern ending in
*→ prefix match. - anything else → exact match.
Used in the LLM turn loop both to prune the tool list shown to the model and to deny execution of anything the model calls from outside the allowlist (defense-in-depth).
Trait Implementations§
Source§impl Clone for EffectiveBindingPolicy
impl Clone for EffectiveBindingPolicy
Source§fn clone(&self) -> EffectiveBindingPolicy
fn clone(&self) -> EffectiveBindingPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for EffectiveBindingPolicy
impl RefUnwindSafe for EffectiveBindingPolicy
impl Send for EffectiveBindingPolicy
impl Sync for EffectiveBindingPolicy
impl Unpin for EffectiveBindingPolicy
impl UnsafeUnpin for EffectiveBindingPolicy
impl UnwindSafe for EffectiveBindingPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more