Skip to content

gate policy sees the plan: a structured plan summary in the Cedar context, and a starter policy pack #3182

Closed

Description

@lex00

Part of the boundaries epic, #3166 (infra/platform teams). Builds on the gate approval policy (#2508) and the unified change set (#3181).

Problem

Gates already support quorum, roles and a Cedar policy (docs/.../guide/ops.mdx, "Quorum, roles and an approval policy"). The Cedar request's context is planDigest plus whatever the Op passes in approval.context. So a policy can't see what the plan does unless each Op computes and passes it by hand: "deny when the plan deletes a database", "require two maintainers when more than 20 resources change", "agents may pass plans that only add tags". Platform teams expect to write those rules once, the way Sentinel or OPA policies run against a Terraform plan.

Proposal

  • Gates whose step carries a plan get a structured plan summary in the Cedar context automatically, from the unified change set (one change-set document across lifecycle, terraform/choudoufu, warden and release plans #3181): counts per action, the types and addresses deleted or replaced, regions touched, members touched.
  • A Cedar schema for that context, so typed Policy scopes can reference it.
  • A starter policy pack in the cedar lexicon: delete caps, replacement caps for stateful types, region allow-lists, required tags on creates, and a low-risk permit for agents.
  • log-only first, as today, so a team can watch a rule against real plans before enforcing it.

Done when

A gate denies an agent's approval for a plan that deletes an RDS instance, with no per-Op context code, using a policy from the pack.

Activity

  1. added
    enhancement
    area:ops
    area:cedar
    boundaries
    on Oct 1, 2026
  2. lex00 commented on Oct 6, 2026

    @lex00
    ContributorAuthor

    Ruling GATES (user, 2026-10-06, gucci6): this is built to its Done when. An open design question is decided by the building lane, with the reason in the PR; it never stops the lane.

  3. lex00 commented on Oct 6, 2026

    @lex00
    ContributorAuthor

    Done in #3576 (3e385ee): a gate with a policy whose plan names the step that made the plan gets that step's change-set summary (#3181) as context.plan with no Op context code: counts and types per action, deleted and replaced addresses, regions, scopes, members, failed members and holes, create tags and a tag-only flag. The cedar lexicon has the schema (GATE_CEDAR_SCHEMA, gateCedarSchema, validateGatePolicy) and the starter pack (protectStateful, capDeletes, capReplacements, allowRegions, requireCreateTags, permitLowRiskAgents, permitTagOnlyAgents, starterGatePolicies); log-only stays the default. The Done-when test ("#3182 Done when: a gate denies an agent's approval of a plan that deletes an RDS instance" in lexicons/cedar/src/gate-policy-pack.test.ts, real cedar-wasm and runOpLocally) passes on main, with gate-plan-context, gate-policy, gate-approval, local-executor and change-set-bundle (6 files, 107 tests). Limits named in the PR: Cedar cannot loop over sets, so per-type counts and per-type required tags are out; a count-based maintainer rule is a gate quorum.

  4. lex00 commented on Oct 6, 2026

    @lex00
    ContributorAuthor

    Released in chant 0.107.1 (npm). 0.107.0 was tagged at fae3aae but never published: its publish gate timed out waiting for CI on a commit whose tests were red. #3589, #3590 and #3591 fixed the tests, and 0.107.1 published from e4b2d42.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cedararea:opsboundariesenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions