agentest is an open-source testing and evaluation platform for AI agents, with the core goal of verifying what an agent "actually did," not just what it "said." Created by Dr. Srinivas Padmanabhuni of AiEnsured, it uses an offline, deterministic rule-based testing approach and does not depend on LLM judges, API keys, or the network.
Purpose: agentest is used to automatically evaluate the execution traces of AI agents. Typical scenarios include: checking whether an agent called unauthorized tools, whether it called tools in the correct order, whether it claimed success without actually performing the operation, whether it was affected by prompt injection, whether it leaked PII, and so on. It is suitable for developers testing locally, integrating into pytest, or using as a quality gate in CI pipelines.
Key capabilities:
- Built-in 165 rule-based tests covering multiple categories such as security, privacy, and functionality.
- Reads OpenTelemetry GenAI trace records (OTLP/JSON), with support for A2A AgentCards and MCP tool lists as optional inputs.
- Provides agentest.record() for recording agent runs in-process and judging them directly.
- Provides a pytest plugin (bundled with the package) that can assert specified checks pass via agentest.assert_checks().
- Supports --strict mode, where the command exits with code 1 when any check fails, facilitating CI gating.
- Output formats include JUnit, SARIF, JSON, HTML, Markdown, and CSV.
- Built-in importers can read native logs from frameworks such as LangGraph, OpenAI Agents SDK, AutoGen, smolagents, LlamaIndex, and n8n.
- Provides a GitHub Action to automatically run checks on every pull request.
Usage:
- Install: pip install agentest-ai (requires Python 3.11 or higher).
- Quick start: run agentest demo to get your first evaluation result with no other configuration.
- Evaluate existing traces: use agentest std run --otlp <trace file> to directly evaluate OpenTelemetry trace files, optionally pass an MCP tool list via --tools and an A2A AgentCard via --card.
- Use in pytest: mark tests and specify the trace file and the checks that must pass; on failure, the specific check and evidence are pointed out.
- Use in CI: install the package, judge the trace, and pass --strict so the job exits 1 when a check fails; the agentest GitHub Action can also be used.
- Record and judge your own agent: use agentest.record() to record a run, then call rec.check() or agentest.assert_checks() to judge it.
Use cases:
- Automated testing and regression checks during AI agent development.
- Security assessment, such as prompt injection detection and unauthorized tool call detection.
- Privacy compliance checks, such as PII leakage detection.
- Quality gates in CI/CD pipelines.
- Offline analysis of exported OpenTelemetry GenAI traces.
Limitations:
- agentest does not evaluate the tone, style, or other subjective text quality of creative writing.
- It is not a model leaderboard; passing the tests does not represent certification or regulatory compliance.
- It does not start or host MCP servers; users need to provide MCP tools/list JSON and A2A AgentCard files; when files are missing, the related checks are reported as n/a.
- Judgment results are divided into pass, fail, and n/a; n/a means there is no signal to judge and is not counted as a pass.
- It relies only on PyYAML as a required runtime dependency, but requires Python 3.11 or later.
- For frameworks without a built-in importer, traces must first be converted to the OpenTelemetry trace format.
License and citation: The runner is licensed under Apache-2.0, and the checklist data is licensed under CC BY 4.0. It can be cited via DOI 10.5281/zenodo.23597877.