Tarn is a CLI-centric API testing tool written in Rust. Its test files use the .tarn.yaml format, and its output is structured JSON containing categorized failure information (failure_category, error_code) as well as the failing request/response, along with suggested fixes. This enables AI agents (such as Claude Code, Codex, opencode, Cursor, Windsurf, pi, etc.) to write tests, run them, read the failure reasons, and fix them directly, without parsing logs.
Main capabilities:
- Structured failures: each failure carries a stable category, error code, and fix hint, and agents branch on the category rather than doing regex matching.
- MCP-native support: exposes structured tools such as list, validate, run, and fix_plan through tarn-mcp, supporting a variety of AI agents.
- YAML tests: uses a YAML format already known to models, with no need to learn a DSL or set up a test framework.
- Single static binary: installable via curl | sh, with no runtime dependencies, and easy to drop into any CI image.
- Built-in features: supports REST and GraphQL, captures, cookies, multipart forms, includes, polling, Lua scripting, parallel execution, and 7 output formats.
Usage:
- Installation: prebuilt binaries are provided for macOS (Intel + Apple Silicon), Linux (amd64 + arm64), and Windows (amd64 zip), with checksums for SHA-256 verification. The installer also deploys tarn-mcp and tarn-lsp. The installation directory can be specified by setting TARN_INSTALL_DIR. The container image path is ghcr.io/<owner>/tarn:<tag>.
- Quick start: test files use the .tarn.yaml extension and can be organized in any directory structure. setup and teardown blocks are supported, as are step definitions. Request methods support standard verbs and custom tokens (such as PURGE, PROPFIND). The request body can be inline YAML (automatically serialized to JSON and with Content-Type set) or referenced from a file (body_file), with template interpolation supported.
- Debugging failures: the tarn failures command groups by root cause, tarn inspect supports run ID aliases (last/latest/@latest/prev), tarn rerun --failed reruns failed tests, and tarn diff prev last compares failure fingerprints.
- Local demo: provides demo scenarios with no external network dependency, covering redirects, cookies, forms, error responses, authenticated CRUD, and more.
Use cases:
- AI-assisted API testing workflows: agents can write, run, read failures, and fix tests, forming a closed loop.
- CI/CD integration: the static binary is easy to embed in CI images, and the structured output facilitates automated processing.
- Testing environments that need structured failure information: makes it easy for agents or humans to quickly locate problems without reading a full report.
Limitations:
- No information is currently provided about fees, pricing, platforms, or specific results.
- --cookie-jar currently supports only sequential execution; combining it with --parallel requires waiting for deterministic jar sharing.
- Command steps (command:) are not executed by default and must be explicitly enabled via the CLI flag --allow-exec, the project configuration allow_exec: true, or an MCP parameter; otherwise they are marked as skipped_by_policy.
- Subprocess environment variables are cleaned by default, passing only basic variables such as PATH, HOME, and TMPDIR, and must be explicitly forwarded via pass_env.
- capture for command steps supports only stdout_regex and exit_code, and assert and poll are rejected on command steps.
- For more details, refer to the documentation site and the in-repository docs (such as docs/AI_WORKFLOW_DEMO.md, docs/MCP_WORKFLOW.md, etc.).