Golden trace regression evaluation for tool-using AI agents
Project description
agent-trace-eval
Golden trace regression evaluation for tool-using AI agents.
agent-trace-eval checks agent execution traces against declarative expectations for:
- tool selection (required / forbidden tools)
- tool-call arguments
- tool-call ordering
- multi-agent handoffs
- recovery decisions (retry / fallback / escalate)
It is designed as a small, employer-neutral library you can use in CI to gate agent workflow changes.
Install
pip install agent-trace-eval
For local development:
pip install -e ".[dev]"
Quick start
Run the bundled examples:
agent-trace-eval \
--cases examples/cases \
--traces-dir examples/traces \
--report reports/example-report.md
Trace format
Traces are JSON or YAML documents with an events list. Supported event types include:
tool_callhandoffrecovery_decisionfinal_answer
Example:
{
"case_id": "refund_lookup",
"events": [
{
"type": "tool_call",
"name": "lookup_order",
"arguments": { "order_id": "12345" }
},
{
"type": "tool_call",
"name": "issue_refund",
"arguments": { "order_id": "12345" }
}
]
}
Case format
Cases are YAML or JSON files with id, description, input, and expect sections:
id: refund_lookup
description: Agent should look up an order before issuing a refund.
expect:
tools:
required: [lookup_order, issue_refund]
forbidden: [delete_account]
ordering:
before:
- first: lookup_order
second: issue_refund
arguments:
issue_refund:
order_id: "12345"
Python API
from agent_trace_eval import RegressionRunner, render_markdown_report
from agent_trace_eval.loader import load_case, load_trace
from agent_trace_eval.result import SuiteResult
case = load_case("examples/cases/refund_lookup.yaml")
trace = load_trace("examples/traces/refund_lookup.json")
runner = RegressionRunner()
result = runner.run_case(case, trace)
report = render_markdown_report(SuiteResult(case_results=[result]))
print(report)
Related writing
This project complements a series on agent regression testing and release gates:
Development
pytest
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_trace_eval-0.1.0.tar.gz.
File metadata
- Download URL: agent_trace_eval-0.1.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10f3a43b1c3f647e9894fb084013ffe0fd06aaceb4b857fb8baa95368e00201c
|
|
| MD5 |
04e1c88569b6e99e20e4060e342e2bfd
|
|
| BLAKE2b-256 |
a9acadf49cda1437a549434ef0df6733c5c83e953ed810e29a000c7c4747ddd7
|
Provenance
The following attestation bundles were made for agent_trace_eval-0.1.0.tar.gz:
Publisher:
publish.yml on yfccyf/agent-trace-eval
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_trace_eval-0.1.0.tar.gz -
Subject digest:
10f3a43b1c3f647e9894fb084013ffe0fd06aaceb4b857fb8baa95368e00201c - Sigstore transparency entry: 1781421788
- Sigstore integration time:
-
Permalink:
yfccyf/agent-trace-eval@525f068fcb91b87c4ea2ce8de75acffb13edf9d4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/yfccyf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@525f068fcb91b87c4ea2ce8de75acffb13edf9d4 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file agent_trace_eval-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agent_trace_eval-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f15fd04fde935e39e16f4d6950c0ad3bd82d20afaf9cde6e85c95b51fe706e69
|
|
| MD5 |
05b19aa01ca311e7312452ab5c70ca75
|
|
| BLAKE2b-256 |
0be15140db5776a4ead7cb795b3f1d5c4fcb8c4035905c57c196f70919e9a836
|
Provenance
The following attestation bundles were made for agent_trace_eval-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on yfccyf/agent-trace-eval
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_trace_eval-0.1.0-py3-none-any.whl -
Subject digest:
f15fd04fde935e39e16f4d6950c0ad3bd82d20afaf9cde6e85c95b51fe706e69 - Sigstore transparency entry: 1781421869
- Sigstore integration time:
-
Permalink:
yfccyf/agent-trace-eval@525f068fcb91b87c4ea2ce8de75acffb13edf9d4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/yfccyf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@525f068fcb91b87c4ea2ce8de75acffb13edf9d4 -
Trigger Event:
workflow_dispatch
-
Statement type: