Case study / TerraGate
Terraform reviews, grounded in evidence.
An evidence-first Terraform review workspace. Inspect plan changes, understand deterministic findings, and record scoped human decisions against the exact review snapshot—without giving the public demo permission to deploy infrastructure.
- Role
- Independent builder
- System
- TerraGate
Demo boundary
Live constrained demo
Deterministic Python checks / external writes mocked
Live constrained demo on Cloudflare Workers, AWS API Gateway/Lambda, and Neon PostgreSQL. Deterministic Python checks assess bounded uploaded or sample plans. Public authentication uses shared dev identities; GitHub writes are mocked and Terraform execution is disabled. Risk exceptions and comment approvals do not authorize merge or deployment.
01 / Product
What a Terraform reviewer needs to know
- A dense Terraform diff can hide exposed services, excessive permissions, destructive changes, or uncertain inputs. A score alone does not explain which resource changed or why it matters.
- Teams need findings tied to saved evidence, a record of who accepted which risk, and a visible distinction between reviewing a change and authorizing it to ship.
- TerraGate brings the plan, findings, provenance, scoped exceptions, comment approval, and audit history into one review workspace.
What a review must not authorize
- Deterministic Python checks establish findings. Unknown or redacted inputs require verification rather than an invented pass or failure.
- Raw risk, policy decisions, comment approval, and external GitHub checks remain separate; none is a verified merge-enforcement signal.
- The public environment uses shared dev identities and mocked GitHub writes. Terraform execution and infrastructure-changing credentials stay outside the demo.
02 / Workflow
From a plan diff to an accountable review.
01
Intake
Upload a bounded Terraform plan JSON or choose a sample. The review queue makes incomplete and failed work visible.
02
Assess
Deterministic rules evaluate normalized inputs and save findings, evaluated policy inputs, and source hashes.
03
Inspect
Trace each finding to redacted before/after values, unknown inputs, and the integrity-checked saved plan.
04
Decide
Request an expiring exception for one finding in one snapshot; a different administrator records the decision.
05
Approve
Approve the exact saved comment separately. Changed review content invalidates stale approval rather than inheriting it.
06
Hand off
Export review evidence or remediation snippets. Public GitHub posting stays mocked; merge and apply are not authorized.
03 / System
The deployed architecture, with every boundary visible.

From Terraform plans to evidence-linked decisions. The deployed path is Cloudflare Workers → API Gateway → Lambda outside a VPC → Neon. Plan files remain ephemeral; GitHub writes are mocked and Terraform execution is disabled. The RDS/private-VPC alternative is not shown as live infrastructure.
- Entry
- A bounded review workspaceCloudflare Workers serves the UI. The public demo uses shared dev identities.
- Processing
- Deterministic checksAPI Gateway → Python Lambda. Encoded Python rules produce the findings.
- Data ownership
- Evidence-linked decisionsNeon retains findings and audit history. Lambda /tmp plan files remain ephemeral.
- Recovery
- No deployment authorityExpired plan evidence is explicit. GitHub writes are mocked; Terraform execution is disabled.
04 / Product in use
The evidence stays beside the decision.

