Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Conftest

$ conftest Foundation Low Risk
Open Policy Agent · Cloud & Infra · Apache-2.0 · macos / linux / windows

conftest brings Open Policy Agent (OPA) Rego policies to structured config files including Kubernetes manifests, Terraform plan JSON, Dockerfiles, TOML, and HCL. It runs cleanly offline, exits non-zero on policy violations, and outputs structured results via --output json.

FCRS-1.0 Score
93 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install conftest
CLI vs MCP Decision CLI Only

Local config policy gatekeeper; conftest test -o json runs directly on repo files without MCP overhead.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 23 / 25

Supports --output json (-o json), --no-color, non-zero exit codes on deny, and stdin piping (conftest test -).

  • Native -o json / --output json and --no-color flags
  • Supports stdin (-) and multiple config parsers automatically
Trust & Safety 24 / 25

Read-only policy evaluator by default; only writes locally if conftest pull downloads an OCI policy bundle.

  • Read-only test and verify commands with zero cloud side effects
Setup & Portability 15 / 15

Single static Go binary available via Homebrew, Go, and GitHub Releases on macOS, Linux, and Windows.

  • Single static Go binary with built-in multi-format parsers
Utility & Efficiency 14 / 15

Parses YAML, JSON, HCL, Dockerfile, TOML, and XML natively so agents do not need separate converters before running OPA.

  • Auto-detects 15+ config formats for Rego validation
Maintenance & Lineage 9 / 10

Hosted under the open-policy-agent GitHub organization with Apache-2.0 license.

  • Maintained under open-policy-agent/conftest
Docs & Verifiability 8 / 10

Concise official docs at conftest.dev with examples for Terraform, Kubernetes, and Dockerfiles.

  • Documented CLI flags and parser matrix at conftest.dev

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

No authentication required for local policy testing; pulling OCI policy bundles honors standard Docker/OCI credential helpers.

Side Effects
Read-Only
Cost & Quotas

Apache-2.0 open-source project under Open Policy Agent; free to use.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Conftest Agent Rules
- Always pass `--output json` (`-o json`) and `--no-color` when parsing violations.
- Avoid `conftest pull` from untrusted OCI registries without verifying policy bundle digests.
- Use `conftest verify -p policy/` after editing Rego policy rules.

Agent-Ready Command Recipes

Safe Read-Only Queries

Test Kubernetes manifests with JSON report
conftest test deploy.yaml -p policy/ --output json

Evaluates Rego deny/warn rules against deploy.yaml and emits structured JSON findings.

Verify Rego policy files themselves
conftest verify -p policy/ --output json

Runs unit tests inside policy/ without modifying any configuration files.

Strengths for Agents

  • + Built-in parsers for YAML, HCL, Dockerfile, JSON, and TOML feed directly into Rego.
  • + Clean --output json and --no-color support with clear pass/fail exit codes.
  • + Supports stdin piping (terraform show -json tfplan | conftest test -).

Caveats & Pitfalls

  • ! Errors from non-standard YAML/HCL files can sometimes require explicit --parser overrides.
  • ! Requires deny / violation rules written in Rego; ships no built-in default ruleset.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI