I've been experimenting with AI coding agents writing infrastructure, and one thing kept bothering me:
AI can generate valid Terraform that is also insecure Terraform.
For example, you ask:
"Add an RDS instance for my orders service."
The model can happily generate Terraform that is missing encryption, deletion protection, backups, etc.
By the time CI catches it, you've already generated the code, opened a PR, waited for checks, and gone through review.
So I built Sovereign Observer, an MCP server that runs locally and lets Claude Code, Cursor, VS Code/Copilot, etc. scan the Terraform as it's being generated.
The workflow is basically:
AI writes Terraform → MCP scans it → findings are returned → AI fixes them → scan again.
It currently supports:
Terraform/IaC security scanning
Finding explanations + exact remediation
Safe mechanical fixes
Hardened resource templates
SOC 2 / ISO 27001 / NIST / PCI-DSS / DORA / NIS2 mappings
Organization-specific security requirements
Runs locally so Terraform doesn't need to leave your machine
It's available on PyPI if anyone wants to try it:
pip install sovereign-observer
If you guys think it needs more refinement or you wish it did something more then pls lmk!