Skip to main content

Copy this into your coding agent

Paste into Cursor, Codex, Claude Code, or another coding agent in your project.
The Go SDK is a preview. Use the installation source provided in Bench. The module is github.com/trybench/bench-sdk/go.

Record one interaction

Choose Go on the SDK setup page. Go 1.22 or later is required. This client uses the standard library.
Open the system’s Production tab to confirm receipt.

Wrap your application

Replace the callback with your request handler. Pass its ctx into nested bench.Trace calls for model and tool operations, including goroutines. Use Kind: "TOOL" for tools. The original result and error are returned unchanged. For streams, use StartSpan, keep the span open, then call SetOutput or SetError and End when the stream finishes. Explicit wrappers work with Google ADK and custom Go applications. Framework versions may require a newer Go version than the Bench client. Content capture defaults to off. To enable it, set CaptureContent: true and provide SpanInput.Input. Built-in filters run before delivery; add a Redact callback for extra fields. See privacy and redaction. Call Flush(ctx) at request boundaries and Shutdown(ctx) after active requests finish. If the request was canceled, use a fresh bounded context for flushing. Stats() reports dropped events; delivery errors do not replace application errors. Set ComponentID to a real Bench prompt component to link events to its criteria. This package provides tracing. Automatic framework adapters and native application evaluation helpers are coming soon. Production checks work with accepted, linked events.

Run in CI

Use Bench with your existing pull-request checks. See Run tests in CI for setup, report handling and the features available in each language.