An actionable review queue
Local controlled capture / October 10. Search, filters, status, and scoped review context organize the next decision; repository context is not a verified GitHub installation.
Full-resolution source
A finding with inspectable evidence
Local controlled capture / October 10. A sample security finding keeps its rule, resource, evidence excerpt, and blocked policy state visible. Displayed confidence is not a measured accuracy result.
Full-resolution source05 / Decisions
Three decisions and the cost of each.
01
Keep the evidence and its provenance with the finding
Saved redacted values, unknown masks, artifact digests, and rule-source hashes let a reviewer inspect what was evaluated rather than trust a score in isolation.
Tradeoff
Encoded checks cover only their defined scope. Free-form secrets can evade redaction, and the live Lambda's plan files remain ephemeral rather than durable evidence storage.
02
Bind human decisions to the exact review snapshot
Finding-specific exceptions require justification, expiry, and a different administrator. Comment approval applies to its saved snapshot; changed content cannot reuse an old decision.
Tradeoff
More explicit decisions add review steps. Risk acceptance does not lower raw risk, synchronize a GitHub check, or authorize merge and apply.
03
Separate useful review from deployment authority
The public workflow can assess plans, retain audit history, and demonstrate approval without holding live repository write credentials or executing Terraform.
Tradeoff
Shared dev identities and mocked writes are a demonstration boundary. Private identity, durable workers, and trusted GitHub installation ownership need separate qualification.
06 / Evidence
What the record supports—and how far it goes.
Hosted
October 10 review journey
Fixture-based hosted checks covered plan upload, redacted evidence, a scoped exception, separate comment approval, and mocked posting—not live GitHub writes.
Inspect evidenceOne snapshot
Scoped, expiring risk acceptance
An exception belongs to one finding and immutable snapshot. Expiry, revocation, or changed content removes acceptance; it is not deployment approval.
Inspect evidence13 tables
Isolated recovery rehearsal
A hosted-database backup was restored into local PostgreSQL; upgrade, downgrade, and re-upgrade preserved row digests in the 13 existing tables. Not a production restore or concurrent migration test.
Inspect evidence
07 / Reliability & security
A decision never outlives the evidence it applies to.
Integrity-checked redacted artifacts and saved policy inputs support deterministic findings. Exceptions are scoped, expiring, independently decided, and audited. Risk, policy state, comment approval, and GitHub checks remain separate; the public environment has no merge or apply authority.
Threat modelA successful build was not enough to prove a working deployment.
The October 10 frontend initially returned HTTP 500 despite building successfully. It was rolled back, a compatible bundle was deployed, and CI gained a Worker-runtime smoke check. An isolated backup/migration rehearsal preserved existing table digests. Neither result removes the live /tmp artifact-expiry limitation or establishes sustained availability.
Exact release, runtime recovery, and backup rehearsalRelease status / deployed and unmerged work
Verify the repair path before trusting the agent.
Engineering experiment / unmerged draft PR #8. Separate from TerraGate's deployed review product. Recorded synthetic harness tests establish pipeline behavior, not real coding-agent performance.
- Four versioned fault-injection cases exercise a green control, failing regression, bounded repair, and focused plus cross-module verification in disposable Git worktrees.
- The recorded CI uses deterministic fixture repairs and makes no AI calls. It validates harness safety/reporting and the four-case red/green pipeline—not a measured Codex repair rate, cost improvement, or model comparison.
- File-change limits, environment hygiene, timeouts and provenance make each attempt inspectable. A Git worktree is not hardened OS isolation; real agent benchmarks and external-action prevention remain unverified.
08 / Limits
Known limits
- The public demo uses shared dev identities, deterministic Python checks, mocked GitHub writes, and disabled Terraform execution. Private Cognito and live GitHub integrations were not verified in the hosted release.
- Findings and audit history persist in Neon, but raw/redacted plans in Lambda /tmp can expire with HTTP 410. Successful retrieval in one run does not establish durable artifact storage.
- The GitHub installation-to-CI-plan lifecycle and merge enforcement remain incomplete. Remediation snippets are export-only; policy decisions do not authorize deployment.
- Cost estimates are heuristic, not measured bills. Compliance mappings are review context, not certification; no sustained workload or service SLO is established.
- The RDS/VPC Terraform stack is a reference alternative. Reconcile it with the live Neon/outside-VPC configuration before any future apply.
Path to sustained operation
- Move plan artifacts to private durable object storage with retention, deletion, encryption, and integrity checks; qualify expired and missing evidence recovery.
- Qualify private identity and organization membership, trusted GitHub installation ownership, revision reconciliation, and delivery deduplication before enabling live writes.
- Use durable review workers with lease/retry recovery, alarms, bounded workloads, and separately tested migration concurrency.
- Introduce organization-owned approved policy revisions and evaluate rule coverage against representative plans; retain the input snapshot and rule provenance with each decision.
09 / Artifact index
Follow the work into the repository.
- architectureVerified Cloudflare / AWS / Neon deployment
- iacRDS/VPC Terraform reference—not the live inventory
- ciRepository CI workflow
- testsWorkspace, integrity, and migration validation
- runbookOperator runbook
- securityThreat model
- limitationsPublic-demo boundary
- productEvidence workspace and scoped decision contract
- runtimeExact release, runtime recovery, and backup rehearsal
- testsDraft repair harness / synthetic tests—not real agent performance