Repository avatar
AI Tools
v1.0.63
active

gama-mandate

io.github.renatoschust-dot/gama-mandate

Signed, verifiable business commitments for AI agents: one-shot redeem, offline verify.

Documentation

Mandate

DOI

tests license: MIT

Where this fits. One stack, one order. gama-mandate is the product: it signs a business commitment, executes it once and proves it offline. Everything else is a layer you add only when you need what it does:

layerinstallwhat it adds
gamai-tripwirepip install gamai-tripwireinbound detection from access logs: canaries, bursts, credential reuse; a deny needs identity evidence
gamai-guardpip install gamai-guardprompt-injection filter: lexical + multilingual embeddings, block / advise bands
sigil-profilepip install sigil-profileproof-carrying execution profile over MCP/A2A: gate, verify, anchor
proofgate-runtimepip install proofgate-runtimesmall claim-verification and signed-receipt core
gama-lpip install gama-la small language with types, effects and proofs
gamai-trustpip install gamai-trusttrust marketplace and managed policy evaluation
gamai-pluginspip install gamai-pluginsMCP plugins: policy, sandbox, team

None of these is a compliance certificate, a tamper-proof guarantee or an independent audit; each README says what it does not claim.

Signed, verifiable business commitments for AI agents.

Most agent safety tools answer "is this tool allowed?". Mandate answers the question that actually matters: "who ordered this exact payment, to this supplier, for this amount?" A tool permission is not a business mandate.

Every consequential effect becomes a canonical Commitment object. An agent signs the intent; a human co-signs a Grant with an Ed25519 key; execution produces a hash-chained Receipt. Anyone can verify the whole chain offline.

Approval workflows are ephemeral events. A Mandate is a durable, portable, cryptographically bound artifact — a commit, not a log line.

mandate demo        # propose -> grant -> redeem -> replay refused -> changed amount refused
                    # -> verify offline -> audit pack, on a throwaway directory

mandate demo runs the real path, not a mock: a generated Ed25519 key signs a real grant, redeem executes it, a replay is refused, a changed amount is refused with CommitmentMismatch, the receipt verifies, and an audit pack is written.

New here? docs/QUICKSTART.md is the 30-minute path from install to a verified record. docs/CONFORMANCE.md is how to run the kit against your verifier and publish the record behind the badge. docs/DISCLOSURE.md is how to hand an auditor a redacted record that still proves it is the same record. docs/CAPABILITIES.md is delegated authority that can only narrow. docs/HARDWARE.md says exactly what a security key proves and what it does not. docs/FIREWALL_COMPARE.md is the content gate (secrets out, instructions in) and an honest comparison with the strongest open agent firewall; docs/TLS_INTERCEPT.md is the optional TLS interception, including what a local CA costs you.

v1.0.62 — canonical commitment, Ed25519 grant, one-shot redeem, hash-chained receipt.

Status: 1131 tests collected; 0 failed. On a host with Node and bubblewrap: 1126 passed, 5 skipped (2026-12-04, 177 s); the skips are three documented coverage gaps (incidents that live outside this package), the offline-examples opt-in, and a sandbox probe that only runs where bwrap is absent. python3 -m pytest -q tests/.

Rebuilds are reproducible: docs/REPRODUCIBLE.md and tools/verify_pypi.py; the release workflow runs that check against PyPI on every tag. tools/claims.py fails CI when the version, the changelog section, the collected and passing test counts, or any figure in CLAIMS.md disagrees with the code. The benchmark numbers are not constants: each one names the script that reproduces it, because fsync and the host change the absolute value.

One thing

Mandate does one thing: a named human signs a specific business effect, the effect can happen once, and the receipt verifies offline years later. Everything else in this repository — broker, warden, egress, detection, MCP, bench — exists to serve that same hash chain. If a feature does not produce or protect a receipt, it is not the product; it is an add-on, and the docs say which is which.

Why it is not another approval gate

Approval gateMandate
Asks "may this tool run?"Asks "is this exact effect authorised?"
Identity is a self-asserted fieldApprover proves possession of an off-host key
Approval is a mutable DB rowGrant + receipt are signed, content-addressed
Logs what happenedLets anyone prove what was authorised

Install

python3 -m pip install gama-mandate     # CLI + broker + MCP adapter
mandate doctor                          # checks python, ssh-keygen, policy

From source: python3 -m pip install "git+https://github.com/gamai-io/gama-mandate.git". Python >= 3.9. The core is a local trust primitive: a library call plus a CLI, no service to run. The optional broker and approval page do start a small HTTP server (approval_page.py, broker.py use ThreadingHTTPServer) and the journal, nonce store and sandbox use embedded SQLite. No external database, no cluster, no cloud account.

Quickstart (60 seconds)

Run it in an empty directory. Nothing below needs a network, database or cluster.

mandate init --dir .                    # policy.json, allowed_signers, config, example intent

# demo only: the approver's private key belongs on the approver's machine, not next to the agent.
# In a real deployment you keep ./approver_key there and paste only the public half into allowed_signers.
ssh-keygen -q -t ed25519 -f ./approver_key -C mandate -N ""
printf 'approver namespaces="mandate" %s\n' "$(cat approver_key.pub)" >> trust/allowed_signers

