Copy this into your coding agent
Paste into Cursor, Codex, Claude Code, or another coding agent in your project.Prepare the test suite
Complete your language setup and commit its dependency lockfile. Use the public installation command from your language guide. Keep the same SDK version locally and in CI. For JavaScript and TypeScript, create the cases and application adapter described in real app testing. Keep the same cases, business criteria and test data when comparing a change. Include at least one normal task, one reproduced failure and one previously working behavior. The following ESM script expects yourtests/bench-suite.mjs to export
createBenchSuite(bench). That is your application adapter, not an SDK export.
It returns contextRevision, cases, run, and, when needed, observe and
timeoutMs. Pass the same Bench instance to your instrumented application.
Save as scripts/bench-ci.mjs:
bench.simulateSystem with your session adapter
instead. The report and pass/fail gate have the same shape. A failed check can
still have summary.status: 'completed', so checking that field alone is not enough.
Add a GitHub Actions job
SetBENCH_API_KEY as a repository secret and BENCH_API_BASE_URL as a repository
variable using the values from Bench. The default SDK key is sufficient for tracing
and saving application reports. These operations do not consume Bench evaluations.
Your application’s model calls can still have provider costs.
Save as .github/workflows/bench.yml, alongside your existing tests:
pull_request_target to execute
untrusted PR code with secrets. See GitHub’s secrets documentation.
Python, Go and Rust
Call the native real app test or simulation helper from your existing test runner. Read actual test database or tool state, assert that the report passed, and save the redacted report as a CI artifact. Use the same cases and revisions when comparing a change. Set the client environment toci.
For Python, require
report["summary"]["status"] == "completed" and every case
to have status == "passed". In Go, require report.Passed(); in Rust, require
report.passed(). Check errors returned by the helper before accepting a report.
A failed, cancelled, timed-out or incomplete suite must fail the job.
You can also keep ordinary tracing around existing tests. Flush those traces
before exit and inspect delivery statistics separately from test assertions.
Verify the setup
- Run a correct fixture and confirm the job passes.
- Change one expected outcome and confirm the job fails with a saved report.
- Remove an assertion or force a timeout and confirm incomplete work cannot pass.
- Restore the case, rerun, and inspect the saved report artifact.
ci environment.
