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

Open Policy Agent

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

The opa CLI evaluates Rego policy queries against arbitrary JSON/YAML inputs, runs unit test suites (opa test), formats .rego files, and compiles policy bundles. Because JSON is OPA's native data model, opa eval --format json and opa test --format json integrate seamlessly with agents.

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

Deterministic local Rego evaluator and test runner; direct CLI invocation gives exact JSON decision payloads without MCP latency.

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

Native JSON data model across opa eval --format json, opa test --format json, and opa check --format json with zero interactive prompts.

  • Consistent --format json across eval, test, and check
  • Supports --fail / --fail-defined flags for CI exit codes
Trust & Safety 25 / 25

Sandboxed Rego evaluation cannot mutate host or cloud state; file writes are opt-in via opa fmt -w or opa build -o.

  • Pure local policy evaluation with zero side effects
Setup & Portability 15 / 15

Single static Go binary available on macOS, Linux, and Windows via Homebrew, Go, Docker, and releases.

  • Zero runtime dependencies; single cross-platform binary
Utility & Efficiency 14 / 15

Covers policy linting, unit testing, REPL, Wasm compilation, and bundle building in one fast binary.

  • All-in-one toolchain (eval, test, check, fmt, build)
Maintenance & Lineage 10 / 10

CNCF Graduated project (open-policy-agent/opa) under Apache-2.0 with enterprise-grade maintenance.

  • CNCF Graduated project under Apache-2.0
Docs & Verifiability 9 / 10

Extensive official docs, Rego playground references, and clear per-subcommand --help.

  • Comprehensive CLI and Rego docs at openpolicyagent.org

Security, Auth & Guardrails

Auth Modes
No Auth Env API Key Config File
Credential Storage

Local policy evaluation requires zero credentials; remote bundle servers use optional bearer tokens configured via OPA config YAML or env vars.

Side Effects
Read-Only Local Write
Cost & Quotas

CNCF graduated Apache-2.0 open-source project; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# opa Agent Rules
- Always pass `--format json` on `opa eval` and `opa test`.
- Run `opa check` before `opa eval` to catch syntax/type errors cleanly.
- Preview `opa fmt -d` before using `opa fmt -w` on policy directories.

Agent-Ready Command Recipes

Safe Read-Only Queries

Evaluate a Rego rule against JSON input
opa eval -d policy/ -i input.json --format json 'data.authz.allow'

Evaluates the query locally and returns structured JSON bindings and decision values.

Run Rego unit tests with JSON report
opa test policy/ --format json

Executes all test_* Rego rules and outputs pass/fail results in JSON.

Controlled Writes & Previews

Format Rego files in place
opa fmt -w policy/

Reformats .rego files deterministically; run opa fmt -d policy/ first to preview diffs.

Strengths for Agents

  • + JSON-native engine with --format json on eval, test, and check.
  • + Zero-risk local policy evaluation with --fail / --fail-defined exit-code controls.
  • + CNCF Graduated single static binary with fast startup.

Caveats & Pitfalls

  • ! Rego syntax has a learning curve for agents writing new policies from scratch.
  • ! opa eval returns exit code 0 even when a policy evaluates to false unless --fail-defined or --fail is passed.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI