Layer 7 Governance Engine

Layer-7 Governance Engine | Corevexa Docs

Layer-7 Governance Engine
Decision as Infrastructure

The Layer-7 Governance Engine converts “actions” into a decision lifecycle that can be governed. It normalizes intent, applies policy gates, scores risk, routes authority, writes audit records, and produces an enforcement output.

Evaluate → Score → Authorize → Ledger → Enforce Policy pinned per decision Default deny if ungovernable
Contract: A decision is not “approved” until authority is satisfied and the ledger is confirmed. A decision is not “executable” until it is approved.

What the Engine Does

The engine is the structural boundary where intent becomes governable. It does not execute the action. It produces a decision record that downstream gateways use to allow, deny, queue, or escalate execution.

Normalize

Convert raw inputs (agent plans, tool calls, requests) into a single auditable decision schema.

Govern

Attach policy gates, compute risk, and route authority requirements before execution is possible.

Finalize

Write immutable decision records and publish an enforcement outcome for gateways and orchestrators.

Power move posture: the engine owns governability. Execution systems only read outcomes and enforce them.

Decision Object (v1)

Every action entering Layer-7 becomes a decision object. This is the minimum envelope required for audit reconstruction. Fields may be extended, but must not remove or weaken governance semantics.

{ “decision_id”: “dec_*”, “policy_version”: “v1.0”, “status”: “draft|evaluated|pending_authority|authorized|denied|executed|expired|cancelled”, “action”: { “class”: “string”, “intent”: “string”, “target”: { “type”: “string”, “id”: “string” }, “payload”: {} }, “context”: { “actor”: { “id”: “string”, “role”: “string” }, “environment”: “dev|staging|production”, “request_source”: “string”, “trace”: { “correlation_id”: “string”, “parent_id”: “string|null” } }, “policy”: { “gates”: [{ “id”: “string”, “result”: “pass|fail|requires_exception”, “reason”: “string” }], “exceptions”: [] }, “risk”: { “band”: “low|medium|high|critical”, “score”: 0.0, “reasons”: [] }, “authority”: { “required”: [{ “role”: “string”, “min_signatures”: 1, “scope”: “string” }], “received”: [{ “role”: “string”, “actor_id”: “string”, “at”: “ISO-8601”, “signature_ref”: “string” }], “satisfied”: false }, “ledger”: { “write_state”: “pending|confirmed|failed”, “record_id”: “string|null” }, “enforcement”: { “default”: “deny”, “result”: “deny|allow|queue|escalate”, “allow_if”: [“authority_satisfied”,”ledger_confirmed”,”policy_passed”] }, “timestamps”: { “created_at”: “ISO-8601”, “updated_at”: “ISO-8601” } }
Required audit minimum: action + actor + environment + policy_version + risk + authority + timestamps. Anything missing undermines reconstruction.

Required Fields (Audit Minimum)

These fields must be present for every decision. If any are missing, the engine must return deny or queue until the decision is complete.

Field Why it exists If missing
context.actor Authority and accountability are impossible without an actor identity. Deny / require identity resolution.
context.environment Risk and policy differ between dev/staging/production. Deny / treat as production (conservative).
action.class Risk thresholds and authority routing are class-driven. Deny / unknown action class.
policy_version Audit integrity requires pinned policy interpretation. Deny / invalid governance state.
risk.band Proportional controls require a risk outcome. Queue / evaluate risk first.
authority.required Encodes approvals needed before execution. Deny / no authority route.
Conservative rule: if the engine cannot evaluate, it must fail safe. Fail safe means deny/queue, not allow.

Decision State Machine

The engine treats governance as a lifecycle, not a one-time check. State transitions are logged to enable reconstruction.

draft → evaluated (policy gates attached, risk scored, authority computed) → pending_authority (awaiting required signatures) → authorized (authority satisfied; ledger confirm required for execution) → executed (execution confirmed downstream) → reviewed (optional: post-execution review complete) denied (policy fail / authority fail / invalid state) expired (timed out; requires re-evaluation) cancelled (explicit termination)

Transition rules

  • draft → evaluated: only when required fields exist
  • evaluated → pending_authority: if approvals required
  • evaluated → authorized: if no approvals required
  • authorized → executed: only after ledger confirmed + gateway executes

Terminal states

  • denied: policy failure, authority failure, unsafe request
  • expired: stale context; must re-evaluate
  • cancelled: terminated by authorized actor
Engine rule: decisions can transition forward through governance states; rewrites are prohibited. Corrections happen as new decisions with explicit linkage.

Governance Invariants (Non-Negotiable)

These invariants define Layer-7 as a structural layer rather than “best-effort governance.” Breaking them breaks the category claim.

Invariant 1

No valid authority. No execution.

Authority must be satisfied before any high-risk action runs.

Invariant 2

No ledger confirmation. No execution.

Execution must not occur if a durable audit record is not confirmed.

Invariant 3

No silent overrides.

Overrides require explicit authority and always produce a ledger record.

Invariant 4 — Policy pinned per decision

The policy version used to evaluate a decision must be stored inside that decision. Governance must not reinterpret historical decisions under new rules.

Invariant 5 — Deny by default

When the engine cannot evaluate safely, it must deny or queue. “Unknown” does not map to “allow.”

This is the enforcement posture that makes Layer-7 credible in regulated environments.

Policy Version Pinning

Policy evolves. Audit integrity requires that decisions remain interpretable under the exact policy version used at evaluation time. Layer-7 treats policy like a dependency with strict versioning.

Rules

  • Policy is immutable once published (no edits; only new versions).
  • Decisions store policy_version used for evaluation.
  • Re-evaluation creates a new decision linked to the prior decision.
  • Environment pinning allows different versions per environment.

Why it matters

  • Audit reconstruction remains valid months later.
  • Compliance reviews see deterministic governance behavior.
  • Incident response can replay the decision under historical rules.
  • Prevents “policy drift” from rewriting accountability.
Implementation note: policy bundles can be stored in an immutable artifact store (hash-addressed) and referenced by version + digest.