#[non_exhaustive]pub enum Expr {
Show 35 variants
True,
False,
And(Vec<Expr>),
Or(Vec<Expr>),
Not(Box<Expr>),
HasCapability(String),
HasAllCapabilities(Vec<String>),
HasAnyCapability(Vec<String>),
IssuerIs(String),
IssuerIn(Vec<String>),
SubjectIs(String),
DelegatedBy(String),
NotRevoked,
NotExpired,
ExpiresAfter(i64),
IssuedWithin(i64),
RoleIs(String),
RoleIn(Vec<String>),
RepoIs(String),
RepoIn(Vec<String>),
RefMatches(String),
PathAllowed(Vec<String>),
EnvIs(String),
EnvIn(Vec<String>),
WorkloadIssuerIs(String),
WorkloadClaimEquals {
key: String,
value: String,
},
IsAgent,
IsHuman,
IsWorkload,
MaxChainDepth(u32),
AttrEquals {
key: String,
value: String,
},
AttrIn {
key: String,
values: Vec<String>,
},
MinAssurance(String),
AssuranceLevelIs(String),
ApprovalGate {
inner: Box<Expr>,
approvers: Vec<String>,
ttl_seconds: u64,
scope: Option<String>,
},
}Expand description
Serializable policy expression.
This is the wire format stored in JSON/TOML files. All identifiers are strings.
Must be compiled to CompiledPolicy before evaluation.
Compilation validates and canonicalizes all string fields.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
True
Always allow.
False
Always deny.
And(Vec<Expr>)
All children must evaluate to Allow.
Or(Vec<Expr>)
At least one child must evaluate to Allow.
Not(Box<Expr>)
Invert the child’s outcome.
HasCapability(String)
Subject must have this capability.
HasAllCapabilities(Vec<String>)
Subject must have all listed capabilities.
HasAnyCapability(Vec<String>)
Subject must have at least one of the listed capabilities.
IssuerIs(String)
Issuer DID must match exactly.
IssuerIn(Vec<String>)
Issuer DID must be in the set.
SubjectIs(String)
Subject DID must match exactly.
DelegatedBy(String)
Attestation must be delegated by this DID.
NotRevoked
Attestation must not be revoked.
NotExpired
Attestation must not be expired.
ExpiresAfter(i64)
Attestation must have at least this many seconds remaining.
IssuedWithin(i64)
Attestation must have been issued within this many seconds.
RoleIs(String)
Subject’s role must match exactly.
RoleIn(Vec<String>)
Subject’s role must be in the set.
RepoIs(String)
Repository must match exactly.
RepoIn(Vec<String>)
Repository must be in the set.
RefMatches(String)
Git ref must match the glob pattern.
PathAllowed(Vec<String>)
All paths must match at least one of the glob patterns.
EnvIs(String)
Environment must match exactly.
EnvIn(Vec<String>)
Environment must be in the set.
WorkloadIssuerIs(String)
Workload issuer DID must match exactly.
WorkloadClaimEquals
Workload claim must equal the expected value.
IsAgent
Signer must be an AI agent.
IsHuman
Signer must be a human.
IsWorkload
Signer must be a workload (CI/CD).
MaxChainDepth(u32)
Delegation chain depth must not exceed this value.
AttrEquals
Match a flat string attribute. Keys must be alphanumeric+underscore,
max 64 chars. No dot-paths. No nested JSON. No Value type.
AttrIn
Attribute must be one of the values.
Fields
MinAssurance(String)
Assurance level must be at least this level (uses Ord comparison).
AssuranceLevelIs(String)
Assurance level must match exactly.
ApprovalGate
Approval gate: if inner evaluates to Allow, return RequiresApproval instead. Transparent to Deny/Indeterminate — those pass through unchanged.