Skip to content
Mandate

Security

Security model

Mandate is designed to reject each of the following. ✅ means it's implemented and covered by tests today.

Mandates (mandate-core, mandate-crypto)

AttackDefenceStatus
Forged mandateIssuer signature must recover to issuer✅
Storage tampers with a mandateID and signature are recomputed from content✅
Privilege escalation through delegationcan_delegate attenuation rules✅
Self-issued authority (agent grants itself a root mandate)Root issuer must be a trusted owner of the resource; on the Warden that is only the owner key✅
Wrong resource or actionExact match required along the chain✅
Expired authoritySigned expires_at of every link✅
Amount above the delegated limitEffective constraints of the chain✅
Recipient not allowed (wrong branch, wrong model)Effective constraints of the chain✅
Forged record planted next to a real oneEvery candidate verified; closest real reason reported✅
Revoked authoritySigned revocation documents✅
Ancestor revokedFull-chain check on every request✅
Forged or replayed revocationMust target the exact mandate, be signed by its issuer, and use the revocation domain separator✅

The Warden (mandate-warden)

AttackDefenceStatus
Agent claims to be a different agentThe subject is the recovered signer; a mismatched x-mandate-agent is rejected✅
Captured request replayedTimestamps older or newer than 60 s are rejected; each signature is accepted once✅
Request body swapped after signingThe body hash is part of the signed digest✅
Call disguised as something harmlessUnrecognised calls get other.* / account.write actions no mandate grants✅
Write to a protected branchBranch is the recipient for content, ref and pull-request writes; allowedRecipients limits it✅
Agent switches to a different modelModel is the recipient for Ollama calls✅
Agent calls GitHub or Ollama directlyAgent Sprite's network policy only allows the Warden; connectors' access policy only allows the Warden SpritePlatform config
Agent leaks or misuses a tokenThe agent holds no tokens; the Warden holds none either, the connector attaches themPlatform design
Path that is judged as one repository but sent to another (repos/me/ok/../../them/repo)Paths with empty, . or .. segments, or encoded dots, slashes, backslashes or NULs, are refused (400 BAD_PATH); the forwarder also refuses any URL whose path the parser would rewrite✅
Stranger fills the log or dashboard with a fresh keyCalls from keys that never held a mandate are answered but not recorded; the log rotates at 20 MiB✅
Stranger plants fake mandates through POST /v1/mandatesOnly mandates whose chain leads back to the owner and is valid now are stored, up to 1,000✅
Stranger triggers restores to knock the agent offlineRestore-on-deny only fires for agents that hold a mandate✅
Upstream errors leak connector IDs or URLsThe agent and /v1/state get a summary; details stay in the Warden's log✅
Guessing the admin token by timingConstant-time comparison✅
Clickjacking the dashboard into a Revoke or RestoreX-Frame-Options: DENY, frame-ancestors 'none' and a strict CSP; other origins may only make GET requests✅
Agent tampers with its own environment after a bad actionCheckpoint before each allowed write; restore to known-good after a denied write✅ (opt-in)

Threat model

Mandate enforces authority on the path that goes through the Warden. It does not protect against:

  • a compromised owner key, admin token or Warden Sprite
  • a misconfigured network or connector policy that lets the agent bypass the Warden
  • a malicious host or platform
  • bugs in GitHub, Ollama or the connectors
  • an LLM being wrong, or every possible prompt-injection attack. Mandate limits what a misled agent can do; it doesn't stop it from being misled
  • harm done by calls that are allowed: a mandate for issues.create lets the agent open any issue on that repository
  • quantum adversaries: mandates and requests use secp256k1 ECDSA, like Ethereum itself. A large enough quantum computer could forge these signatures.

Admin routes accept a signature from the owner key (mandate-admin/1, same skew and replay rules as agent calls). Authorization: Bearer $WARDEN_ADMIN_TOKEN still works so the dashboard can grant and revoke; it is a shared secret and a leak of it is enough to change authority. GET /v1/state and POST /v1/mandates are open by design: state contains no secrets, and submitted mandates grant nothing unless their chain leads back to the owner.