ADR-INFRA-004 — Environment Boundary and AI Assistant Scoping

By Engineering & Security Architecture Team•October 20, 2026•3 min read

Status: Accepted Date: 2026-12-05 Authors: Engineering & Security Architecture Team

Context

AI coding assistants speed up infrastructure work but are non-deterministic, open to prompt injection and can leak context. BRD-INFRA-004 wants that speed in non-production and none of the risk in production. Specified in SR-INFRA-004. The account model, one Cloudflare account with a separate zone per environment, is decided in ADR-INFRA-010; this record decides how the environments are kept apart inside it and who may change production.

Decision Drivers (FRs & NFRs)

  • BR-1.1, BR-1.4 — no shared authority between environments.
  • BR-1.2 — assistants never touch production.
  • BR-1.3 — fast non-production, a recorded human decision for production.

Decision — How are environments separated, and who may change production?

Option 1 — Shared credentials, separated by names or prefixes

Pros:

  • One set of credentials and one state to manage.

Cons:

  • Large blast radius: one misconfigured or compromised role, or one wrong assistant suggestion, can reach production resources (BR-1.1, BR-1.4).
  • Blurred secret boundaries: production values can be referenced by mistake from non-production scripts or assistant prompts (BR-1.4).

Option 2 — Ban AI assistants everywhere

Pros:

  • Removes assistant risk entirely: no prompt injection, no flawed generated code, and no code sent to an outside model provider.

Cons:

  • Gives up the speed benefit in prototyping, boilerplate and lint troubleshooting (BR-1.3).
  • Encourages unofficial use of browser-based assistants, which is harder to see and copies more context out of the controlled environment.

Option 3 — A production workspace without an assistant, run by a person

Production is applied by an administrator from a dedicated production dev container that has no assistant, with hardware approval for each run.

Pros:

  • A person reads every production plan before it runs (BR-1.3).

Cons:

  • A production credential sits with a person and a workstation, so the production boundary depends on one container being built without an assistant (BR-1.2).
  • Production releases depend on an available administrator and leave no workflow record tying the change to a commit.
  • A second kind of container to build, harden and keep in step.

Option 4 — Separate per-environment boundaries; assistants only in dev containers; production changed only by the pipeline (CHOSEN)

Each environment has its own zone, state key, passphrase, vault and credentials. Assistants run only in dev containers, where tofu-guard refuses any production run, and no person or workstation holds a production credential. Production is changed only by GitHub Actions workflows started by hand on main, each reading its environment’s vault through a read-only service account; a change reaches main only through a pull request whose plan is read before merge.

Pros:

  • A non-production credential is limited to the test zone and the non-production vault, so a compromise of non-production gives no path to production (BR-1.1, BR-1.4).
  • No workstation, person or assistant holds a credential that can change production, so BR-1.2 holds by construction (BR-1.2, BR-1.4).
  • Every production change is tied to a pull request, a commit, a workflow run and the account that started it (BR-1.3).
  • What runs in production is what ran in non-production: the same workflow releases the same commit to non-production first.
  • No production container to build, harden and keep in step with the others.

Cons:

  • A production incident when the pipeline itself cannot run needs a dashboard change by an administrator, recorded and then brought back into code (break-glass).
  • The security of the GitHub account and repository settings, and of each environment’s service-account value, is part of the production boundary.
  • Quotas and account-level settings are shared by both environments (ADR-INFRA-010).

Final Decision

Option 4: each environment has its own zone, state, passphrase, vault and credentials; AI assistants run only in dev containers that cannot apply production; production is changed only by GitHub Actions workflows started from main, reading their vault through a read-only service account. Option 1 is rejected for blast radius and weak isolation, Option 2 for lost speed and the risk of unofficial assistant use, and Option 3 for a production credential held by a person and a workstation. The cost accepted is break-glass by dashboard when the pipeline cannot run, and a production boundary that includes the GitHub account and the service-account value.