Multi-Agent Testing
A multi-agent trace is a tree: a parent agent’s trace contains its children’s traces. This lets a test check a delegation or a tool call anywhere in the tree, instead of looking only at the final reply. Trace-tree checks are deterministic layer-3 assertions; multi-agent tracing is beta.
This complete pytest example records a child agent without calling a model:
from attest import agent, delegate, expect
@agent("support")def support(builder): with delegate("billing") as child: child.set_output(message="Refund approved.") return {"message": "Refund approved."}
def test_delegates_to_billing(attest): attest.evaluate(expect(support()).agent_called("billing"))Install with uv add "attest-ai>=1.1.0" pytest, save as test_support.py and run uv run pytest.
The SDK multi-agent guide explains delegate(), TraceTree, parent-child relationships, ordering, cross-agent data flow and aggregate metrics. The behavior-contract guide covers per-key tool rules across an agent tree.