# Terraform Apply Risk Gate

> Reads a Terraform plan and shows what will be destroyed, replaced or exposed before you run apply.

Terraform Apply Risk Gate is a free AI agent skill on Agensi by Prateek, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Prateek](https://www.agensi.io/creators/prateek)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.0
- Last updated: 2026-12-04
- Security: scan passed (2026-12-04); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/terraform-apply-risk-gate
- Tags: devops-cloud, security, code-quality-review

## What it does

- Flags database, bucket and volume replacements
- Finds security rules open to the whole internet
- Catches wildcard IAM policies and disabled encryption
- Lists every resource that will be destroyed

## Who it's for

- **DevOps and Platform engineers managing cloud infrastructure:** Catch accidental database deletions and security holes before they hit production. Try: "Review this plan.json for any resource replacements or security risks."
- **Security teams auditing infrastructure changes:** Automatically flag open ports and wide-open permissions in every infrastructure update. Try: "Check this terraform plan for public buckets or unsafe firewall rules."
- **Engineering leads reviewing team pull requests:** Know exactly which resources will be destroyed without reading thousands of lines of code. Try: "Show me a summary of what will be deleted or replaced in this plan."

## About this skill

You are about to update your cloud setup, but one wrong line in your code could delete a database or open a private server to the internet. This skill reads your planned changes and warns you about the scary stuff before you say yes. It looks specifically for "destroys" and "replacements" that might cause downtime or data loss.

### How it works

1. You provide a JSON file of your planned infrastructure changes.
2. The skill runs a specialized script to scan every resource in that file.
3. Your AI agent looks for dangerous patterns like public access or deleted disks.
4. You get a clear report with a verdict: Block, Review, or Safe.

### Frameworks & tools

This skill works with Terraform plan files saved in JSON format. It uses a Python script to analyze the resource changes.

### Why this beats prompting it yourself

A standard AI might miss a single "replace" line buried in a 5,000-line file. This skill uses a dedicated script to ensure every single resource change is checked against strict security and safety rules. It treats a "replacement" as a high-risk event because it knows that means deleting the old one first, which a general prompt might overlook.

### Use cases

- Checking if a database will be deleted before running an update
- Catching firewall rules that accidentally open your database to the whole internet
- Finding where encryption was turned off by mistake
- Making sure a DNS change won't accidentally kill your website traffic

### Known limitations

This only reads JSON plan files, not the original code. It cannot see changes made manually in the cloud console that are not part of the plan, and it cannot guarantee a way to undo changes.

## Requires

- Python 3.9+

## Technical details

The skill requires a Terraform plan converted to JSON using `terraform show -json`. It executes a bundled `review_plan.py` script to parse the `resource_changes` array. It evaluates risks based on action types (delete, replace) and specific attributes like CIDR blocks (0.0.0.0/0) and sensitive ports. It returns an exit code 1 if critical risks are found to support automated gating.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Terraform Apply Risk Gate skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What does Terraform Apply Risk Gate do?

Reads a Terraform plan and shows what will be destroyed, replaced or exposed before you run apply.

### Which AI agents support Terraform Apply Risk Gate?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use Terraform Apply Risk Gate?

Connect your AI agent to Agensi through MCP, then ask it to use Terraform Apply Risk Gate on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
