ADR-008: Walking Skeleton Policy Governance

Status: Accepted Version: 1.0 Date: 2026-01-01 Supersedes: N/A Related ADRs: ADR-006 (Ingest), ADR-007 (Memory) Related PRDs: PRD-GOVERN-001


Context

The Walking Skeleton requires policy-based governance to validate access and enforce constraints. After ingesting policies (S1A) and enabling retrieval (S1B), we need a governance layer that:

  1. Evaluates policy rules (OPA)
  2. Enforces access control (who can query what)
  3. Logs audit events (compliance)

Per P001-SKELETON, this is the third component in the golden thread: “Govern - Check ‘Am I allowed to see this?’“

Decision

Implement a minimal policy governance service for Cycle S1C with:

  1. Policy Engine: Open Policy Agent (OPA) with Rego rules
  2. Enforcement Point: Query authorization check before retrieval
  3. Audit Log: Structured logging of policy decisions
  4. Integration: Lightweight HTTP API for decision requests

Rationale

OPA as Policy Engine

Alternatives Considered

Alternative Rejected Because
Casbin Less flexible than OPA, limited policy expressiveness
Custom authorization Reinventing the wheel, harder to audit
AWS IAM / Cloud providers Non-local, vendor lock-in
Keycloak policies Over-engineered for skeleton, auth server overhead

Consequences

Positive

Negative

Implementation Notes

Success Criteria


Next Steps: