# Conftest

> Write tests against structured configuration data using the Open Policy Agent Rego query language

Source: https://talira.ai/catalog/conftest-a2wmk69h
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Command-line tool
- Categories: [infrastructure / kubernetes / validation](https://talira.ai/categories/infrastructure/kubernetes/validation), [developer tools / testing](https://talira.ai/categories/developer-tools/testing)
- Platforms: macos, linux, windows, docker[^4][^6]
- Licence: Apache-2.0[^3]
- Pricing: Free and open source[^3]
- Free tier: yes[^3]
- Self-hostable: yes[^4]
- Plugins: yes[^5]
- Backed by: [Open Policy Agent](https://talira.ai/orgs/open-policy-agent.md)
- Creator: Gareth Rushgrove

Conftest tests configuration files against policies written in Rego, the policy language of [Open Policy Agent](https://talira.ai/catalog/open-policy-agent-rerf6ac8.md). It isn't specific to [Kubernetes](https://talira.ai/catalog/kubernetes-ftsegx3m.md): it parses YAML, JSON, HCL and [Terraform](https://talira.ai/catalog/terraform-zdejdqmx.md), Dockerfiles, TOML, INI, XML, CUE, Jsonnet, [Jenkins](https://talira.ai/catalog/jenkins-bh8syzfs.md) pipelines, .env and ignore files, SPDX and CycloneDX SBOMs and more, and reports deny, warn and violation rules as test results in plain text, JSON, TAP, JUnit, [GitHub](https://talira.ai/catalog/github-ppcgj756.md), Azure DevOps or SARIF format. Policies can be unit-tested with `conftest verify` and shared by pulling from [Git](https://talira.ai/catalog/git-ab5bez9f.md), HTTPS or OCI registries and pushing to OCI registries. Created by Gareth Rushgrove, part of the Open Policy Agent project, Apache-2.0.

## Links

- Website: https://www.conftest.dev/
- GitHub: https://github.com/open-policy-agent/conftest
- Docs: https://www.conftest.dev/

## Ways to install

### Package managers

- [Homebrew](https://talira.ai/catalog/homebrew-djy17yn9.md): <https://formulae.brew.sh/formula/conftest>[^1]
- [mise](https://talira.ai/catalog/mise-0axr08xw.md): <https://mise-versions.jdx.dev/tools/conftest>[^2]

## Problems it solves

- fail the build when a Kubernetes manifest doesn't follow our security rules
- check Terraform code against company policy before it's applied
- write rules for our Dockerfiles, like banning images that run as root
- test any YAML, JSON, TOML or HCL config file against rules I write once
- share the same config policies across many repositories from a registry
- unit test the policy rules themselves before rolling them out
- show config policy failures as annotations in GitHub or Azure DevOps pipelines
- check SBOM files for licences or components we don't allow

## Features

- Rego policies from Open Policy Agent
- parsers for YAML, JSON, HCL/HCL2, Dockerfile, TOML, INI, XML, CUE, Jsonnet, EDN, HOCON, .env, .properties, Jenkinsfile, nginx, VCL, ignore files, CODEOWNERS, SPDX and CycloneDX
- `conftest verify` for policy unit tests
- pull policies from HTTPS, Git or OCI registries
- push policy bundles to OCI registries
- output as plain text, JSON, TAP, table, JUnit, GitHub, Azure DevOps or SARIF
- exceptions
- plugins
- pre-commit hook
- Homebrew, Scoop, mise and Docker installs

## Capabilities

- Has a command line tool: plan not known
- Takes plugins: plan not known

## Trust

Overall: 0.73 out of 1.
Signals: maintenance 0.97, adoption 0.70, momentum 0.47, community 0.86, backing 0.50, extensibility 0.40.

- last commit 5 days ago
- 55 commits in the last 90 days
- latest release v0.71.1 49 days ago
- 3.3k GitHub stars
- 140 contributors
- backed by Open Policy Agent
- created by Gareth Rushgrove
- has a plugin system

## Alternatives

- [Checkov](https://talira.ai/catalog/checkov-x7fvaqw4.md): Prevent cloud misconfigurations and find vulnerabilities during build-time in infrastructure as code, container images and open source packages
- [Kyverno](https://talira.ai/catalog/kyverno-29hn8ks7.md): Unified Policy as Code
- [KubeLinter](https://talira.ai/catalog/kubelinter-ajb5n3q6.md): Static analysis for Kubernetes YAML files and Helm charts

## Sources

[^1]: https://formulae.brew.sh/api/formula.json (checked 21 Nov 2026)
[^2]: https://mise-versions.jdx.dev/tools.json (checked 21 Nov 2026)
[^3]: https://github.com/open-policy-agent/conftest/blob/master/LICENSE (checked 19 Nov 2026)
[^4]: https://www.conftest.dev/install/ (checked 19 Nov 2026)
[^5]: https://www.conftest.dev/plugins/ (checked 19 Nov 2026)
[^6]: https://github.com/open-policy-agent/conftest/releases/latest (checked 19 Nov 2026)
