HashiCorp Agent Skills is a collection of reusable instructions and plugins that help coding agents work with Terraform and Packer. Developers use it to add HashiCorp product workflows to supported coding-agent tools, either individually or as product bundles.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add hashicorp/agent-skills --skill terraform-policygit clone --depth 1 https://github.com/hashicorp/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/hashicorp/agent-skills/terraform-policy)<a href="https://agentmods.dev/skills/hashicorp/agent-skills/terraform-policy"><img src="https://agentmods.dev/badge/skills/hashicorp/agent-skills/terraform-policy/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/hashicorp/agent-skills/terraform-policy"><img src="https://agentmods.dev/badge/skills/hashicorp/agent-skills/terraform-policy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Socket pass
- Snyk warn
- NVIDIA SkillSpector warn
SkillSpector: 2 findings, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium MCP Rug Pull · line 50 npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.Fix: Pin the version: npx @scope/[email protected]
- medium MCP Rug Pull · line 51 npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.Fix: Pin the version: npx @scope/[email protected]
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00048 | $0.00613 |
| Opus 5 | $0.00024 | $0.00307 |
| Sonnet 5 | $0.00010 | $0.00123 |
| Haiku 4.5 | $0.00005 | $0.00061 |
Grade A, and why
terraform-policy scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.
terraform-policy
UTILITY SKILL — INVOKES: tfpolicy-author | tfpolicy-test
USE FOR:
- Writing a new
.policy.hclpolicy from a description or requirement - Converting a
.sentinelpolicy to Terraform Policy - Writing or debugging a
.policytest.hcltest file - Migrating a Sentinel policy library to Terraform Policy
Before giving authoring or testing instructions, check the installed tfpolicy CLI version and tailor guidance accordingly:
- If the CLI is
0.1.x, do not requirepolicy { required_providers { ... } }; generate policies compatible with tfpolicy 0.1.x syntax and behavior. - If the CLI is
0.2.0or newer, include a top-levelpolicy { required_providers { ... } }block when authoring.policy.hcl. It is mandatory fortfpolicy validate; version-range validation is best effort, and wildcard targets such asresource_policy "*"are not schema-validated. - If the CLI version is unknown, ask the user to check it first or provide guidance that clearly distinguishes the
0.1.xand0.2.0+paths.
DO NOT USE FOR:
- Writing
.tftest.hclfiles for Terraform modules — useterraform-test - General Terraform HCL authoring — use
terraform-style-guide
Routing
| Task | Sub-skill |
|---|---|
Write or convert a .policy.hcl policy |
tfpolicy-author |
Write or debug a .policytest.hcl test |
tfpolicy-test |
Examples
- "Block EC2 instances without encryption" → tfpolicy-author
- "Convert this Sentinel policy to tfpolicy" → tfpolicy-author
- "Write a policytest for my EBS policy" → tfpolicy-test
Troubleshooting
- Wrong skill triggered? Load the sub-skill directly from the routing table above.
npx skills add hashicorp/agent-skills/terraform/terraform-policy/skills/tfpolicy-author
npx skills add hashicorp/agent-skills/terraform/terraform-policy/skills/tfpolicy-test
What ships with it
54 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- .gitignore 29 B
- examples/conversion/cloudfront-associated-with-waf/cloudfront-associated-with-waf.policy.hcl 520 B
- examples/conversion/cloudfront-associated-with-waf/cloudfront-associated-with-waf.sentinel 1.6 KB
- examples/conversion/cloudfront-associated-with-waf/README.md 871 B
- examples/conversion/cloudtrail-server-side-encryption-enabled/cloudtrail-server-side-encryption-enabled.policy.hcl 443 B
- examples/conversion/cloudtrail-server-side-encryption-enabled/cloudtrail-server-side-encryption-enabled.sentinel 1.4 KB
- examples/conversion/cloudtrail-server-side-encryption-enabled/README.md 846 B
- examples/conversion/dms-endpoint-should-be-ssl-configured/dms-endpoint-should-be-ssl-configured.policy.hcl 447 B
- examples/conversion/dms-endpoint-should-be-ssl-configured/dms-endpoint-should-be-ssl-configured.sentinel 1.5 KB
- examples/conversion/dms-endpoint-should-be-ssl-configured/README.md 872 B
- examples/conversion/dms-endpoints-should-use-ssl/dms-endpoints-should-use-ssl.policy.hcl 510 B
- examples/conversion/dms-endpoints-should-use-ssl/dms-endpoints-should-use-ssl.sentinel 1.4 KB
- examples/conversion/dms-endpoints-should-use-ssl/README.md 800 B
- examples/conversion/ec2-network-acl-should-have-subnet-ids/ec2-network-acl-should-have-subnet-ids.policy.hcl 966 B
- examples/conversion/ec2-network-acl-should-have-subnet-ids/ec2-network-acl-should-have-subnet-ids.sentinel 2.9 KB
- examples/conversion/ec2-network-acl-should-have-subnet-ids/README.md 970 B
- examples/conversion/ec2-vpc-default-security-group-no-traffic/ec2-vpc-default-security-group-no-traffic.policy.hcl 796 B
- examples/conversion/ec2-vpc-default-security-group-no-traffic/ec2-vpc-default-security-group-no-traffic.sentinel 3.6 KB
- examples/conversion/ec2-vpc-default-security-group-no-traffic/README.md 1.1 KB
- examples/conversion/efs-access-point-should-enforce-user-identity/efs-access-point-should-enforce-user-identity.policy.hcl 379 B
- examples/conversion/efs-access-point-should-enforce-user-identity/efs-access-point-should-enforce-user-identity.sentinel 1.3 KB
- examples/conversion/efs-access-point-should-enforce-user-identity/README.md 727 B
- examples/conversion/elasticache-redis-replication-group-encryption-at-transit-enabled/elasticache-redis-replication-group-encryption-at-transit-enabled.policy.hcl 478 B
- examples/conversion/elasticache-redis-replication-group-encryption-at-transit-enabled/elasticache-redis-replication-group-encryption-at-transit-enabled.sentinel 1.5 KB
- examples/conversion/elasticache-redis-replication-group-encryption-at-transit-enabled/README.md 777 B
- examples/conversion/elasticsearch-encrypted-at-rest/elasticsearch-encrypted-at-rest.policy.hcl 515 B
- examples/conversion/elasticsearch-encrypted-at-rest/elasticsearch-encrypted-at-rest.sentinel 1.5 KB
- examples/conversion/elasticsearch-encrypted-at-rest/README.md 734 B
- examples/conversion/elasticsearch-https-required/elasticsearch-https-required.policy.hcl 1.0 KB
- examples/conversion/elasticsearch-https-required/elasticsearch-https-required.sentinel 2.3 KB
- examples/conversion/elasticsearch-https-required/README.md 904 B
- examples/conversion/elasticsearch-in-vpc-only/elasticsearch-in-vpc-only.policy.hcl 520 B
- examples/conversion/elasticsearch-in-vpc-only/elasticsearch-in-vpc-only.sentinel 1.9 KB
- examples/conversion/elasticsearch-in-vpc-only/README.md 890 B
- examples/conversion/eventbridge-custom-event-bus-should-have-attached-policy/eventbridge-custom-event-bus-should-have-attached-policy.policy.hcl 776 B
- examples/conversion/eventbridge-custom-event-bus-should-have-attached-policy/eventbridge-custom-event-bus-should-have-attached-policy.sentinel 2.1 KB
- examples/conversion/eventbridge-custom-event-bus-should-have-attached-policy/README.md 1.1 KB
- examples/conversion/s3-block-public-access-bucket-level/README.md 1.1 KB
- examples/conversion/s3-block-public-access-bucket-level/s3-block-public-access-bucket-level.policy.hcl 1.1 KB
- examples/conversion/s3-block-public-access-bucket-level/s3-block-public-access-bucket-level.sentinel 3.2 KB
- examples/conversion/s3-bucket-should-have-object-lock-enabled/README.md 975 B
- examples/conversion/s3-bucket-should-have-object-lock-enabled/s3-bucket-should-have-object-lock-enabled.policy.hcl 961 B
- examples/conversion/s3-bucket-should-have-object-lock-enabled/s3-bucket-should-have-object-lock-enabled.sentinel 2.8 KB
- examples/conversion/secretsmanager-auto-rotation-enabled-check/README.md 955 B
- examples/conversion/secretsmanager-auto-rotation-enabled-check/secretsmanager-auto-rotation-enabled-check.policy.hcl 798 B
- examples/conversion/secretsmanager-auto-rotation-enabled-check/secretsmanager-auto-rotation-enabled-check.sentinel 2.2 KB
- examples/conversion/step-functions-state-machine-logging-enabled/README.md 778 B
- examples/conversion/step-functions-state-machine-logging-enabled/step-functions-state-machine-logging-enabled.policy.hcl 655 B
- examples/conversion/step-functions-state-machine-logging-enabled/step-functions-state-machine-logging-enabled.sentinel 1.6 KB
- examples/README.md 2.5 KB
- README.md 2.5 KB
- references/tfpolicy-author.md 97 KB
- references/tfpolicy-test.md 70 KB
- references/verified-syntax.md 98 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 53 lines · 48 tokens per session scan A c88fa1b21fb0
terraform-policy is a skill published in the GitHub repository hashicorp/agent-skills (865 stars, last pushed 6d ago), licensed MPL-2.0. It adds 48 tokens to every session and 613 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
insight-error-page
Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…
next-cache-components-optimizer
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…
next-partial-prefetching-adoption
Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…