AWS Builder Center
AI Generates Your Infrastructure. Who Validates It Stays Resilient?

AI Generates Your Infrastructure. Who Validates It Stays Resilient?

Your CI/CD pipeline checks for security vulnerabilities on every PR. But who checks for resiliency? This series builds an AI agent that does — shifting reliability left into the developer workflow.

Part 0 of 3 in the "Shift-Left Resiliency" series — start here.
TL;DR: AI coding assistants and spec-driven development (Kiro, Cursor, Copilot) can generate resilient infrastructure on Day 1. But resiliency isn't a Day 1 property — it's a continuous guarantee. Generators (AI coding tools that create your infrastructure code) and Reviewers (automated agents that validate that code for resiliency gaps) are complementary: one creates, the other enforces. This article establishes why automated resiliency review becomes more important, not less, in the age of AI-generated IaC — and introduces the solution I built.


Tags:  #AI/ML   #Resilience   #DevOps   #Well-Architected   #ThoughtLeadership   #InfrastructureAsCode 



Two Roles, One Goal

Before we dive in, let's define the two actors clearly:

Generator
Reviewer
What it is
AI coding tools (Kiro, Cursor, Copilot) that write your infrastructure code from specs or prompts
An automated agent that analyzes infrastructure code for resiliency gaps at PR time
When it runs
At creation time — when you first build or modify infrastructure
At merge time — on every Pull Request, regardless of who or what wrote the code
What it answers
"What should I build?"
"What breaks when something fails?"



The Premise: AI Gets It Right From Day 1

Modern AI development tools are remarkable at generating infrastructure. Consider a spec-driven workflow:
Developer spec (natural language):
Deploy a production PostgreSQL database with high availability,
automated backups, and multi-AZ failover.

AI-generated Terraform:
resource "aws_db_instance" "production" {
engine = "postgres"
instance_class = "db.r5.large"
multi_az = true # ✅ HA from day one
backup_retention_period = 7 # ✅ Automated backups
storage_encrypted = true # ✅ Encryption
deletion_protection = true # ✅ Safeguard
}

AI-generated CloudFormation:
Resources:
ProductionDB:
Type: AWS::RDS::DBInstance
Properties:
Engine: postgres
DBInstanceClass: db.r5.large
MultiAZ: true # ✅ HA from day one
BackupRetentionPeriod: 7 # ✅ Automated backups
StorageEncrypted: true # ✅ Encryption
DeletionProtection: true # ✅ Safeguard

Perfect. The AI knows best practices. If every piece of infrastructure is generated from complete, explicit specs using a model trained on Well-Architected patterns, why would we need a resiliency reviewer?
This is a fair question.
The Gap: Your CI/CD Pipeline Today

Let me steelman it, then break it down.



The Strongest Version of This Argument

"If I use spec-driven development (like Kiro) where the spec explicitly states 'high availability,' and the AI generates infrastructure using Well-Architected patterns as its training basis, then the output IS the review. The generation and validation happen in one step."
For greenfield, single-service, single-team deployments on Day 1 — this is largely correct. A well-prompted AI generator will produce resilient infrastructure.
Here's why it's still not enough:



Five Reasons Resiliency Review Survives AI Coding

1. Generators Optimize for What You Ask — Not What You Forget

Specs are only as good as their completeness. In practice:
# What the developer specified:
"Deploy a web app with EKS, RDS, and a load balancer — all highly available"

# What the spec DID NOT mention:
- NAT gateway redundancy per AZ
- Whether the EKS→RDS cross-service dependency survives AZ loss
- Static stability (can the system function during scaling?)
- Route table redundancy
- Whether the ALB health check timeout matches the DB failover time

Each resource may be individually resilient. But the system's resilience depends on how they compose. No spec (human or AI-generated) systematically enumerates every cross-service failure mode.
A resiliency reviewer asks: "Given ALL these resources together, what happens when us-west-2a fails?"
Generators answer: "What should I build?" Reviewers answer: "What breaks when something fails?"
These are different questions.



2. Don't Let Claude Grade Its Own Homework

This principle is well-documented in AI reliability engineering: if the same model (or same architecture) generates AND validates code, blind spots are correlated.
The AI that generated  multi_az = true  for RDS might also generate a single NAT gateway — because its prompt focused on the database, not the network layer. It's confidently correct about what it was asked, and confidently silent about what it wasn't.
A separate review agent with different context (Well-Architected rules, domain skills, cross-service dependency analysis) catches what the generator's attention didn't cover. This is the same principle behind:
  • Code reviews (author ≠ reviewer)
  • Security audits (builder ≠ auditor)
  • Aviation checklists (pilot ≠ co-pilot verification)
Independence of verification is a safety principle, not a redundancy.



3. Day 1 ≠ Day 120

This is the most important point.
Day 1: AI generates perfect resilient infrastructure from spec ✅
Day 47: Developer manually sets multi_az = false for "cost savings
in staging" — then copy-pastes the block to production ❌
Day 78: New microservice added, creates cross-AZ dependency
nobody analyzed ❌
Day 120: Org resiliency standard changes from 99.9% to 99.99% —
existing infra doesn't meet new bar ❌

Specs describe intent at creation time. Reviewers validate reality at merge time.
AI-generated code isn't immune to:
  • Manual modifications by developers
  • Drift between spec and implementation over time
  • New cross-service dependencies introduced later
  • Organizational policy changes
