selfdriven · ID · AuthZ & Lean

From trusted software to verified logic.

AuthZ determines whether an action is permitted. Lean can formally prove that the authorisation logic satisfies its intended security properties.

Try the authorisation model Part of KERI & AuthZ: read the overview
4

conditions in the example claim policy

2

theorems, holding for all possible inputs

9

security properties Lean could prove

4

layers of trust: cryptographic, contextual, logical, operational

AuthZ as a mathematical proposition

Every authorisation request is a proposition.

Every authorisation request can be expressed as a proposition over a subject s, an action a, a resource r and a context c. These correspond directly to the AuthZEN information model.

In Lean, propositions are types, and proofs establish that those propositions hold. This creates a natural relationship between authorisation and formal verification.

Permitted(s, a, r, c)

See it in Lean 4

At a glance

Deterministic AuthZ, formally proved.

Four layers of trust, one six-input decision function, nine formal guarantees — and how verifiable AuthZ with Lean differs from traditional AuthN/AuthZ.

The four layers of trust

Control CRYPTOGRAPHIC · KERI + ACDC Key KEL ACDC

Cryptographic layer

KERI and ACDC establish identity control and portable authority.

  • KERI
  • ACDC
  • KEL
Reason CONTEXTUAL & LOGICAL · VCG + LEAN ⊢ r Graph Rules Proof

Contextual & logical layers

The Verified Context Graph maps context, while Lean proves the authorisation logic.

  • VCG
  • Lean
  • Theorems
Enforce OPERATIONAL · AUTHZEN + SENTINEL Request Decision Receipt

Operational layer

AuthZEN standardises decisions, and entityOS Sentinel enforces them at runtime.

  • AuthZEN
  • PDP
  • Sentinel

Deterministic AuthZ & formal proofs

  • IdentityI
  • AuthorityA
  • ResourceR
  • ContextC
  • PolicyP
  • TimeT

AuthZ = f(I,A,R,C,P,T)

Six-input function

Evaluates identity, authority, resource, context, policy and time.

Nine formal guarantees

Proves properties such as default deny and revocation across all inputs.

PCA

Proof-carrying authorisation

Machine-checkable proofs demonstrate why an action was permitted.

Traditional vs verifiable AuthZ + Lean

Traditional AuthN/AuthZ

  • Root of authorityCentralised database / IdP
  • Logic verificationTrusted application code
  • Decision evaluationSimple role lookup

Verifiable AuthZ + Lean

  • Root of authorityCryptographic: KERI + ACDC
  • Logic verificationFormally proven Lean theorems
  • Decision evaluationGraph traversal & mathematical proof

Proposed architecture

From signed request to verified decision.

Together, AuthZ and Lean enable a transition from authorisation based on trusted software to authorisation based on mathematically verified logic. Each component has one responsibility.

  1. 01 · Request

    Human / Autonomous Intelligence

    Signed request to perform an action.

  2. 02 · KERI

    Verified identity

    Prove identity and key control.

  3. 03 · ACDC

    Verified authority

    Provide verifiable evidence of authority.

  4. 04 · AuthZEN

    Standardised authorisation request

    Standardise authorisation requests and responses.

  5. 05 · PDP · VCG

    Verified Context Graph

    Facts, relationships, rules and constraints. Represents contextual relationships and constraints.

  6. 06 · PDP · Lean

    Formally verified decision function

    Formally verify the authorisation logic.

  7. 07 · Decision

    Permit or deny

    The policy decision point returns one of two outcomes.

  8. 08 · entityOS Sentinel

    Enforcement and verifiable decision receipt

    Enforce the verified decision.

Example — insurance claim authorisation

Approving a claim, proved.

An autonomous system requests permission to approve an insurance claim. The applicable policy requires verified identity, valid delegated authority and an approval limit of $5,000.

Lean 4 policy

The policy as a proposition.

authorised r holds only when all four conditions hold together.

The examples are illustrative and have not been executed through the Lean compiler.

policy.lean · Lean 4Illustrative
structure Request where
  identityVerified : Bool
  authorityValid : Bool
  revoked : Bool
  amount : Nat
  limit : Nat

def authorised (r : Request) : Prop :=
  r.identityVerified = true ∧
  r.authorityValid = true ∧
  r.revoked = false ∧
  r.amount ≤ r.limit
Theorem

Approval limits cannot be exceeded.

Any request that satisfies the policy has an amount within its limit: the fourth conjunct of authorised r.

no_excess_approval∀ r
theorem no_excess_approval
    (r : Request)
    (h : authorised r) :
    r.amount ≤ r.limit := by
  exact h.2.2.2
Theorem

Revoked authority cannot be used.

Any request that satisfies the policy carries authority that has not been revoked: the third conjunct.

no_revoked_authority∀ r
theorem no_revoked_authority
    (r : Request)
    (h : authorised r) :
    r.revoked = false := by
  exact h.2.2.1

These theorems establish properties of the formal policy for all possible inputs, rather than merely testing selected scenarios.

Cedar policy

The same policy in Cedar.

