Agentic Evals
Start here
Did the recorded behavior meet our quality requirements?
What it does
Per-case scores, summary metrics and a separate release-gate decision, grouped by area below. Each area links to its detailed guide; for runnable commands, see the developer guide.
1. Writing evals
- Quick
Eval()APIEval(name, data=..., task=..., scores=...)withCaserows or a data loader- Six lightweight checks:
equals,contains,icontains,levenshtein,matches,numeric_close - Custom score functions returning booleans, numbers or named score dictionaries
- Coloured terminal summary and an inspectable
EvalResult
- Structured suites
TestSuite/TestCasedefinitions in Python, JSON or YAML (load_suite)- Recorded
EvaluationSampleoutputs from JSON or JSONL (load_samples), matched by case ID - Missing samples fail their cases; duplicate or unknown case IDs are errors
- Traces
- Normalized
EvalTrace/EvalSpanmodel: tool calls, attributes, latency, cost and metadata trace_adapter=hook to normalize older or external trace payloads- No dependency on any tracing tool
- Normalized
Guides: Core concepts · Custom data · Existing traces
2. Case expectations
- Output
- Exact or substring output, nested required fields
- Draft 2020-12 JSON Schema validation (no remote schema fetches)
- Tools
- Required and forbidden tools
- Required or exact tool arguments, required tool order
- Budgets
- Maximum latency, cost and turns per case
Guides: All TestCase fields · How scorers compose with expectations
3. Built-in scorers
- Text
exact_match,contains_all,contains_any,starts_with,ends_with,regex_matchlevenshtein_similarity, andembedding_similaritywith your ownembed_fn
- Structured output
valid_jsonandjson_diff(first differing path)
- Numeric
numeric_rangeandnumeric_diff(absolute or relative tolerance)
- Trajectory (tool use)
tool_call_precisionandtool_call_recallno_redundant_tool_callstrajectory_efficiencyagainst a measured baseline latency or cost
Guides: Scorer and rubric catalog
4. LLM-as-judge
- Rubric templates
- Ten ready-made templates:
FACTUALITY,CLOSED_QA,SUMMARY_QUALITY,TRANSLATION,SQL_CORRECTNESS,SECURITY,MODERATION,PII_LEAKAGE,BATTLE,POSSIBLE - Custom criteria and verdict scales with
make_rubric(), optionally with a reference answer
- Ten ready-made templates:
- Running judges
LLMRubricEvaluatorandLLMJudgeEvaluatorwith your own sync or async completion callbackJudgeResponseto report tokens, cost, model and provider
- Reliability
- Bounded retries with backoff (
RetryPolicy) - A judge that fails after its retries gives an explicit unavailable score that never passes
- Repeated judging (
samples=N) with per-case agreement
- Bounded retries with backoff (
- Accounting
- Judge cost, tokens and latency per score, totalled in
summary.judge - Judge cost kept separate from agent cost
- Judge cost, tokens and latency per score, totalled in
Guides: Judge reliability · Judges tutorial
5. Custom evaluators
- Evaluator types
CallableEvaluator,BusinessRuleEvaluator,LLMJudgeEvaluator- Sync or
async defcallbacks (AsyncEvaluator)
- Registries
default_registry()with every built-in scorer, extended throughEvaluatorRegistry.register()- Trusted
--registry module:factoryfor the CLI
- Provenance
- Each score records the evaluator, its type and its version
Guides: Custom evaluators and packs · Custom scorers tutorial
6. Live targets
- Targets
- Trusted Python callables (
PythonTarget) and HTTP endpoints (HTTPTarget) run_live_suite()and the asyncarun_live_suite()
- Trusted Python callables (
- Resilience
- Parallel workers, per-call timeouts and retries
- Timeouts and target errors reported apart from wrong answers (
target_status,summary.live)
- Async evaluation
aevaluate_suite()for recorded samples with async evaluators- Bounded concurrency and cancellation
Guides: Live tutorial · Live target retries and timeouts
7. Reports, costs and breakdowns
- Report contents
- Per-case scores with explanations, evaluator identity and required/skipped state
- Suite summary: pass rate, average score, latency and cost
- Breakdowns by metric and by tag
- Judge and live-target summaries
- Cost honesty
- Unknown cost stays unknown; it is never reported as $0
- Cost provenance per case: measured, estimated or unspecified (
cost_source)
- Formats
- Native JSON, JUnit XML and Markdown
Guides: Scores and reports · Data model tutorial
8. Release gates
- Suite thresholds
- Pass rate, average score and failed-case count
- Average latency and total cost
- Slices
- Stricter pass rates per tag (
min_tag_pass_rate) or per metric (min_metric_pass_rate) - A slice named in the gate but missing from the report fails the gate
- Stricter pass rates per tag (
- Judges
- Unavailable judge scores (zero allowed by default), minimum agreement and judge cost
- Live runs
- Maximum timed-out cases and target-error cases
- Decision
GateDecisionwith pass/fail, reasons and observed values
Guides: Release gates API · CI policy examples
9. Eval packs
- Built-in packs
tool-use-correctness,json-output-contract,factual-qa,adversarial-containment
- Custom packs
- One YAML/JSON file bundling a suite and its required scorers (
load_pack) - Required scorers checked against your registry when the pack loads
- One YAML/JSON file bundling a suite and its required scorers (
Guides: Eval packs
10. Adversarial containment scoring
- Scenarios
- Stop, revoke, denied tool, authority, injected instruction, fail closed
- Evidence
- Authenticated dispatch, denial and acknowledgement records, checked by a host-configured verifier
- Optional AgenticLens verification (
lens_verifier,[integrity]extra)
- Fail closed
- Missing evidence, missing policy versions and bypassed enforcement fail
- The default registry has no trusted verifier and refuses unauthenticated evidence
- Containment is scored separately from task success
Guides: Authenticated containment scoring
11. CLI
- Commands
run: discover and run Python eval filesevaluate: score saved samples against a suitelive: run a suite against a trusted targetgate: apply release thresholds to a saved reportpack list/pack show: browse built-in packsaios export: export AIOS evaluation evidence
- CI
--format json|junit|markdown- Gate exit codes: 0 pass, 1 failed gate, 2 input or usage error
Guides: CLI reference and CI
12. Contracts and interoperability
- Native schemas
- Offline JSON Schemas for the report and gate decision (
report_schema(),gate_decision_schema())
- Offline JSON Schemas for the report and gate decision (
- AIOS evidence
- Map scores and gate results to AIOS
0.4-drafttargets (to_aios_evidence) - Attach them to an existing Run (
attach_aios_evidence)
- Map scores and gate results to AIOS
- Ecosystem
- Report fields that AgenticLens, Control Tower, MCP, Sidecar and Chaos read
Guides: Native report contract · AIOS evidence · Public API
13. Methodology playbooks
- 19 guidance cards (methodology, not runnable code)
- Frame: define an objective, elicit criteria
- Build data: build a dataset, size a suite
- Score: write, choose and validate scorers and rubrics
- Run: instrument a trace, run a live suite
- Experiment: design and analyze experiments
- Investigate: discover failure modes, red-team a suite, debug a flaky judge
- Operate: define a gate, report results, monitor in production, evaluate containment, export AIOS evidence
Guides: Methodology playbooks
What you need
Test cases, actual outputs, normalized traces, and optional judge callbacks.
Start here
Evaluate two recorded answers, then add tool evidence: follow the quickstart.
Limits
- A report is not a release approval; run an explicit gate.
- Tool checks need complete tool evidence in the trace.
- Model judges need your own provider integration; the package ships no model client.
- Containment scoring needs a trusted verifier from the host; it neither enforces runtime behavior nor proves exhaustive capture.
See Limitations.
Documentation
- Developer Guide (simple): short task workflows and a capability index
- API Reference (detailed): exact Python functions, parameters and return values
- AI Readable Documentation: the full reference as one file for AI tools, with source declarations and schemas