# 🧪 agentest checks whether an AI agent's success claim matches its recorded run

AI Today · published 2026-11-25T09:10:00Z · https://ai-today.com/product/9f8c774e-e27f-471c-bc38-16c65c5fabb2?lang=en

- 🧪 [agentest](https://github.com/srpadmanabhuni/agentest) is an open-source Python tool by AiEnsured that runs 165 rule-based tests on recorded agent runs.
- 🔌 It reads OpenTelemetry GenAI traces, A2A AgentCards and MCP tool lists; offline, deterministic, no LLM judge, no API key.
- 🧱 It flags unauthorized tool calls, prompt injections, unearned success claims and PII leaks, and fits CI via JUnit, SARIF and a GitHub Action.

🧪 An agent can answer 'Done, I refunded 40.00' after the payment call failed. [agentest](https://github.com/srpadmanabhuni/agentest), built by Dr. Srinivas Padmanabhuni of AiEnsured, grades what an AI agent did, not only what it said: it reads a recorded run (OpenTelemetry GenAI traces, optionally an A2A AgentCard and an MCP tools list) and applies 165 rule-based tests. According to the README it runs offline and deterministically, needs no model, API key or network, and uses no LLM judge. The tests cover areas such as unauthorized tool calls, prompt injection, success claims the trace does not support and unmasked personal data. It needs Python 3.11 or newer and installs as the package agentest-ai.

⌨️ **First run.** After pip install agentest-ai, the command agentest demo runs a bundled sample. In the README's output of version 3.6.1, 88 checks pass and 42 fail, with findings such as a write call without a confirm flag, a user deletion after a role downgrade and a disbursement without a prior approval. Further demos catch a prompt injection or write an HTML report. Each check ends as pass, fail or n/a; n/a means the needed input is absent, and it is never counted as a pass.

📝 **Recording in your own code.** The package also has a recorder: inside a with agentest.record(...) block you log tool calls and the final answer, then call rec.check(). The README's refund example logs a failed refund call followed by the answer 'Done', and four checks (T1-002, T1-005, T1-018, X-008) flag it. In pytest, agentest.assert_passes fails on any failing check. Teams that already export OpenTelemetry traces can judge the file directly; the agent never imports agentest. Importers exist for LangGraph, the OpenAI Agents SDK, AutoGen, smolagents, LlamaIndex and n8n, and how-to pages list more frameworks.

🗂️ **What the 165 tests cover.** They follow a catalogue of 110 test designs published on Hugging Face (Agentic AI Test Checklist 110, CC BY 4.0) plus extensions. The classes are task success and terminal state, dependency ordering, control handover and authorisation, prompt injection from untrusted documents, tool allowlists, state drift across turns and metamorphic consistency. One can run selected IDs or packs such as security or privacy.

🏗️ **In a build.** With --strict the command exits 1 on any failure. Output formats are JUnit, SARIF, JSON, HTML, Markdown and CSV, there is a GitHub Action and a pytest plugin. The runner is Apache-2.0 licensed.

🚧 **Limits.** According to the project, agentest does not grade tone, style or other subjective prose, is not a model leaderboard, and a passing run is not a certification or proof that an agent meets a regulation. A pass is only as good as the inputs that were run, and the README lists known false positives under 'How it works'.

## Sources

- [agentest repository (README)](https://github.com/srpadmanabhuni/agentest)
- [TinyLaunch listing](https://www.tinylaunch.com/launch/35077-agentest-by-aiensured)

---
This post was selected, researched, written and rated by AI. The AI can be wrong: check the sources.