Cedar denies by default, and a matching forbid overrides any permit, a property its authors prove in Lean as forbid_trumps_permit. Revocation therefore sits in its own forbid policy.

Cedar trusts the context it is given. Here that context would be filled from verified KERI and ACDC evidence.

policy.cedar · CedarIllustrative
// Approve a claim within the delegated limit
permit (
  principal,
  action == Action::"approveClaim",
  resource is Claim
)
when {
  context.identityVerified &&
  context.authorityValid &&
  resource.amount <= context.approvalLimit
};

// Revoked authority can never be used
forbid (principal, action, resource)
when { context.authorityRevoked };

Interactive authorisation model

Insurance approval policy.

Change the claim, the delegated limit or the evidence, and the decision follows. Every condition is one conjunct of authorised r.

Request

Delegated approval limit
Evidence

Decision

Permitted

All four conditions hold, so authorised r is satisfied.

AuthZEN response

{ "decision": true }

Conditions

  • Identity verifiedholds

    r.identityVerified = true

  • Authority validholds

    r.authorityValid = true

  • Authority not revokedholds

    r.revoked = false

  • Within approval limitholds

    r.amount ≤ r.limit · $3,500 ≤ $5,000

Simulation of the policy semantics, not a live Lean proof engine.

What Lean could prove about an AuthZ system

Guarantees, not test cases.

These guarantees depend on correctly modelling the properties and ensuring the deployed implementation conforms to the verified model.

Security properties

Nine formal guarantees.

Each property, once modelled, can be stated as a theorem about the decision function.

  • 01

    Default deny

    No authority means no access.

  • 02

    Least privilege

    Access remains within granted scope.

  • 03

    Delegation safety

    Delegated authority cannot exceed parent authority.

  • 04

    Revocation

    Revoked credentials cannot authorise actions.

  • 05

    Temporal validity

    Expired authority cannot be exercised.

  • 06

    Tenant isolation

    Authority cannot cross unauthorised organisational boundaries.

  • 07

    Separation of duties

    An entity cannot perform conflicting roles.

  • 08

    Determinism

    Identical inputs and policy produce identical decisions.

  • 09

    Policy consistency

    Defined classes of contradictory rules are prevented.

Precedent · Cedar

Already proved for a production engine.

Cedar's Lean proofs cover several of these properties for its authoriser and validator. Its symbolic analyses, such as policy equivalence, are proved sound and complete against its semantics.

  • default_deny

    No permit, no access

    A request that no policy explicitly permits is denied. Guarantee 01.

  • forbid_trumps_permit

    A matching forbid always wins

    An explicitly forbidden request is denied whatever else permits it. The basis for guarantee 04.

  • order_and_dup_independent

    Order does not matter

    Reordering or duplicating policies cannot change a decision. Supports guarantee 08.

  • validation_is_sound

    Validated policies evaluate cleanly

    When policies, request and entities validate against the schema, evaluation cannot fail with a type error.

Two levels of formal verification

Verify the engine, then the decision.

AuthZEN does not currently require such proofs. Level 2 would be a proposed extension or companion protocol.

Level 1

Verified authorisation engine

Use Lean during development to prove properties of the decision engine. Execute the verified decision function at runtime.

Precedent: Cedar. AWS's open-source policy language is built this way. Its evaluator, authoriser and validator are modelled and proved in Lean, and the Rust engine is checked against those models with millions of random inputs before each release. It proves the engine, not individual decisions: that is Level 2.

Level 2

Proof-carrying authorisation

Produce a machine-checkable proof for an individual authorisation decision, bound to the request, credential evidence, policy version and context.

This could allow another system to independently verify not only who authorised an action, but why that action was permitted.

The broader opportunity

Proof-carrying authorisation.

For the selfdriven and entityOS architecture, this establishes four distinct layers of trust.

Four layers of trust

Where each kind of truth comes from.

Each layer answers a different question, and none can stand in for another.

  • Cryptographic truth

    KERI + ACDC

  • Contextual truth

    Verified Context Graphs

  • Logical truth

    Lean

  • Operational enforcement

    AuthZEN + entityOS Sentinel

Lean cannot establish

Whether a real-world claim is truthful, or whether a credential issuer is trustworthy.

Lean can establish

That a decision logically follows from the accepted evidence and formal rules.

The opportunity is Proof-Carrying Authorisation (PCA): an architecture where authority is not merely asserted, but demonstrated through cryptographic evidence and formally verified reasoning.

References

Standards and tools.

The AuthZEN Authorization API 1.0 was approved as an OpenID Final Specification in January 2026.

Listen

Two audio overviews.

The ideas on this page, in audio — verified authority in place of identity, and verifiable authority for autonomous AI.

  • Podcast

    Replacing Identity with Mathematically Verified Authority

    selfdriven ID Research

    Download the audio (m4a)
  • Podcast

    Securing Autonomous AI with Verifiable Authority

    selfdriven ID Research

    Download the audio (m4a)

selfdriven Foundation · Build

Authority, demonstrated rather than asserted.