Copy this into your coding agent
Paste into Cursor, Codex, Claude Code, or another coding agent in your project.bench.cost.usd, cost is estimated from tokens and labelled ~.
Capture first, evaluate separately
Metadata-only capture is free of evaluation-credit charges. Inputs and outputs are omitted by default. To evaluate real behavior, explicitly enable content capture, supply the span’sinput, and add a project-specific redact function.
In TypeScript, the traced callback result becomes the output. In Python and manual
span APIs, record the result explicitly using the language guide.
Only send data you have permission to process.
Run a check
- Generate a rubric by benching a connected prompt.
- Open a recorded interaction under Production and link it to that prompt if
its span did not already carry
bench.component_idor a matching code location. - In the drawer, choose Check interaction, then confirm the use of one evaluation.
production
environment; the system owner can change the environment or turn them off in the
Production tab. An event is checked at ingest only when all of these hold:
- the span is linked to a prompt, through
bench.component_idor a matching code location; - the event comes from the watched environment (
productionby default); - the SDK captured input and output (metadata-only spans cannot be judged);
- the prompt has a completed bench whose rubric supplies the criteria.
Turn feedback into better benchmarks
Passed checks provide regression examples. Failed checks provide incident cases. Bench uses their recorded inputs and existing criteria. A recorded answer never becomes the expected answer just because the application produced it. Incomplete or uncertain checks do not become passing examples. Run Bench when a check finds a failure is also on by default: a failed check starts a new Bench with the failing interactions as new cases, alongside passing examples from the same environment. Those benches appear in Results and History like manual ones. The owner can turn it off in the Production tab to review failures manually. This is limited to one automatic Bench per system per day, requires available account allowance, and waits while another Bench is running. The previous rubric, business context revision and original cases stay pinned for the comparison. The new Bench compares prompts and models using fixed simulated tool replies. Available recorded tool results preserve the incident’s conditions for that replay. Real app tests are a separate step that runs your actual app to verify effects. Original regression cases stay in the suite; new production examples fit the remaining case allowance, with the triggering failure first. It does not deploy code, publish a pull request, or silently rewrite business policy. Review tool and harness suggestions with real app tests before shipping. You can also save reviewed cases or criteria through the test library.Check a recorded execution
API and MCP callers can explicitly setevidence_scope: "trace" and select the
completed root span. Bench validates one connected, finished tree and includes
its recorded model/tool relationships, inputs, outputs, status and attributes.
Incomplete trees or evidence over 45 KB are rejected, not silently shortened.
The default scope remains span.
This checks the recorded interaction against the linked prompt’s criteria. It does
not run the application again. Calls that were not recorded cannot be checked.
Use real app tests to repeat a scenario with your app.
Delivery and storage
Exports are buffered and bounded, retried once, and dropped if delivery fails. UseonError and bench.stats to monitor drops. In serverless applications,
await bench.flush() in a supported lifecycle hook before the process freezes.
Use shutdown() after in-flight requests finish at process exit, not per request
on a reusable instance. The SDK is not a durable spool.
Bench stores the traces you send. Monitor export errors in your application so you
can tell when an event did not reach Bench. See retention and deletion.
