# HashiCorp Sentinel enforces policies inside HashiCorp products, with three enforcement levels and a local test command

Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.

HashiCorp Sentinel is a policy-as-code framework embedded in HashiCorp products, including HCP Terraform, where its policies check Terraform plans. It has advisory, soft mandatory and hard mandatory enforcement levels and a sentinel test command. Version 0.41.0 is listed as latest on 16 Nov 2026; its license terms were not found.

## HashiCorp Sentinel described by eight fields, read 16 Nov 2026

| Field | Value |
| --- | --- |
| What it evaluates | Data that a host application supplies through imports. In HCP Terraform the imports are tfplan, tfconfig, tfstate and tfrun |
| Where it runs | Inside Sentinel-enabled applications such as HCP Terraform; a local CLI is documented for development and testing |
| Policy language | The Sentinel language: policies are single .sentinel files with a main rule |
| Clouds and targets | Whatever Terraform plans. HashiCorp documents Terraform and Consul integrations |
| License | None found on 16 Nov 2026 in the pages read. The documentation offers binary downloads, and github.com/hashicorp/sentinel returned HTTP 404 |
| Maintainer | HashiCorp (developer.hashicorp.com documentation) |
| Tested before enforcement | `sentinel test` runs cases in test//*.hcl or .json with mock data; the advisory enforcement level lets a policy fail with a warning |
| Current version | 0.41.0, marked latest on the Sentinel downloads page; a release date: none found on 16 Nov 2026 |

## Sentinel runs where the host product runs it, and checks the plan before apply

HashiCorp says Sentinel "is a policy as code tool that lets you control what users of HashiCorp products are allowed to do" and enforces policies proactively. In HCP Terraform, policies are rules that validate Terraform plans against security rules and best practices. HashiCorp gives the example of preventing production deployments to the wrong region.

HCP Terraform applies policy sets to workspaces, to projects or globally, and checks the plan during each run. A policy set may contain policies from only one framework, but several sets with different frameworks can attach to one workspace. HashiCorp also publishes pre-written policies for common standards such as PCI DSS.

A Sentinel policy is a single .sentinel file, and the language guide says there is no built-in way to merge several files. The result comes from a main rule: a boolean passes on true and fails on false. HashiCorp says the language can be learned in an hour; that is its claim, not a measurement.

## Enforcement levels and local tests are the two safety steps

Sentinel makes the level a deployment setting, separate from the policy logic. Advisory, the default, lets a policy fail with a warning. Soft mandatory must pass unless a user with the right privilege overrides it. Hard mandatory must pass, and the only override is removing the policy. A new guardrail can therefore start as advisory and move up.

The `sentinel test` command looks for cases under test/<policy>/, where each HCL or JSON file is one case with mock data. HashiCorp recommends storing policies in version control and running these tests in CI.

## Reach is limited to what the HashiCorp product sees

HashiCorp states that HCP Terraform does not support custom imports, so the data a policy can read is fixed to the four Terraform imports. A change made outside Terraform is never presented to the policy.

The HCP Terraform Free edition includes one policy set of up to five policies, per HashiCorp's page; Standard and Premium editions add version control connections and API-created policy set versions. Check the current pricing page before relying on that.

## Sentinel and OPA can be used on the same Terraform workspace family

Because HCP Terraform supports both frameworks, the choice is often between a HashiCorp-specific language and [Open Policy Agent](/engines/open-policy-agent/). Compare the fields on the [policy as code tools](/policy-as-code-tools/) page, see a real Sentinel rule on [policy as code examples](/policy-as-code-examples/), and read the [method](/method/) for how this site treats rollout safety.

## Related pages

- [Cloud Custodian: fields, version and testing](/engines/cloud-custodian/)
- [Kyverno: fields, version and testing](/engines/kyverno/)
- [CloudFormation Guard: fields, version and testing](/engines/cloudformation-guard/)
- [All of them](/guides/)

## Sources

- HashiCorp: Sentinel documentation: https://developer.hashicorp.com/sentinel/docs (read 16 Nov 2026)
- HashiCorp: Sentinel enforcement levels: https://developer.hashicorp.com/sentinel/docs/concepts/enforcement-levels (read 16 Nov 2026)
- HashiCorp: testing Sentinel policies: https://developer.hashicorp.com/sentinel/docs/writing/testing (read 16 Nov 2026)
- HashiCorp: sentinel test command: https://developer.hashicorp.com/sentinel/docs/commands/test (read 16 Nov 2026)
- HashiCorp: install Sentinel: https://developer.hashicorp.com/sentinel/downloads (read 16 Nov 2026)
- HashiCorp: Sentinel language: https://developer.hashicorp.com/sentinel/docs/language (read 16 Nov 2026)
- HashiCorp: policy enforcement in HCP Terraform: https://developer.hashicorp.com/terraform/cloud-docs/policy-enforcement (read 16 Nov 2026)
- HashiCorp: define Sentinel policies in HCP Terraform: https://developer.hashicorp.com/terraform/cloud-docs/policy-enforcement/sentinel (read 16 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://cloudgovernancetools.com/engines/hashicorp-sentinel/
