Lean 4 models describe authorization, gated approval flow, and identity binding. Their proofs establish properties of the modeled definitions under stated assumptions; they do not establish that every deployed code path is correct.
Source toolchain: Lean 4 v4.32.2
What do the MultiMail proofs establish?
MultiMail uses Lean 4 to prove properties of explicit security models: tenant ownership and scope guards, a gated approval state machine, and signed identity claims. Proofs apply to those definitions and assumptions. Production correctness also depends on implementation, configuration, storage, and external services. An operator-approved allowlist can bypass ordinary gated-send approval; the strict gated model does not cover that path.
The modeled properties are checked using Lean 4, the same formal verification language used in pure mathematics research. The Lean type checker mechanically validates each proof step. Successful compilation checks the theorem for the model; matching the model to runtime call sites requires separate review and tests.
Proof 1 — Authorization Model
Tenant ownership in the authorization model
The authorization model proves these properties for its explicit endpoint enumeration and guard definitions:
Tenant isolation
Every resource-accessing endpoint verifies tenant ownership.
For resource IDs represented in the model, the ownership predicate requires the caller’s tenant to match. Runtime endpoint coverage must be checked separately against handlers and their guard call sites.
Scope enforcement
Every authenticated endpoint has a scope guard.
The modeled authenticated endpoints have an assigned scope: read, send, admin, or oversight. A proof about this enumeration does not automatically detect a newly added runtime route.
Read cannot mutate
A read-scoped key cannot trigger any outbound action.
In the model, endpoints classified as mutations require a scope other than read. This statement depends on the endpoint classification and the runtime guard mapping remaining accurate.
Admin is the only escalation
No scope implies any other scope — except admin, which satisfies all.
Read does not imply send. Send does not imply admin. Oversight is independent. The admin scope is the only cross-scope escalation path, and it's named explicitly — not a hidden behavior.
Assumption: The endpoint-to-scope mapping is the specification — we assume it correctly reflects intended access policy.
Mitigation: The scope map is mechanically extracted from the TypeScript source (not hand-maintained). Repository checks compare scope-map extraction with the recorded baseline. Their results must be tied to a source revision and deployment receipt before making a freshness claim.
Proof 2 — Approval Flow
No email reaches delivery without operator approval
The strict gated state machine has no path to Delivered without PendingSendApproval. It models that approval path, not every runtime delivery mode or operator-approved allowlist exception.
Email submitted───> scanning ───>Operator Approval───>Delivered
In gated oversight modes (gated_send and gated_all),
every path to delivery passes through Operator Approval.
The proof covers the states and transitions defined in this model.
Approval flow completeness
In gated modes, every path to delivery passes through operator approval.
When a mailbox is set to gated_send or gated_all, we exhaustively checked every possible sequence of state transitions. Within the modeled transitions, delivery requires entering the approval state. Runtime allowlist bypasses and automatic sending modes are outside this strict gated model.
Approval is the sole gate
In gated modes, remove the approval step and delivery becomes impossible.
Approval isn't one path to delivery — it's the only path. In gated oversight modes, if you take away the operator's ability to approve, no email can ever reach a recipient. The approval step isn't a checkpoint on a highway — it's the only bridge across the river.
Axiom boundary: No cryptographic axioms are used in this structural proof. Its boundary is the defined transition relation; correspondence to runtime behavior remains a separate obligation.
Proof 3 — Identity Headers
Every identity claim is cryptographically bound
Every outbound email carries a signed identity header (ECDSA P-256) containing the operator name, oversight mode, capabilities, and verification status. We proved that the signature construction correctly binds all fields — tampering with any field breaks the signature.
Signature binding
A valid signature uniquely determines the identity claim.
If a signature verifies successfully, the identity claim it contains is exactly what was originally signed. You cannot reuse a signature for a different identity. All 8 fields — operator, oversight mode, capabilities, verified status, creation date, service, timestamp, and reputation hash — are bound.
Tamper evidence
Changing any field produces a different payload that breaks the signature.
Proved individually for each critical field: an agent cannot impersonate a different operator, claim a different oversight mode, add capabilities it wasn't granted, or forge a verified status. Each field change is detectable.
Key binding
Signatures only verify against the operator's registered public key.
Substituting a different public key fails verification. Even if an attacker served a different key, legitimate signatures would not verify against it. The signature is cryptographically bound to a specific key pair.
Axiom boundary: We assume ECDSA P-256 is a sound signature scheme (standard cryptographic assumption, validated by NIST, used in TLS worldwide). What we prove is that our usage of ECDSA correctly binds all identity fields to the signature. The model also assumes injective serialization. The serializer and runtime cryptographic implementation require their own validation.
What these proofs cover
These sections describe selected authorization, approval-flow, and identity models in the source repository. They do not certify every API endpoint, deployment, onboarding flow, or external dependency. Endpoint and theorem totals depend on the selected source revision and counting method, so this page does not publish a blanket coverage count.
Review the model definitions, assumptions, runtime guard mapping, and test evidence together. A passing proof build alone does not establish deployment equivalence or freshness.
Proof source is available on request.
Historical proof checksums
These previously published SHA-256 values are retained as historical references. They have not been revalidated against current compiled artifacts in this content review and do not attest the current deployment. Request the corresponding source revision and build receipt before using them for verification.