What a proof adds
A test checks the cases someone thought of. A proof covers every case, including the ones nobody thought of. Lean is a program that refuses to accept a proof with a gap in it, so “proved” here means a machine checked every step.
A proof is only as good as its model. Each model below was written from the code, and each set has tests that run the real code against the model with generated cases and seeded concurrent sequences. Those tests are strong evidence, not a proof; the reports say exactly where the line is.
Self-hosted and Cloud
Spend limits
Can an agent spend past its budget? Before a call goes out, PassControl reserves its estimated cost against the agent's caps, then settles the real cost when the call returns. The proofs cover every possible order of reservations, settlements, retries and expiries.
- The reserved total always equals the open reservations. Nothing is lost or counted twice.
conservation - A call is let in only if it fits under every cap that is set.
cap_admission - The only way past a cap is a provider charging more than its estimate, and that overshoot is accounted for exactly.
cap_bound_tokens, cap_bound_cost, settle_exact - Repeating a step, such as a retried settlement, changes nothing.
idempotent - Recorded spend never goes down.
spent_monotone - A reservation cannot disappear on its own; only its own settlement or release closes it.
no_silent_release
The limit, stated plainly: A provider can charge more than it estimated, so a cap can be passed by that difference. The proof bounds the overshoot rather than pretending it cannot happen. Daily/monthly period limits, sub-agent and delegation ledgers, and manual budget rebuilds (which can lower recorded spend) are outside this model.
Self-hosted and Cloud
Stop checks
Can a stopped agent still get a call through? Every call passes six checks in a fixed order: kill switch, suspension, scope, endpoint, policy and budget. The proofs cover every possible combination of inputs to that gate.
- A call goes through only when all six checks clear; model listings skip scope and are governed by the endpoint check.
admits_iff_all_clear - One failing check is enough to refuse, and so is one check whose input has not been read yet.
any_fail_refuses, any_wait_refuses - The platform kill switch, your workspace kill switch and the denylist each refuse on their own, whatever else is true.
platform_kill_denies, tenant_kill_denies, denylist_denies - A stop reloaded from the durable record can add a stop, and can never remove one.
recorded_stop_never_weakens - If the kill switch cannot be read, the default lets the call through and the fail-closed setting refuses every call. Both are proved as they are, so changing either breaks a theorem.
kill_read_failure_open_admits, kill_read_failure_closed_denies - PassControl Cloud enables the fail-closed setting, under which an unreadable kill switch refuses.
kill_read_failure_closed_denies
The limit, stated plainly: The self-hosted default fails open on an unreadable kill switch, deliberately, with suspension in Redis as the backstop. That choice is proved, not hidden. Direct Agent Key and delegation authority checks can reuse a read up to 2 seconds old at the start of the final check; this is not a bound on time to dispatch.
Cloud (the proofs are public; the code they model runs on Cloud)
Mandates and seals
Can an agent act outside what its owner approved? A website asks PassControl whether an act is inside the mandate the owner approved. Afterwards, a seal lets the owner and PassControl check the whole job. The proofs cover the decision, the counting and the seal.
- An inside answer means every earlier check passed: the request's proof, the signed intent, not revoked, not expired, started, the mission enforces, not stopped, the passport current and the public text unchanged.
inside_every_earlier_condition - A stopped, revoked, expired or trial mandate never answers inside.
stopped_never_inside, revoked_never_inside, expired_never_inside, trial_never_inside - No act is ever counted twice, over any sequence of events.
Counter.Protocol.run_unique - Counted acts never go over the mandate's limits.
Counter.Protocol.run_liabilities_bounded - A replayed request is refused and not counted.
Counter.replay_refused_after_history - A seal checks out only if the owner approved the mission under their trusted key, every later change narrowed it or was signed by the owner, and the counted acts stayed within the final limits.
Seal.ok_root_trusted, Seal.ok_later_narrower_or_signed, Seal.ok_final_caps - Writing the proofs found two real bugs in the seal check. Both are fixed and now proved refused: an empty chain, and a receipt with an unknown decision.
Seal.empty_chain_refused, Seal.unknown_decision_refused
The limit, stated plainly: The seal accepts a receipt it cannot classify (a call with no listed provider or model) that says inside, and it does not check a refusal's stated reason against its clause. Both are kept on purpose and stated here.
What is assumed, and what is not covered
- Cryptography is assumed, not proved: the signature and hash functions are taken to work as specified.
- Each Redis script is assumed to run as one step, which is how Redis runs scripts.
- The proofs describe models of the code. The code is tied to them by tests, and a test is not a proof.
- PassControl is not independently audited yet. The proofs and the security review are our own.
Check them yourself
You need Lean 4 (install it with elan; each folder pins its own version). Then:
git clone https://github.com/Vertias3u/PassControl
cd PassControl/proofs/mandate && lake build
cd ../budget && lake build
cd ../stops && lake buildEach build ends with an axiom audit of its main theorems. Only Lean's standard axioms appear, and no proof is left unfinished.