Pre-Beta Pre-beta signups are open now. The full audytx engine is live for pre-beta. Everything free today stays free — paid tiers arrive Sep 01, 2026 from $20/month for unlimited repositories.
Securing AI-generated Terraform · Claude Code

Secure the Terraform Claude Code writes

Claude Code writes Terraform fast, and — as our corpus study found — the code it ships is on par with hand-written production modules. The gaps that remain are cross-resource and operational, exactly the kind a single-file review misses. Give Claude Code the audytx MCP server and one standing instruction, and the agent that wrote the Terraform reads its own AWS security findings before the pull request exists.

Why

The agent that wrote it is the fastest reviewer

Static scanners run after the code lands. When the author is an agent, you can move the review left of the pull request entirely: the same session that generated the Terraform scans it, reads the findings, and fixes them before a human ever sees a diff. That only works if the findings are precise — an agent drowning in false positives will "fix" benign code and churn. audytx's cross-resource context is what keeps the signal clean enough to hand an agent.

48.3
findings / 100 resources in AI-generated Terraform — on par with production's 52.2
61%
of HIGH findings trace to one cross-resource gap: Secrets Manager rotation left unconfigured
85
false positives the context layer suppressed on that same corpus, each with a printed rationale

Numbers from the audytx AI-generated Terraform study (Claude Opus 4.8, 50 configs, 1,421 resources).

Setup

Two steps

  1. Register the MCP server

    Get a free Client ID from the dashboard (the plaintext UUID is shown once), then add the server:

    claude mcp add --transport http audytx https://audytx.com/mcp \
      --header "X-Client-ID: YOUR_CLIENT_ID"

    That's the standard remote-HTTP MCP registration. audytx exposes scan_terraform, autofix_terraform, scan_cloudformation, and four more tools; discovery is open, and tools/call is authenticated by the Client ID you just passed.

  2. Give Claude Code a standing instruction

    Claude Code reads CLAUDE.md at the repo root automatically. Add a line so it scans without being asked every time:

    # CLAUDE.md
    Before opening a pull request that touches .tf files, call
    audytx scan_terraform on the full set of Terraform files in the
    repo — not just the diff; cross-resource reasoning needs the unchanged
    files too. Fix every High and Critical finding, then re-scan. For the
    mechanical ones, autofix_terraform applies the sound fixes and
    re-scans in one pass.

    Pass the complete file set, not only the changed files — audytx builds IAM trust graphs, attack paths, and DLQ-identity edges across resources, and it can't reason about a file you withhold.

That's the whole integration. No CI wiring, no build step. The next time Claude Code finishes a Terraform change, it scans, reads the findings with file:line evidence and remediation, and closes the High/Critical ones itself.
What it catches

The gaps a single-file review can't see

These are the patterns our study found frontier models ship by default — the reason this setup earns its place:

The suppressions matter just as much — the false positives audytx removes so the agent doesn't chase them: a DLQ that isn't asked to have its own DLQ, a Lambda flagged for a missing DLQ when nothing invokes it asynchronously, an IAM role that reads privileged but can't escalate. Each suppression is printed with its reasoning, so the agent (and you) can check the call.

Also

Same engine on every other surface

The MCP loop is the pre-PR half. For the review half, install the GitHub App — it posts one comment per pull request with the same findings, inline annotations, and SARIF to GitHub Code Scanning, so anything the agent missed still gets caught on the PR. Building CloudFormation instead of Terraform? The same agent loop works with scan_cloudformation — same rule ids, same context.

FAQ

Common questions

Does audytx store the Terraform Claude Code sends it?

No. Files sent to scan_terraform are parsed in memory and discarded when the response returns — the same privacy posture as the GitHub App path. Only aggregate scan metadata (finding counts, engine version) is recorded, never file contents.

Is this free?

Yes, during the open beta. A free Client ID covers 500 MCP tool calls per month, shared across all your Client IDs, and only successful calls are metered. No credit card.

Why scan the whole repo instead of just the files Claude Code changed?

Because the highest-value findings are cross-resource. Whether a Lambda needs a dead-letter queue depends on what invokes it; whether an IAM role can escalate depends on the roles it can assume. Those edges live in files the current change may not touch. audytx scans the whole tree, then you can scope the report to what changed.

How is this different from Checkov or tfsec running in the same repo?

Those are single-resource pattern matchers — they flag a resource for a missing attribute regardless of whether context makes it benign. audytx pre-computes relationship graphs and suppresses findings that context proves harmless, showing the rationale. For an agent, that precision is the difference between a clean fix loop and false-positive churn. See the benchmark comparison.

Open beta

Close the loop in your next Claude Code session

Register the MCP server, add the CLAUDE.md line, and let the agent review its own Terraform — free during the beta.