Expand description
Phase 1.1: Execution Nonces (TOCTOU fix).
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, 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. When ExecutionNonceConfig::require_nonce
is false (the default), no nonce is minted and the verify path is a
no-op. Existing non-nonce deployments keep working; new tool servers
opt in by flipping require_nonce on the kernel’s config.
Structs§
- Execution
Nonce - The signable body of an 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 tie a nonce to one specific tool invocation.
- Signed
Execution Nonce - A kernel-signed execution nonce ready for transmission on an allow verdict.
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§
- is_
supported_ execution_ nonce_ schema - mint_
execution_ nonce - Mint a fresh signed execution nonce.
- verify_
execution_ nonce - Verify a signed execution nonce against the expected binding.