AI agent instructions
AI agent instructions
Trace
See each model call, tool call, and response, with inputs, outputs, latency, and cost. Get keys from Notte, your model provider, and your project in traceroot. If you self-host traceroot, also setTRACEROOT_HOST_URL to your API’s origin. Clone the Notte repository and open examples/traceroot.
- OpenAI Agents SDK
- Claude Agent SDK
- Vercel AI SDK
Use Python 3.11 to 3.13 and uv. Set
NOTTE_API_KEY, OPENAI_API_KEY, and TRACEROOT_API_KEY, then run uv sync --locked and uv run python hn_openai.py.The example turns on tracing with traceroot.initialize(integrations=[Integration.OPENAI_AGENTS]).Keep the Agents SDK’s tracing on: RunConfig(tracing_disabled=True) drops the agent’s spans. traceroot replaces the SDK’s default trace exporter, so the spans go to traceroot instead of OpenAI.hacker_news.top_stories span, groups it under the Notte session ID, and prints the stories and the trace ID. Under that span, each step shows the model call with its tokens and cost, then the Notte tool the agent called, such as browser_action, browser_observe, or browser_scrape, with what the browser returned. Read the trace from your terminal with the traceroot CLI:

Trace of a Vercel AI SDK agent: the model call and Notte tool calls in each step
The Notte key is sent in the MCP connection’s header, which the trace doesn’t record.
Other frameworks
The connection to Notte is the same for every framework, so turn on traceroot’s integration for the one you use:Detect
Define what good behavior looks like. Detectors use LLM judges to flag runs that miss the mark. For a browser agent, a useful check is whether the answer is grounded in what the browser returned. Create a detector from the Hallucination template, set sampling to 100%, and use this prompt:uv run python hn_openai.py --broken. The flag introduces a prompt regression: the instructions tell the agent to skip scraping and answer from memory, so it returns stories that aren’t on Hacker News. The detector records a finding on each of those runs and none on the normal runs of the three examples.
Signals
traceroot groups findings of the same problem into a signal, and the traceroot Agent investigates it. For the prompt regression, the root cause analysis found the cause from the trace alone: the “don’t scrape it: answer from what you know” instruction, browser tools that were listed but never called, and stories taken from the model’s training data. It recommended removing the instruction and requiring abrowser_scrape or browser_observe call before the final answer. Connect GitHub in traceroot’s settings so the agent can also investigate your code and pinpoint the fix down to the commit, file, and line.

The signal for the prompt regression: root cause analysis, and how many traces it affects over time
Verify
Run evals against your datasets and compare versions to measure improvements and catch regressions.hn_eval.py evaluates the OpenAI agent on three Hacker News tasks. Its scorer, backed_by_front_page, checks each returned story’s title against the live front page from the Hacker News API and scores the share that matches. It doesn’t compare points or ranks, which change between the agent’s run and the check; the detector compares points with what the browser returned.
Detectors
Use LLM judges to flag runs that miss the mark.
traceroot Agent
Investigate signals with your GitHub code and open a fix pull request.
Evaluations
Compare versions on your datasets to measure improvements and catch regressions.
CLI
Give your coding agent traces, signals, and detector findings from the terminal.