# Repository Briefing: srpadmanabhuni/agentest
> Source: https://repoforai.com/repo/srpadmanabhuni/agentest (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/srpadmanabhuni/agentest
- **Official Docs / Website**: https://srpadmanabhuni.github.io/agentest/
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: A+ (92/100 · Maintenance 35/35 · Adoption 17/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v3.8.0 (2026-11-26) — https://github.com/srpadmanabhuni/agentest/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: Docker, CLI
- **Momentum**: 60 ★ total (+1 24h / +13 7d) · 53 forks
- **Topics**: `agentic-ai`, `ai-agents`, `ai-evaluation`, `responsible-ai`, `mcp`, `opentelemetry`, `agent-testing`, `llm-testing`, `prompt-injection`, `a2a`, `llm-evaluation`, `opentelemetry-genai`
- **When to Use**: Best for: Teams with recorded tool-using agent runs that want reproducible pytest or CI gates for task completion, approvals, and tool policy. Skip if: You need a live agent runner, have no reliable trace instrumentation, or primarily need to judge open-ended response quality.

## Overview
```text
### Architecture & Core Mechanics
agentest evaluates recorded runs rather than orchestrating agents. Its Python CLI accepts OpenTelemetry GenAI traces as OTLP/JSON or JSONL, or converts saved framework logs via `std import`. In Python, `agentest.record()` captures tool calls, results, and the final reply for checks in the same process. The scorer applies rules to that evidence and returns `pass`, `fail`, or `n/a` without re-executing the agent.

The optional MCP `tools/list` JSON and A2A AgentCard supply declared context to the rules; neither is a live protocol connection. The pytest plugin is bundled with `agentest-ai`, and PyYAML (`>=6.0,<7`) is the sole required runtime dependency. This separates application instrumentation from evaluation: a CI runner can score exported artifacts without installing the agent framework that produced them.

### Key Capabilities & Differentiators
The 165-check catalog covers issues such as unsupported completion claims, tool allowlist violations, missing approvals, retry storms, prompt-injection effects, and PII leaks. In bundled sample `a22`, the reply says a charger was added to the cart, but the recorded run contains no `add_to_cart` call; T1-018 flags the unsupported claim. The catalog size is not the number of checks that will run or apply to every trace.

Built-in import dialects include `langgraph_msgs`, `openai_agents`, `autogen`, `smolagents`, and `n8n`. Other integrations take different paths: CrewAI, for example, can use OpenTelemetry export or the generic `steps` dialect rather than a dedicated CrewAI dialect. Reports include Markdown for inspection and JUnit or SARIF for automation; pytest assertions let teams require specific check IDs to pass.

### Trade-offs & Limitations
Compared with response-only LLM judges, fixed rules make instrumented behavior easier to audit and regression-test: the same trace produces the same verdicts, with evidence for findings. The rules are not a substitute for semantic evaluation or live end-to-end tests. They cannot recover tool outcomes or state changes that were never logged, and a passing trace does not establish that the same behavior will hold on future runs.

The main adoption cost is getting traces and declarations into a shape that the selected rules can use. Ubiquitous `n/a` results can make a green pipeline misleading: `--strict` exits 1 on `fail`, not on missing coverage. Use named assertions for requirements that must pass, and review which checks actually apply. Apache-2.0 permits commercial use, but offline scoring does not remove the need to protect potentially sensitive trace artifacts.

### Hardware & Deployment Guide
Install on Python 3.11+ with `pip install agentest-ai`; both the import and CLI are named `agentest`. Start with `agentest demo`, then test a local artifact with `agentest std run --otlp traces.otlp.jsonl --format junit --out agentest.xml --strict`. Scoring needs no API key, model, or network; fetching installation packages and generating fresh traces are separate steps.

The Dockerfile builds from `python:3.12-slim`, installs the package from the checkout, and runs as a non-root user. Build locally with `docker build -t agentest .`; no registry image is published. The 3.8.0 release adds named pytest check assertions and a pinned OpenTelemetry GenAI compatibility matrix. The 3.7.0 release adds the opt-in alert-timing check NT-038 and a recorded refund-retry example.
```

## Key Capabilities
```text
- Trace ingestion: `std run --otlp` reads OpenTelemetry GenAI OTLP/JSON or JSONL; `std import` converts recorded framework logs.
- Protocol context: `--tools` accepts MCP `tools/list` JSON; `--card` accepts an A2A AgentCard. Neither requires a live endpoint.
- Rule coverage: 165 checks in the full catalog; the bundled default demo runs 130. Checks can return `n/a` when required evidence is missing.
- Trace assertions: `agentest.record()` captures calls, results, and replies in-process; `agentest.assert_checks()` names the failing check and its evidence.
- CI integration: `--strict` exits 1 on a `fail`; JUnit and SARIF are available for machine-readable reporting.
- Container runtime: The locally built image uses `python:3.12-slim`, runs as a non-root user, and uses `agentest` as its entrypoint.
```

## Quick Start / Clone
```bash
pip install agentest-ai
```