mandate propose --intent examples/intent.json --out proposal.json
mandate grant  --proposal proposal.json --approver approver \
               --key ./approver_key --audience local-broker --out grant.json
mandate redeem --intent examples/intent.json --grant grant.json --ledger ledger.jsonl \
    --audience local-broker > receipt.json
mandate verify --receipt receipt.json --intent examples/intent.json --grant grant.json

Expected: {"valid": true, "decision": "executed", "executed": true, "observed": false, "signed": false}. This quickstart runs both roles on one machine so it can finish in 60 seconds. That is a demo, not the security model: the point of a grant is that the approver holds the key the agent does not — an agent that can read approver_key can approve itself, and then the record is honest but the control is gone.

valid is the cryptographic check; executed says the grant was spent and the receipt records it. It is not a bank confirmation: the broker executes and reports, and without --key on redeem the receipt is unsigned (tamper-evident only through the ledger). Repeat the redeem line and it fails with GrantReplayed — the grant is one-shot per nonce store, by construction (the shared store section below covers multiple hosts or directories).

stepwhat it proves
proposethe effect is a canonical commitment (commitment), not a free-text request
granta human signed that exact commitment with an Ed25519 key that never touches the agent host
redeemthe grant was used once; the receipt is appended to a hash-chained ledger
verifyanyone can check receipt + intent + grant offline, without trusting the broker

Post-quantum, when you want it. grant --pq-key K, redeem --pq-key K and export --pq-key K make the grant, the receipt and the bundle envelope hybrid: Ed25519 and ML-DSA-65 (FIPS 204) over the same canonical bytes. The verifier is given the public keys (export-verify --pq-keys file, audit verify --pq-keys file) and requires both; removing the PQ half is a failed verification, not a downgrade. Without a PQ key nothing changes, and existing receipts stay verifiable.

What else is in the box

Each of these produces or protects the same receipt; none of them is a second product.

piecewhat it addsdoc
brokerthe agent never holds the payment credentialdocs/BROKER.md
interopthe same decision as an OCSF event and an OTel span, so a SIEM ingests it without custom parsingmandate interop --help
wardenan external freeze you can prove (cgroup/VM), signed stops, quarantinemandate warden --help
egress + firewalldeny-by-default proxy; secrets do not leave, instructions do not enter (31+18 patterns, 75-case corpus)docs/FIREWALL_COMPARE.md
TLS interceptionoptional: scan HTTPS bodies with a local CAdocs/TLS_INTERCEPT.md
taint bridgea flagged input becomes trust=untrusted, and require_trusted refuses the effectmandate taint --help
capability tokensdelegated authority that can only narrowdocs/CAPABILITIES.md
MCP gatelock the tool list, gate effects, scan tool responses, per-window budget; mcp config writes the client file for Claude/VS Code/opencodedocs/MCP_CONFIG.md
disclosurea redacted receipt that still proves it is the same receiptdocs/DISCLOSURE.md
hardware keyswhat a security key proves, and what it does notdocs/HARDWARE.md
conformance kitrun 11 cases against your verifierdocs/CONFORMANCE.md
ERP reader (pilot)one real supplier invoice becomes the commitment a human signs, read-onlydocs/ERP_PILOT.md
proofgate interopa receipt converted into the proofgate envelope, verifiable by a verifier that knows nothing about mandatedocs/INTEROP.md
payment policyamount limit, daily total per supplier, currency whitelist, backdating and advance rules — the exceptions a text filter cannot seedocs/PAYMENT_POLICY.md
period packa signed, self-contained evidence pack for a date range, verified offline (10.000 entries: 1,8 s build / 1,6 s verify)docs/AUDIT_PACK.md
bank packprocurement answers, control matrix, pilot SOW, DORA evidencedocs/PROCUREMENT_ANSWERS.md

Everything else — examples, operations, the transparency log, the effect broker, the MCP gates, the bank control matrix, design invariants, layout — is in docs/REFERENCE.md.

What it does not do

  • It does not isolate credentials. Cryptography proves who authorised what; a compromised agent that holds the payment key can bypass Mandate entirely. That is why the broker exists, and why docs/NON_GOALS.md names the line.
  • It is not a compliance certificate. Evidence only; the obligation stays with the bank.
  • It is not tamper-proof. Tamper-evident relative to the last anchor and the witness.
  • It is not independently audited. Both verifiers are written by the same author; the conformance kit and the attack corpus are there so an outsider can check us cheaply.

Install order

pip install gama-mandate      # the product: commitments, grants, receipts, verification

The other packages are layers around it, not alternatives; the list with what each one adds is the same block in every repository in this stack, so there is one map and not seven.

License

MIT. No external database, no cluster, no cloud account: verification makes no network call. State is embedded SQLite (journal, nonce store); mandate doctor tells you what your host can do.

Agent skills that drive this

Ten MIT-licensed skills for agents with a shell, browser or desktop (deterministic GUI control, CDP, sandboxing, lab automation, and the meta-skills that keep an agent organised): renatoschust-dot/gamai-skills

They are how the agent side of this stack is operated in practice; the receipts and the mandate are what it produces.

Links