pub enum CapabilityScope {
Http {
allowed_hosts: Vec<String>,
identity: EgressIdentity,
},
Grpc {
allowed_methods: Vec<String>,
identity: EgressIdentity,
},
Complete {
allowed_models: Vec<String>,
},
Mcp {
allowed_tools: Vec<String>,
},
Database {
allowed_queries: Vec<String>,
},
Secrets {
allowed_secrets: Vec<String>,
},
}Expand description
Per-capability-kind scope, carried on a crate::CapabilityGrant.
Each variant’s allowlist is the deny-by-default boundary a real
ComponentValidator implementor enforces (ADR-001): a capability call
naming a target outside its own allowlist is rejected, checked again on
every call, not just once at grant-registration time.
["*"] is a real, explicit opt-in to “unrestricted” for Http/Grpc/
Complete/Mcp only. Database/Secrets never accept a wildcard,
under any circumstance — every entry in allowed_queries/
allowed_secrets must individually name one specific, deployer-
pre-registered query or secret. This is a permanent security boundary
of the design (no raw-SQL capability is ever offered to a guest, and no
blanket secret-store access), not a v1 limitation a future grant format
might relax.
Variants§
Http
Scopes http-egress: the hostnames this grant may reach, and which
identity mechanism to present.
Fields
identity: EgressIdentityWhich identity mechanism the call presents to allowed_hosts.
Grpc
Scopes grpc-egress: the fully-qualified "pkg.Service/Method"
names this grant may invoke, and which identity mechanism to present.
Fields
identity: EgressIdentityWhich identity mechanism the call presents to the bound target.
Complete
Scopes llm-complete: the model ids this grant may call.
Mcp
Scopes mcp-egress: the remote tool names this grant may call.
Database
Scopes database: the deployer-pre-registered, parameterized query
names this grant may invoke. Never accepts a wildcard — see this
type’s own doc comment.
Secrets
Scopes secrets: the individually-named secrets this grant may
read. Never accepts a wildcard — see this type’s own doc comment.
Trait Implementations§
Source§impl Clone for CapabilityScope
impl Clone for CapabilityScope
Source§fn clone(&self) -> CapabilityScope
fn clone(&self) -> CapabilityScope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more