The reviewer is the continuous enforcement mechanism — it doesn't matter HOW the code was created; it validates what's being merged NOW.



4. Multi-Team, Multi-Repo Composition

Real production systems aren't generated from a single spec by a single team:
Team A: Generated EKS infrastructure (3 AZs) ← Their spec said "HA"
Team B: Generated RDS database (Multi-AZ = true) ← Their spec said "HA"
Team C: Generated networking (1 NAT gateway) ← Their spec said "cost-efficient"

Result: Individually resilient components that form
a NON-RESILIENT system when composed.
If the NAT gateway's AZ fails → EKS pods in
other AZs can't reach the internet → health
checks fail → cascading failure

No single AI generator sees the full picture because each team generates independently. A cross-cutting resiliency reviewer analyzes the composed system — across repos, teams, and specs.



5. The Review IS the Spec Enforcement

Actually, generators and reviewers work together to create a durable system:
┌─────────────────────────────────────────────────────────────────┐
│ │
│ Spec: "All production databases must be Multi-AZ" │
│ │ │
│ ▼ │
│ AI Generator: produces multi_az = true on Day 1 ✅ │
│ │ │
│ ▼ │
│ ... 6 months of edits, refactors, new developers ... │
│ │ │
│ ▼ │
│ Someone changes multi_az = false in a PR │
│ │ │
│ ▼ │
│ Resiliency PR Agent: │
│ "This PR violates your org's resiliency standard. │
│ multi_az was true — this change introduces a SPOF. │
│ Blocking merge until resolved." ← GUARDRAIL │
│ │
└─────────────────────────────────────────────────────────────────┘

The spec says WHAT you want. The generator CREATES it. The reviewer ENFORCES it — continuously, on every PR, regardless of who or what authored the change.
Without the reviewer, specs are aspirational documents that rot.



The Evolution: How the Agent's Role Shifts

Era
Primary value of the agent
Manual IaC (today)
Catches human mistakes in hand-written code
AI-assisted IaC (now)
Validates AI output + catches spec gaps + flags regressions
Spec-driven IaC (emerging)
Enforces cross-team consistency + detects composition failures
Fully autonomous (future)
Acts as a policy gate — organizational resiliency standards enforced at merge time, like security scanning
The agent doesn't disappear — it evolves from "catching mistakes" to "enforcing policy." Just as tfsec and Checkov didn't disappear when Copilot started generating Terraform — the need for independent validation is fundamental.



The Analogy: Spell Check Didn't Kill Editors

When spell-check arrived, nobody said "we don't need editors anymore." Spell-check catches typos (individual word errors). Editors catch structural issues (does the argument hold? is the narrative coherent? are there logical gaps?).
Similarly:
  • AI generators = spell check for infrastructure (individual resources are correct)
  • Resiliency reviewers = editors for architecture (system composition is resilient)
The AI can generate a perfect database config. The reviewer asks: "But does this database's failover time exceed your ALB health check timeout, causing a cascading restart of all EKS pods?"
That's a system-level question no generator is designed to answer.



What Changes in an AI-Generated World

The resiliency agent's focus DOES shift:
Old focus (human-written code)
New focus (AI-generated code)
"You forgot multi_az = true"
"The generator got each resource right, but the composition has a cross-AZ dependency"
Individual resource misconfigs
System-level failure mode analysis
"Here's how to fix it"
"Here's what breaks under AZ failure given all your components"
Teaching developers best practices
Enforcing organizational policy across AI-generated and human-modified code
The agent becomes less about "you made a mistake" and more about "your system has a failure mode that no single component reveals."



The Uncomfortable Truth

Here's what makes this argument durable:
Resiliency is an emergent property of systems, not a property of individual components.
You can generate every individual component perfectly and still have a non-resilient system. That's because resilience lives in:
  • The relationships between components
  • The failure modes at boundaries
  • The composition of independently-generated pieces
  • The evolution of initially-correct systems over time
No generator, no matter how sophisticated, is positioned to validate all of these continuously. That's what a dedicated reviewer does.



Conclusion: Complementary, Not Competing

AI generators get you to 90% correct on Day 1. Resiliency reviewers ensure you STAY correct on Day 47, Day 120, and across every team's contributions.
The question isn't "generator OR reviewer." It's:
  • Generator → Creates resilient infrastructure from specs (creation time)
  • Reviewer → Enforces resiliency across composition, evolution, and change (merge time)
  • Together → Continuous resiliency guarantee from Day 1 to Day 1,000
If you're building with AI coding tools today, congratulations — your Day 1 infrastructure is probably better than ever. The question is: who's watching Day 2?
In the  next article , I'll show you exactly how this "watcher" is built — a ~500-line Python agent with static rules, dynamic AI skills, and SARIF output for inline PR annotations.



Series: Shift-Left Resiliency

Part
Title
Focus
→ Part 0
AI Generates Your Infrastructure. Who Validates It Stays Resilient? (this post)
WHY we still need automated resiliency review
Part 1
 Building the Agent: Static Rules + AI Skills in 500 Lines 
HOW it works — scanner, rules engine, dynamic skills, Bedrock
Part 2
 Ship It: GitHub Action, OIDC, and 12 Findings on a Real App 
HOW to use it — action.yml, OIDC, SARIF, real test results


Ajay Singh is a Senior Technical Account Manager at AWS passionate about operational excellence and reliability engineering. All opinions are his own.
Related:
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article