#[non_exhaustive]pub struct ScopeAttributes {
pub federated: Option<FederatedAttributes>,
pub agent_id: Option<String>,
pub on_behalf_of_agent: Option<String>,
pub delegates: bool,
pub flow_id: Option<String>,
pub flow_version: Option<u64>,
pub flow_code_hash: Option<String>,
pub flow_install_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.
The separate federated object is restricted to the configured federated
owner instead, and never confers local-agent authority.
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.federated: Option<FederatedAttributes>Paired-peer facts, required only for a federated scope. Never local authority.
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.
With run_id and no agent_id it marks a worker run (see
WORKER_RUNS_CAPABILITY). 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, except that a worker run’s
bind, which reaches only a target providing WORKER_RUNS_CAPABILITY,
always includes it. Describe replies include it only for callers
providing SCOPE_ON_BEHALF_OF_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.
flow_version: Option<u64>The approved installed version, from 1 through 2^53 - 1. Together with
flow_code_hash and flow_install_id, requires flow_id and is immutable
within an epoch (scope_flow_identity_changed). Stamped only for readers
providing FLOW_IDENTITY_SCOPES_CAPABILITY.
flow_code_hash: Option<String>SHA-256 of the approved flow code: exactly 64 lowercase hex characters.
Present together with flow_version and flow_install_id, under the same
authority, immutability and capability rules.
flow_install_id: Option<String>Opaque installed-flow token, validated with validate_flow_install_id.
Present together with flow_version and flow_code_hash, under the same
authority, immutability and capability rules.
run_id: Option<String>Identifies one run: an agent run on behalf of agent_id, or a worker run
attributed to on_behalf_of_agent without that agent’s authority. A
record with run_id carries exactly one of the two, 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 an agent run’s 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.
A worker run binds only to a target providing WORKER_RUNS_CAPABILITY.