Skip to content

feature: Policy Model ALLOW/DENY (positive + negative) rules #2406

Closed
6 of 6 issues completed
rossoctl/cortex
#808

Description

@omerboehm

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

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

Wave 2 — Direct model consumers (s-and-p-team/cortex#131) — blocked by Wave 1 (s-and-p-team/cortex#117)

Wave 3 — Second-order consumers (s-and-p-team/cortex#132) — blocked by Wave 2

Wave 4 — Rego consumers (s-and-p-team/cortex#133) — blocked by Wave 3 (s-and-p-team/cortex#119)

Deferred follow-ups (s-and-p-team/cortex#134) — unlocked after the feature lands, not scheduled in a wave

System-wide acceptance criteria

Assisted-By: Claude (Anthropic AI) [email protected]

Parent Epic: #2405

Sub-issues

Sub-issues

6 of 6 Issues completed
Loading 6 sub-issues

Activity

  1. added
    enhancement
    on Aug 20, 2026
  2. added this to the Release v0.8.0 milestone on Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions