Skip to main content

Golden trace regression evaluation for tool-using AI agents

Project description

agent-trace-eval

CI PyPI License: MIT

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_call
  • handoff
  • recovery_decision
  • final_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_trace_eval-0.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_trace_eval-0.1.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

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

Hashes for agent_trace_eval-0.1.0.tar.gz
Algorithm Hash digest
SHA256 10f3a43b1c3f647e9894fb084013ffe0fd06aaceb4b857fb8baa95368e00201c
MD5 04e1c88569b6e99e20e4060e342e2bfd
BLAKE2b-256 a9acadf49cda1437a549434ef0df6733c5c83e953ed810e29a000c7c4747ddd7

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_trace_eval-0.1.0.tar.gz:

Publisher: publish.yml on yfccyf/agent-trace-eval

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agent_trace_eval-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_trace_eval-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f15fd04fde935e39e16f4d6950c0ad3bd82d20afaf9cde6e85c95b51fe706e69
MD5 05b19aa01ca311e7312452ab5c70ca75
BLAKE2b-256 0be15140db5776a4ead7cb795b3f1d5c4fcb8c4035905c57c196f70919e9a836

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page