Repository navigation
Description
Mirrors s-and-p-team/cortex#116, kept open there for active implementation tracking (its own sub-issue tree #117–#134 remains in that fork).
What to build
Add negative (DENY) role→scope rules alongside the existing positive (ALLOW) ones, end-to-end across the AIAC policy stack. Today the stack is a pure allowlist: a PolicyRule(role, scope) is always a grant, and everything not granted is implicitly unreachable (default allow := false). There is no first-class way to say "this role must not reach this scope."
Policy rules become two-sided: every (role, scope) tuple carries an effect (Allow/Deny, default Allow), and both kinds are stored side by side as first-class facts. A DENY rule is a durable prohibition that subtracts from what the ALLOW rules grant, honored at every gate (inbound subject, inbound source, outbound subject, outbound target). Generated Rego applies deny-overrides: a request is allowed only if some ALLOW gate passes and no DENY gate matches. The two-layer model (SPM source-of-truth → derived APM → generated Rego) keeps its shape; each layer gains a parallel deny track.
No-conflict assumption: no (role, scope) is ever both ALLOW and DENY for the same subject, so there is no precedence/tie-break — DENY simply removes. No back-compat: the Policy Model Store state is nuked & re-seeded (models use ConfigDict(extra='ignore'), which would silently drop renamed fields on an old record). PRB stays allow-only — deny extraction is a deferred follow-up.
Design & spec references
- Design (rich, closed PRD): Feat: Two-sided policy rules (ALLOW/DENY) across model, PCE, and PDP writer s-and-p-team/cortex#115 — "Two-sided policy rules (ALLOW/DENY)" holds the full problem statement, user stories, per-layer implementation & testing decisions, and out-of-scope list. Closed because the design was folded into the component specs rather than tracked as a standalone PRD.
- Spec slice: handoff
01(docs/handoffs/) — the documentation-only slice updatingdocs/specs/. - This tracking handoff:
docs/handoffs/02-policy-model-allow-deny-new-issues.md. - Companion follow-ups handoff:
docs/handoffs/03-policy-model-allow-deny-existing-issue-updates.md— produced the keep-green / realign companions (ALLOW/DENY follow-up: realign PDP Policy Writer (OPA) unit tests s-and-p-team/cortex#126–ALLOW/DENY follow-up: keep Policy Update sub-agent unit tests green s-and-p-team/cortex#129) for the already-open issues the change touches.
Waves (dependency-ordered)
The sub-issues are grouped into waves, each tracked by its own container sub-issue. Everything inside a wave is independent and can be picked up in parallel once the previous wave lands; a wave completes before the next begins.
Wave 1 — Foundation (s-and-p-team/cortex#130) — blocks everything
- Model: RuleEffect + split rule/target fields (ALLOW/DENY) s-and-p-team/cortex#117 — Model:
RuleEffect+ split rule/target fields
Wave 2 — Direct model consumers (s-and-p-team/cortex#131) — blocked by Wave 1 (s-and-p-team/cortex#117)
- PCE: route + derive rules by effect (ALLOW/DENY) s-and-p-team/cortex#118 — PCE: route + derive rules by effect
- Policy Model Store + transport: split-field references s-and-p-team/cortex#120 — Policy Model Store + transport: split-field references
- Policy Model Store state-reset runbook (no back-compat) s-and-p-team/cortex#121 — Policy Model Store state-reset runbook (no back-compat) (HITL —
ready-for-human) - PRB: minimal keep-green against the new ALLOW/DENY model s-and-p-team/cortex#122 — PRB: minimal keep-green against the new model
- ALLOW/DENY follow-up: keep Policy Update Build+Rebuild sub-agents green s-and-p-team/cortex#127 — Keep Policy Update Build+Rebuild sub-agents green (coordinate with PRB: minimal keep-green against the new ALLOW/DENY model s-and-p-team/cortex#122)
Wave 3 — Second-order consumers (s-and-p-team/cortex#132) — blocked by Wave 2
- PDP Rego: separate allow/deny gates + identifier rename + fixtures s-and-p-team/cortex#119 — PDP Rego: separate allow/deny gates + identifier rename + fixtures (needs Model: RuleEffect + split rule/target fields (ALLOW/DENY) s-and-p-team/cortex#117, PCE: route + derive rules by effect (ALLOW/DENY) s-and-p-team/cortex#118)
- ALLOW/DENY follow-up: realign aiac.pdp.library unit tests s-and-p-team/cortex#128 — Realign
aiac.pdp.libraryunit tests (needs Model: RuleEffect + split rule/target fields (ALLOW/DENY) s-and-p-team/cortex#117, Policy Model Store + transport: split-field references s-and-p-team/cortex#120) - ALLOW/DENY follow-up: keep Policy Update sub-agent unit tests green s-and-p-team/cortex#129 — Keep Policy Update sub-agent unit tests green (needs Model: RuleEffect + split rule/target fields (ALLOW/DENY) s-and-p-team/cortex#117, ALLOW/DENY follow-up: keep Policy Update Build+Rebuild sub-agents green s-and-p-team/cortex#127)
Wave 4 — Rego consumers (s-and-p-team/cortex#133) — blocked by Wave 3 (s-and-p-team/cortex#119)
- Integration-test drivers: update to split ALLOW/DENY model + renamed Rego maps s-and-p-team/cortex#125 — Integration-test drivers: update to split model + renamed Rego maps
- ALLOW/DENY follow-up: realign PDP Policy Writer (OPA) unit tests s-and-p-team/cortex#126 — Realign PDP Policy Writer (OPA) unit tests
Deferred follow-ups (s-and-p-team/cortex#134) — unlocked after the feature lands, not scheduled in a wave
- PRD: PRB deny-extraction from natural-language policy text s-and-p-team/cortex#123 — PRB deny-extraction from natural-language policy text (needs PRB: minimal keep-green against the new ALLOW/DENY model s-and-p-team/cortex#122)
- Follow-up: ALLOW/DENY conflict + precedence resolution s-and-p-team/cortex#124 — ALLOW/DENY conflict + precedence resolution (needs the base feature)
System-wide acceptance criteria
-
.venv/bin/pytest test/ -m "not integration"is green, including new DENY cases. - Generated Rego enforces DENY alongside ALLOW (deny-overrides) at every gate.
- All Wave 1–4 Task sub-issues closed; deferred follow-ups (PRD: PRB deny-extraction from natural-language policy text s-and-p-team/cortex#123, Follow-up: ALLOW/DENY conflict + precedence resolution s-and-p-team/cortex#124) recorded.
Assisted-By: Claude (Anthropic AI) [email protected]
Parent Epic: #2405
Sub-issues
Collapse Sub-issuesSub-issues
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity