Terraform Security Review Skill for Antigravity CLI
Review a Terraform plan for provider fields, IAM scope, state secrets, and destructive actions. Use for a Terraform security review. Do not use to apply or destroy, or for a non-Terraform repository.
name: "terraform-security-review" description: "Review a Terraform plan for provider fields, IAM scope, state secrets, and destructive actions. Use for a Terraform security review. Do not use to apply or destroy, or for a non-Terraform repository."
Terraform Security Review
Shared skill terraform-security-review for Terraform. Codex and Antigravity CLI both read .agents/skills/terraform-security-review/SKILL.md. Install this one file. Codex calls it with $terraform-security-review or /skills. Cursor, GitHub Copilot, and Devin also read .agents/skills. A second copy with the same name collides. Do not install another tool's file there.
When to run
Run this review for a Terraform change or a request to "review the plan". The work is read-only.
When to leave it
Do not upgrade dependencies or the framework version unless the user asked.
Stop if the user asks you to apply or destroy. Explain that a person runs those. Do not run them.
Steps
- Read the required Terraform version and the provider lock. An attribute you cannot find in that provider's schema is a high finding. Do not guess a replacement field.
- Review IAM and security groups in the diff. Flag a policy that grants more actions or a wider ARN than the resource needs. Do not flag
Resource "*"when the action has no resource-level permission.0.0.0.0/0on an admin port is a high finding. - Search for secrets in variables, outputs, and tfvars. A committed secret is a high finding. Do not copy the secret into the report. Say the file and the variable name.
- If a saved plan or
terraform planoutput is available and the user asked for a read-only plan, summarize creates, changes, replaces, and destroys. A replace of a data store is a high finding. If you cannot run plan, writenot run. - Do not run
applyordestroy.
Output
Findings with severity, file, line, the risky action, and a narrower change. State clearly that nothing was applied.
## Findings
- high | path:line | what is wrong | what to do instead
## No findings
Say "No findings" and list the files you opened. A search you skipped is not a clean result.
## Example
Input: an `aws_security_group_rule` opens port 22 to `0.0.0.0/0`, and an IAM action that has no resource-level permission uses `Resource "*"`.
Output: high | sg.tf:4 | admin SSH is open to the world | restrict the CIDR. No findings for the `Resource "*"` on the action that requires it.
Do not flag the valid pattern named in the standards. Flag the mistake next to it.
What to check
- State: a state file committed to the repo, or a remote backend with no lock.
- IAM: an action allowed more broadly than it needs.
Resource "*"is required for some actions that have no resource-level permissions, so do not flag the star by itself. - Secrets: a password or key written in
.tfor committed.tfvars. - Network:
0.0.0.0/0on an admin port such as 22 or 3389. - Apply: do not plan an
applyordestroyfrom the agent.
Stop
Stop when the user asks for apply, destroy, or a prod workspace you were not given read-only access to.
Severity
high is a bug a caller can hit or a secret that leaks. medium is a broken contract that needs a specific input. low is a cleanup that does not change behaviour.