Core Loop

AI-first engineering at scale

Theme

AI-First Infrastructure as Code (IaC) Security

Velocity Without Verification Compounds Risk

Daniel Leblond April 2026

AI-assisted infrastructure work feels magical when it works. You can scaffold Bicep modules, policy definitions, and deployment orchestration in minutes. The danger is velocity without verification.

In application code, a bug can hurt one endpoint. In infrastructure, one bad assumption can affect every workload in the environment. AI can generate IaC quickly. It cannot own the blast radius.

The AI-IaC Confidence Gap: perceived security confidence vs. verified-by-evidence confidence across secret exposure, IAM over-permission, and misconfiguration drift.

Security-First IaC Needs Evidence at Every Gate

Many teams treat 'template compiled' as equivalent to 'deployment is secure.' Those are not the same claim.

A gate is only meaningful when its evidence is concrete and independently verifiable. Prose descriptions do not qualify.

Gate Required Evidence Failure If Missing
Intent Clear deployment objective and threat assumptions Unscoped generation and accidental overreach
Validation Lint, template diagnostics, and policy checks Hidden misconfigurations merge silently
Execution Deterministic deployment logs and outputs 'Applied successfully' without proof
Observation Alerts, telemetry, and post-deploy health signals Security posture drifts unnoticed
Attack surface assessment: how infrastructure provisioning, access patterns, and deployment channels create security-critical decision points.

Threat Modeling Changes in an AI-First IaC World

Traditional threat models focus on runtime attack paths. AI-first IaC adds authoring-time threat paths: model invents a permissive default, reviewer misses it, deployment succeeds, monitoring appears green because alerts are misconfigured.

The fix is not 'review harder.' The fix is structured evidence linked to known threat categories. Each security gate maps to a specific threat class that can be independently verified.

Detection pipeline: continuous control validation across secret handling, identity scope, network boundaries, and policy compliance.

What Good IaC Evidence Looks Like

If your evidence is only prose, reviewers are being asked to trust interpretation instead of inspect facts.

Strong infrastructure evidence is reproducible: the same commands run against the same state produce the same output every time.

Control Area Strong Evidence Artifact
Identity Role assignment diff with least-privilege justification
Network NSG and route intent captured with explicit deny paths
Data protection Encryption and key references validated against approved vaults
Monitoring Alert rule outputs with action group linkage verified
Deployment safety Before/after deployment outputs plus rollback rehearsal note
Audit Reproducibility Matrix: which artifact types satisfy each security control family (identity, network, data protection, monitoring).

Common AI-IaC Failure Patterns

Pattern Typical Symptom Prevention Mechanism
Privilege inflation Contributor where Reader was enough Policy checks plus role allowlist
Alert illusion Alert resources exist, notifications never fire Action-group integration tests
Environment drift Bicep, compiled ARM, and deployed outputs diverge Source-of-truth checks in CI
Unsafe defaults Public endpoints or broad firewall allowances slip in Baseline modules with deny-by-default
Recovery gap No proven rollback for critical infra update Mandatory rollback rehearsal evidence
Confidence envelope across four IaC stages: intent, validation, execution, and observation, showing verified vs. perceived confidence drift.

A Lightweight IaC Security Workflow to Start Tomorrow

  • Require a short threat intent section in every infra PR.
  • Attach policy diagnostics and deployment outputs as evidence.
  • Fail PRs on unresolved critical or high findings.
  • Validate alert path end to end at least once per release cycle.
  • Track repeated failure patterns and harden templates accordingly.
Double blind security review: independent verification of intent, controls, and outcomes separate from implementation path.
Policy enforcement funnel: how infrastructure PRs move through validation, risk assessment, and security gates.
IaC security maturity: from ad-hoc generation to audit-verified infrastructure delivery.
Back to home

References

  1. Microsoft Learn (2026) Bicep Best Practices
  2. Azure Architecture Center (2026) Threat Modeling for Cloud Workloads
  3. METR (2025) AI Tools Made Experienced Developers 19% Slower
  4. Martin Fowler / Kief Morris (2025) How Far Can We Push AI Autonomy in Code Generation?
  5. Addy Osmani (2026) AI Writes Code Faster. Your Job Is Still to Prove It Works.
  6. ThoughtWorks (2025) AI-Aided Test-First Development