Repository navigation
Running the Demos
Python standard library only. No pip install is needed to run anything below. Tests need pytest. All demos use the mock rail: no PayPal network, no PayPal credentials.
| Command | LLM needed? | Dashboard | Flags (from argparse) | Verified at 9900817
|
|---|---|---|---|---|
python demo.py |
No | — |
--sandbox (prints guidance and exits) |
✅ exit 0, VERIFIED (15 receipts) |
python demo_sla_escrow.py --fast |
No | — | --fast |
✅ exit 0 (17 receipts) |
python trace.py |
No | — | none | ✅ exit 0, TRACE COMPLETE
|
python demo_six_beat.py --fast |
Yes: PERMIT_GROK_CLI required, or --replay
|
8471 |
--replay, --fast, --port
|
❌ without PERMIT_GROK_CLI: stops at beat 2 with setup guidance |
python demo_delegation.py --fast |
Yes: PERMIT_GROK_CLI required |
8471 |
--fast, --port
|
❌ without PERMIT_GROK_CLI: stops with setup guidance |
python demo_approval.py --fast |
Yes: PERMIT_GROK_CLI required |
8474 |
--fast, --port
|
❌ without PERMIT_GROK_CLI: stops with setup guidance |
-
Required, with no default (PR #12).
agent/react.pyreads it when a live agent turn runs. - Before the first live agent turn,
llm_preflight()checks it:- unset →
RuntimeError: agent LLM backend not configured: PERMIT_GROK_CLI is not set… - set to a path that isn't a file →
RuntimeError: agent LLM backend unavailable: '<path>' is not a file…
- unset →
- The check happens at the first agent beat, not at startup, so earlier non-agent beats (for example six-beat beat 1, the grant) have already printed. The error appears as a Python traceback with the guidance text, exit code 1.
- The runner is invoked as
python <PERMIT_GROK_CLI> chat <history> --system … --temperature 0.3 --max-tokens 400(180 s timeout).
python demo_six_beat.py --replay <transcript.jsonl> makes no LLM call and needs no PERMIT_GROK_CLI. It replays the recorded reasoning text and re-executes the recorded tool actions against the live mock tools, remapping recorded ids to fresh ones, so the receipts are real. The replay log goes to <name>.replay.jsonl, and the input file is never truncated.
-
No transcript is committed.
demo_transcript.jsonlanddemo_transcript.replay.jsonlare gitignored. You need one live run withPERMIT_GROK_CLIto record a transcript first. -
demo_delegation.pyanddemo_approval.pyhave no--replay. -
demo_six_beat.pyhas no--holdflag, and no demo has--live. Both still appear indocs/submission-checklist.md.
- Grant a $50 permit (one merchant, 1 h).
- $30 spend → hold → release with matching bytes → captured.
- $30 spend with $20 left →
BLOCKED over_remaining_cap. The PayPal authorize count is unchanged. - Delegate a $15 sub-permit. The child holds $10. Revoke the parent → cascade revokes the child, the void is confirmed, a later release is refused, and the parent is back to $50.00.
-
ledger chain: VERIFIED (15 receipts).
CI runs this on every push and PR.
Grant $50 → agent buys a $30 license (captured) → $60 attempt blocked → $15 carve, child holds $10, parent revoke cascades → $15 hold with tampered bytes refused → $25 capture applies but the response drops → UNKNOWN → reconcile → exactly one capture.
Agent-to-agent settlement with an acceptance signature (predicate A). Output prints 6 beats: grant $100 → $40 carve → accept and capture (rolls up) → forged signature refused and voided → $70 over-delegation blocked (the parent had $30 free at that point) → cascade revoke leaves $40 captured and $60 free.
Starts server.py on a free loopback port (since 17943eb; it was fixed at 8741 before) and drives it over HTTP: allowed flow, a blocked attempt that never touches PayPal, delegate + cascade, chain check. If the child server dies on startup, it exits instead of probing a foreign server. It ends with TRACE COMPLETE.
python server.py # JSON API on 127.0.0.1:8741 (mock)
python3 dashboard/server.py # empty dashboard on 127.0.0.1:8471See HTTP API Reference.
Permit · payment authority for AI agents · MIT · Wiki facts verified against commit 9900817 on 2026-10-07 (America/Edmonton). Where this wiki and the code disagree, the code wins.
Concepts
- Overview and Problem
- The Four-Clause Gate
- Spend Pipeline
- Delegation and Sub-Permits
- Principal Approvals
- Tighten-Only Narrowing
- E-Stop and Revocation
- Claim Ledger
- UNKNOWN and Reconcile
Using it
Design and status
Reference