Skip to content

docs(adr): 0005 policy & authorization model (per-action Rules) - #136

Merged
hellno merged 1 commit into
mainfrom
hellno/rules-engine-adr-0005
Jun 24, 2026
Merged

docs(adr): 0005 policy & authorization model (per-action Rules)#136
hellno merged 1 commit into
mainfrom
hellno/rules-engine-adr-0005

Conversation

@hellno

@hellno hellno commented Jun 24, 2026

Copy link
Copy Markdown
Owner

What

Adds ADR-0005 — Policy and authorization model, the decision record behind replacing the flat
Policy god-struct with a small, default-deny, per-action typed rule list (user-facing: "Rules"),
kept as a single pure evaluate() with native U256 caps.

Docs-only. The executable work is tracked in #135.

Why this shape (the "why for others")

  • No general policy engine enforces wei caps. A primary-source, adversarially-verified research pass
    (2026-06-23) confirmed Cedar (Long = i64), Biscuit (signed 64-bit, fail-on-overflow) and peers are
    ~58 orders of magnitude short of uint256 wei. Caps stay in native Rust U256.
  • Standards posture: adopt-the-shape (RFC 9396 RAR, ERC-7715/7710 caveat model), reference-for-
    vocabulary (NIST SP 800-162 PEP/PDP/PAP/PIP), reject-as-dependency (Cedar as design bar only;
    Biscuit unaudited). No single standard fits — the fit is a composition.
  • One vocabulary, two enforcers: #48 (software) and #33 (chain) reuse the Rules vocabulary but
    stay distinct enforcers — software is never "cannot exceed."

Process

Grounded by the deep-research pass above and two codex adversarial reviews — the second reviewed an
earlier draft of this very ADR and caught real spec bugs (dead Swap fields, a smuggled Shield
enforcement, the Allowlist serde/migration flip, an under-counted blast radius, a versioned-break
gap, and a per-action-vs-global daily-cap incoherence). All are fixed in the committed text; the
architecture survived.

Changes

  • docs/adr/0005-policy-and-authorization-model.md — new.
  • docs/agent-authorization-map.md — reconciled (PEP/PDP/PAP/PIP + a "Rules" section), date bumped.
  • docs/adr/0002-agent-wallet-and-session-keys.md — cross-refs 0005 as the vocabulary source.

Status

ADR is Proposed; it promotes to Accepted when the #135 foundation merges with evaluate /
evaluate_order parity green.

Refs #135.

Records the decision to replace the flat Policy god-struct with a small,
default-deny, per-action typed rule list (user-facing: "Rules"), kept as a
single pure evaluate() with native U256 caps. No general policy engine enforces
wei caps (Cedar/OPA/Biscuit are 64-bit-limited; verified 2026-06-23 against
primary specs). Standards posture: adopt-the-shape (RFC 9396, ERC-7715/7710),
reference-for-vocabulary (NIST SP 800-162 PEP/PDP/PAP/PIP), reject-as-dependency
(Cedar as design bar only, Biscuit unaudited). One vocabulary, two enforcers:
#48 software-enforced vs #33 chain-enforced stay distinct.

Grounded by a primary-source deep-research pass and two codex adversarial
reviews (the second caught spec bugs in an earlier draft, now fixed).

Reconciles docs/agent-authorization-map.md (PEP/PDP/PAP/PIP + Rules section) and
cross-refs ADR-0002 (session-key grants reuse this vocabulary).
@hellno
hellno merged commit 6b640a7 into main Jun 24, 2026
5 checks passed
@hellno
hellno deleted the hellno/rules-engine-adr-0005 branch June 24, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant