Expand description
Execution nonces prevent TOCTOU races between capability evaluation and tool-server dispatch.
An ExecutionNonce is a short-lived, single-use token that the kernel
attaches to every Verdict::Allow response. Tool servers MUST present
the nonce before executing; the kernel rejects stale (>nonce_ttl_secs,
default 30s) or replayed nonces. This closes the time-of-check /
time-of-use window between evaluate() and tool-server execution that
DPoP alone cannot close.
§Design
- The nonce body is an opaque
nonce_idplus aNonceBindingthat binds the nonce to the exact(subject, capability, server, tool, request_id, parameter_hash)tuple. Substituting a nonce between unrelated tool calls therefore fails the binding check. - The kernel signs the full body (nonce id + binding + expires_at) with its receipt-signing key, so downstream tool servers can cryptographically verify authenticity without a round trip.
- Replay is prevented by an
ExecutionNonceStore: the firstreserve(nonce_id)returns true and consumes the nonce; any subsequent reservation returns false and the verify path rejects.
§Backward compatibility
The whole feature is opt-in by installing an ExecutionNonceConfig.
With no config installed, no nonce is minted and non-nonce callers keep
working. With a config installed and require_nonce == false, allow
responses carry nonces and dispatch verifies any nonce that is presented,
but callers that omit the nonce remain backward-compatible. New strict
deployments flip require_nonce to make every execution-bound dispatch
present a fresh nonce.
Structs§
- Execution
Nonce - Signable body of a kernel-issued execution nonce.
- Execution
Nonce Config - Configuration for execution nonce issuance and verification.
- InMemory
Execution Nonce Store - In-memory LRU-backed execution nonce store.
- Nonce
Binding - Fields that bind an execution nonce to one tool invocation.
- Signed
Execution Nonce - Kernel-signed execution nonce carried across agent/kernel transports.
Enums§
- Execution
Nonce Error - All the reasons an execution nonce can fail verification.
Constants§
- DEFAULT_
EXECUTION_ NONCE_ STORE_ CAPACITY - Default capacity for the in-memory replay-prevention LRU cache.
- DEFAULT_
EXECUTION_ NONCE_ TTL_ SECS - Default TTL for a freshly minted execution nonce.
- EXECUTION_
NONCE_ SCHEMA - Schema identifier for Chio execution nonces.
Traits§
- Execution
Nonce Store - Persistence boundary for replay-prevention of execution nonces.
Functions§
- consume_
execution_ nonce - is_
supported_ execution_ nonce_ schema - mint_
execution_ nonce - Mint a fresh signed execution nonce.
- mint_
execution_ nonce_ with_ reservation - verify_
execution_ nonce - Verify a signed execution nonce against the expected binding.
- verify_
execution_ nonce_ without_ consume