Retrieved article excerpt
Open article · Retrieved 2026-10-29T15:24:29.228229+00:00
Do you even benchmark? How we evaluate agents at scale (with real examples)
Copy page
# Do you even benchmark? How we evaluate agents at scale (with real examples)
- [Alex Lebedev](https://posthog.com/community/profiles/33371)
Oct 28, 2026
- [Inside PostHog](https://posthog.com/blog/inside-posthog),
- [Engineering](https://posthog.com/blog/engineering),
- [AI](https://posthog.com/blog/ai),
- [AI observability](https://posthog.com/blog/ai-observability)
#### Contents
- A. Define the answer key
- Level 1: A list of potential bugs from one PR
- Level 2: A larger, golden set from multiple PRs
- Level 3: Targeted, contextual rubrics
- B. Isolate benchmark runs
- Level 1: Parallel runs with no shared state
- Level 2: Sequential runs with state cleanup
- Level 3: Parallel runs with total isolation
- C. Freeze the environment (a.k.a., offline evals)
- Level 1: Mocked MCP replies
- Level 2: Trajectory-based mocked MCP replies
- Level 3: Restored real-data slices
- Conclusion
We spend 2 trillion+ LLM tokens per month, with the lion's share going to running agents. We know what they do and how good they are *most* of the time, but we spend way too much money on them to trust their output based on vibes alone.
That's why we use benchmarks.
Labs like Anthropic and OpenAI use them to measure, compare, and market new models on release, like the popular [SWE-bench](https://www.swebench.com/), which is designed to evaluate model performance on general coding tasks.
But benchmarks aren't just for frontier labs. They're useful for anyone who wants to understand how well a model, harness, or skill works in their given stack. For example, you might run three different models with the same code review prompt on the same PR to choose the best one based on how many known bugs they catch, how long they take, and what they cost.
The idea is similar to running [controlled experiments](https://posthog.com/product-engineers/ab-testing), but in reality, benchmarking is never that easy. Evaluation is often subjective, behavior is unpredictable, and – perhaps most painful of all – agents love to cheat. They'll search for leaked context, memory, and database query logs to pass benchmark tests with as little work as possible.
In this post, I'll explain how we benchmark our agents at PostHog, what we learned, and where we messed up (so you don't have to) – all with links to real PRs.
---
## A. Define the answer key
If a benchmark is like a standardized test, the first thing you need is an answer key: the list of correct answers you grade your against.
This is the hardest part, in my opinion. If you ask an [LLM judge](https://posthog.com/docs/ai-evals) whether an agent's output is "helpful", you'll get polite, useless praise. Especially if the same model generated it.
For a benchmark to actually be useful, the criteria for what's "good" or not needs to match the complexity they will encounter on the job. Simple yes/no sanity checks won't cut it since agentic tasks are typically more complicated than that.
Here are the three approaches we tried in increasing order of difficulty and complexity.
### Level 1: A list of potential bugs from one PR
Our first approach was to take a task with clear answers and check which agents succeed, versus which ones fail. Each agent had three variables: the model, effort level, and harness.
We did this to evaluate our internal code review agent called ReviewHog, which covers a significant part of PostHog PRs. ReviewHog needs to stay up to date for the best results, so we needed a base benchmark to check against when we change models or prompts.
The best solution we came up with initially was surprisingly effective and simple:
1. First, we took one large PR.
2. Then, we made a "frozen copy" of it.
3. Humans reviewed the frozen PR manually.
4. We then asked several review agents to review it.
5. This produced a pretty exhaustive list of potential bugs from every possible angle.
Review the same frozen PR, collect a list of bugs, change one setting, and compare findings, time, and cost.
So if there were 13 issues worth checking for (structure, performance, security, etc.), we could measure the models on a 0/13 scale, plus compare how much time and money each one cost. Here's an [example report](https://github.com/PostHog/posthog/blob/master/products/review_hog/eval/experiments/2026-08-model-glm53-flash/FINAL_REPORT.md) of us testing ReviewHog this way with GLM 5.3 Flash.
It worked (and still works) well, but it has an obvious limitation: the answer key is based on one single PR for one single change in one single repo. No matter how large that PR is, this approach would never be able to cover all the other types of bugs that could happen in all of our repos.
### Level 2: A larger, golden set from multiple PRs
The second approach we used for benchmarking ReviewHog involved the same method, but across a larger percentage of real cases and with more varied examples.
Getting more PRs was easy; our team produces [10K PRs a month](https://posthog.com/blog/10k-prs-a-month).
But then we had an idea. What if instead of looking for synthetic bugs, we created an answer key by searching for *real* bugs that actually happened? It would be even better if those bugs caused real messes, like proper incidents, since those are exactly the types of things we want these code review agents to prevent.
So that's what we did.
Build a golden set from real incidents, recreate the PRs that introduced the bugs, and evaluate whether reviewers identify their causes.
We looked through old PostHog tickets to create a [golden set](https://posthog.com/docs/ai-evals/datasets) of 33 actual incidents, the PRs that caused them, descriptions of the problem, and the PR that fixed the incident. We analyzed each of them with ReviewHog and other bots to compare their performance, and the results were pretty good:
- ReviewHog found the incident-causing bugs in 62% of the cases
- In 47% of the cases, ReviewHog was the only bot that discovered those bugs, while other bots missed them
- In 9% of the cases, ReviewHog skipped the bug because another bot raised it before ReviewHog started the review, so ReviewHog marked it as "already known"
- In 6% of cases, the bugs were found by other bots, while ReviewHog didn't find them
Table of ReviewHog evaluation results on the incident golden set.
The best combination we got at the time was with `GPT Sol 5.6` at `xhigh` for bug search, and `Claude Opus 5` at `xhigh` for bug validation, both using `pi` as the harness. You can check out our repo for the full [experiment results](https://github.com/PostHog/posthog/tree/master/products/review_hog/eval/experiments/2026-09-incident-golden-set). [1](https://posthog.com/blog/how-to-benchmark-ai-agents#fn-1)
Remember, these benchmarks are specific to *our* use cases. Just because this combination of model, harness, and effort worked well for ReviewHog doesn't mean it will be the optimal choice for another codebase or task. That's the whole point of creating specific benchmarks for your specific stack and tasks.
Overall, there were still some downsides of this "larger golden set" method, but it was still acceptable:
- For 33 incidents, we had to resurrect the 33 PRs that caused them and then analyze the 33 PRs that fixed them. This created lots of noise and triggered false alarms from our GitHub bots.
- We didn't re-add the bugs to the codebase. That would be bad. Instead, we kept them as isolated PRs by properly locking the branch for the agent.
- With open-source repos like ours, an agent with web access can still look up the public repo, merged PRs, and cheat. (More on this later.)
That said – and you probably thought about this, too – this only works because code review tasks are fairly deterministic and relatively easier to grade. The next problem we hit was how to grade agents for more abstract and subjective tasks.
### Level 3: Targeted, contextual rubrics
Benchmarking gets a lot more complicated when you're trying to evaluate agents that can technically do *anything*.
A great example is [Scouts](https://posthog.com/docs/self-driving/scouts), our implementation of scheduled custom agents that let you research *anything*. That could range from your [Product Analytics](https://posthog.com/product-analytics) anomalies in PostHog, to mentions of your brand in social media, to recurring themes in your internal Slack. These tasks are as open-ended as it gets.
Much like how an A-B-C-D format answer key makes sense for grading multi-select quizzes but not for grading an essay, we needed to come up with a different way to evaluate scouts on open-ended tasks.
The obvious answer was rubrics – scoring and evaluation guides that describe the ideal answer, rather than containing the answer itself. But feneric rubrics like "Rate accuracy from 1 to 5" fall apart immediately when evaluating agents. They do a great job of measuring how confident and fluent the model sounds, not whether it did useful work.
Our solution was to build a rubric *generator* that creates guidelines based on the agent's context. We do this in two steps for scouts.
First, all scouts follow the same procedures, even if they work across wildly different domains. So we have one set of static rubrics shared across all scouts that checks whether the scout produced a report covering what it found, how actionable the findings are, and what to do next.
We then also generate rubrics tailored to that specific scout based on context that was been provided to the scout so far, such as:
- The area it covers (e.g. a feature, an external source, etc.)
- Skills and instructions it needs to follow during runs
- Previous runs (e.g. tools it used, reports it generated)
For example, to benchmark a scout analyzing the stability of the [Session Replay](https://posthog.com/session-replay) player, we don't just check its report formatting. We also grade whether it spotted actual playback failure symptoms, queried data correctly, and whether the bug it flagged actually affected real users – criteria specific to Session Replay.
Replay player reliability rubrics
With these rubrics in place, we could reliably track scout success rates across different agent configurations. The v1 of this tailored rubric system allowed us to test against:
| What we test | Question |
| --- | --- |
| Models | Do scouts work better with the new model, or the old one? |
| Thinking effort | Do scouts actually need to think at xhigh levels, if medium does it just fine with 30% fewer tokens? |
| Prompt changes | If we create 5 different versions of the skill, which version works best for each task? |
The result is a report with a close-to-clear answer. It's not 100% deterministic, but it's way better than just "vibes".
Here's an example of a report I ran while writing this blog to check whether Sol or Luna performs better for one of our scouts. The results suggest we should stick with Sol for this one; Luna could do a better job on plenty of other tasks, but to know that, you need something measurable.
Scout benchmark report comparing evaluation results across model configurations.
Scout benchmark report comparing rubrics
If you want to see how our rubric generator and ranking work under the hood, check out our [code](https://github.com/PostHog/posthog/tree/master/products/signals/backend/scout_harness).
So all of those three approaches were just the first step of developing an answer key or grading system for the agents. After defining what's "good", we need to make these tests work and stay objective at scale.
---
## B. Isolate benchmark runs
The surprisingly nasty problem we learned is that when you benchmark multiple models against real data, they'll quickly do everything they can to learn about and piggyback off of each other. They might source answers from [LLM traces](https://posthog.com/docs/ai-observability/traces), DB queries, or any other logs the agentic run