Skip to main content

Module policy_engine

Module policy_engine 

Source
Expand description

Pluggable ingress policy engine (E3, master plan §4.6).

This is the identity-aware, async authorization surface for external engines (OPA, Cedar, org-specific services). It is deliberately distinct from macp_core::policy::PolicyEvaluator:

  • PolicyEvaluator governs commitment evaluation and must be a pure, deterministic function of bound rules + accepted history (RFC-MACP-0012 §6.3) — it replays.
  • PolicyEngine governs ingress: whether an authenticated identity may start a session, send a message, or observe a session. Rejected traffic never enters accepted history, so replay only ever sees engine-approved envelopes — an async, non-deterministic external engine here cannot diverge replay, by the same reasoning that keeps authentication outside the replay boundary (RFC-MACP-0003).

Failure semantics are deny-on-error: an engine that cannot answer is a denial, never an allow.

Traits§

PolicyEngine
Decision points an external engine may govern at ingress.

Functions§

require_allow
Convert an engine decision into a transport error, fail closed.