#[non_exhaustive]pub struct ScopeAttributes {
pub agent_id: Option<String>,
pub on_behalf_of_agent: Option<String>,
pub delegates: bool,
pub flow_id: Option<String>,
pub run_id: Option<String>,
}Expand description
The authority-controlled attributes the daemon copies into scope stamps,
subject to each field’s target capability gate.
Only an owner module named in the daemon config’s scope_authority_owners
list (by default the module that owns agent sessions) may set them; a scope
owned by any other module must leave them empty.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.agent_id: Option<String>The agent the scope’s session belongs to. Identity, never permission.
on_behalf_of_agent: Option<String>Attribution only, never authority. A provider may use this to choose
identity-scoped presentation (bot choice, read budgets, bound
repositories) and for logging. It must never treat this as authority to
act as that agent, hand out the agent’s per-agent handles or consent on
its strength, or treat it as agent_id.
Set only by a scope-authority owner and validated with agent_id’s
token rule. Mutually exclusive with agent_id, delegates and flow_id;
run_id requires agent_id and is therefore excluded too. Adding,
changing or removing this within an epoch increments the content version
and closes routes with scope_delegation_changed. Bind stamps include
it only for targets providing SCOPE_ON_BEHALF_OF_CAPABILITY; describe
replies include it only for callers providing that capability.
delegates: boolWhether a provider may act as agent_id. Refused without agent_id.
flow_id: Option<String>This scope belongs to the named flow, an automated workflow run on an
agent’s behalf. Set only by an authority owner (see above), validated
with validate_flow_id, and stamped verbatim. It needs neither
agent_id nor delegates. Providers treat a module other than the
owner that opens a route under a flow scope as the flow’s carrier.
Like an agent_id change, changing this within the same scope epoch is
accepted: the scope’s content version increases (the number providers
compare to notice a change), and every route under the scope is closed
with the reason scope_delegation_changed, so no live route keeps the
old identity.
A target must provide FLOW_SCOPES_CAPABILITY or
crate::call_mode::CALL_MODES_CAPABILITY before the daemon may send a
bind stamped with this field. Decoding it alone is not enough:
the target must also apply flow behaviour instead of agent behaviour.
run_id: Option<String>Identifies one run carried out on behalf of agent_id. Requires
agent_id, forbids flow_id, and uses
validate_run_id’s token rule.
Adding, changing or removing it within an epoch increments the scope’s
content version and closes routes under the scope with
scope_delegation_changed. The daemon sends this field in a bind only to
a target module providing AGENT_RUN_SCOPES_CAPABILITY or
crate::call_mode::CALL_MODES_CAPABILITY. A delegating run scope is
accepted as a record, but binds only to a target providing the latter.