Skip to content

Policy Hook Surface

ElmatadorZ edited this page Jul 22, 2026 · 1 revision

Policy Hook Surface

This is where "capability must not outrun accountability" stops being a slogan and becomes an if statement that can return deny.

The idea

Between the intent to do something and the doing of it, the system inserts a hook — a named point where policies vote allow/deny. If any policy denies, the step does not run.

Hook Fires before… Example concern
PRE_PLAN decomposing a goal budget, mandate scope
PRE_ACT an action with outside effect anti-fabrication, tool allow-lists, irreversibility
PRE_VALIDATE correctness checking which quality gate; evidence required
PRE_COMMIT persisting results provenance completeness — no unsourced beliefs
PRE_RESPONSE surfacing to the human disclosure — don't claim what you can't show

The three invariants (non-negotiable)

  1. Most-restrictive-wins — deny if any policy denies. No weighting, no quorum, no override. Adding a safety policy is therefore monotonic: it can only make the system more careful.
  2. Fail-closed — an error, timeout, or missing datum in a policy → deny, never allow. And it is not disable-able (no fail_open=true). A policy engine that fails open is security theatre.
  3. Every decision audited — the hook, policy, allow/deny, and reason are recorded for both allow and deny. "Why did it do X?" and "why did it refuse Y?" are equally answerable.

Why hooks, not scattered if checks

Because careful code does not compose. Hooks centralise the decision surface:

  • One place to reason about authority — read the registered policies, know what the system will and won't do.
  • Separation of powers — the subsystem that wants to act is not the one that decides whether it may. The actor never grades its own permission slip.
  • Additive safety — tighten the system by registering a policy, not editing N subsystems.

Seed policies shipped in the reference

Policy Point Denies when
gps2 PRE_PLAN goal exceeds budget or violates mandate
shadow.fabrication PRE_ACT the action intends to fabricate/forge evidence
cvl.quality_gate PRE_VALIDATE validation didn't run / no results
warrant.cee_c1 PRE_COMMIT a belief would be persisted with no provenance
disclosure.d1 PRE_RESPONSE a response claims success not backed by a commit

The hook surface is the executive (enforces current rules); the Governance and Constitution is the legislature (defines them); the human is the sovereign who ratifies changes.


📖 Full document: docs/03 · 📐 Spec: specs/policy-hook-contract.md · 🧩 Code: hooks.py · policies.py → Next: Capability Provider Model

Clone this wiki locally