AI CodeOps

Infrastructure change: risk review, with production off limits

Change Kubernetes manifests with DevOps Change: a plan, a security risk review and validation, under policy rules that keep sessions away from production.

Use this template

Infrastructure changes are short diffs with long consequences. This template gives a manifest change a plan with a rollback, a security risk review, and policy rules that keep AI sessions out of production entirely.

Which agents run

StepAgent
DevOps planDevOps Engineer
Risk reviewSecurity Auditor
ApplyDevOps Engineer
ValidateTester

The DevOps Engineer plans the rollout and rollback, the Security Auditor reviews the risk (resource limits, exposure, who can change what), and the Tester plans how to validate it after your pipeline applies it. The code pass then writes the files. Your project's test command runs against them in an offline sandbox; if the repository has no tests, the step records a skip with the reason, never a pass.

Gates that apply

  • Open high or critical findings from the review of the diff block the pull request.
  • Failing tests block, and only a result for this version of the change counts.
  • A person other than the session's starter approves. On merge from the console, the gate runs again.

Keep production out of reach

Add these policy rules under Secure → Policies → Edit rules:

[
  {
    "id": "no-production-manifests",
    "action": "diff.apply",
    "resource": "infra/production/**",
    "decision": "deny",
    "description": "Sessions may propose staging changes; production manifests change by hand"
  },
  { "id": "no-production-deploys", "action": "release.deploy", "resource": "production", "decision": "deny" }
]

The first refuses the pull request if the change touches any file under infra/production/; the session still runs and you can read what it proposed. The second stops automatic deploys to an environment named production: a denied deploy is never sent and is recorded as canceled with the reason. The strictest matching rule wins, so no other rule can loosen these. Switch to log only first if you want to see what they would block.

After the merge

With a deploy target set to staging, the merge calls your webhook. Production stays a step your team takes, which the gated staging deploy template shows from CI.

Frequently asked questions

Does the Apply step change my cluster?

No. Apply means writing the manifest change. Nothing is applied to your infrastructure; your pipeline does that after merge.

Can a deploy rule wait for an approval?

No. release.deploy rules can only allow or deny. The human approval happens earlier, on the change, before its pull request opens.