Computer Scientist. Principal Architect at Salesforce AI Applications Platform. ECMA TC39 Member, Former Editor of ECMA402. Yahoo! Alumni & Former YUI Core Team
The security of the whole internet is in jeopardy.
Yet for my SOC2 I have to provide a screenshot of my MFA configuration because having Vanta controls and real time APIs that verify it factually on is not enough 😅
But hey, we will be certified!
You can't make this shit up.
#puracomedia
Putting evals on every AI agent before it goes live is one of the first, highest-leverage things a company should do to become AI-native.
A scorecard is to an AI agent what a P&L is to a business. It's the simplest way to prove to your board that your agents changed something.
Here's what we've learned doing it with clients:
1. Start with a number the business already reports. If nobody tracks it today, nobody will believe your AI number later.
2. Have the person who owns the result define "correct" before anyone builds anything. Otherwise you'll argue about it after.
3. Build a golden set: past cases your best people already signed off on, with the right answers. A real answer key beats a demo every time.
4. Count the time spent checking the agent's work. If it writes a report in ten minutes and someone spends an hour reviewing it, the work just moved to the reviewer.
5. Measure what changes for the person, not just the task. Can the accountant who handles three clients today handle five next year?
6. "Everyone feels faster" isn't a number. If that's all you have after a quarter, you changed the tools and left the work as it was.
We don't put an agent live for a client without one.
ok why the fuck aren't more people talking about this??
The biggest enabler for us to ship hundreds of PRs per day per engineer and stop reading any code was to go all-in on headless e2e tests with digital twins.
When generating software at a faster rate than you can review it, 𝘁𝗵𝗲 𝗯𝗼𝘁𝘁𝗹𝗲𝗻𝗲𝗰𝗸 𝘀𝗵𝗶𝗳𝘁𝘀 𝘁𝗼 𝗽𝗿𝗼𝘃𝗶𝗻𝗴 𝘁𝗵𝗮𝘁 𝗶𝘁 𝘄𝗼𝗿𝗸𝘀.
Headless e2e tests means that you give your agents a way to control the product in a programmatic way without needing to use UI.
Digital Twins are fully functioning mock versions of all the services you integrate with. For us this is Stripe, Slack, Gmail and hundreds more.
We have per test an fastapi web server running, that mirrors all the api routes of all these services. And the app during testing then just swaps the base urls.
𝗨𝗻𝗶𝘁 𝘁𝗲𝘀𝘁𝘀 𝗺𝗼𝘀𝘁𝗹𝘆 𝗯𝗲𝗰𝗮𝗺𝗲 𝘂𝘀𝗲𝗹𝗲𝘀𝘀, current agents are good enough to not get some local logic wrong. They run fast, but they break on every refactor and the agent burns time fixing tests instead of the feature.
Add this to AGENTS.md:
- Never write unit tests after you write code.
- Highly prefer E2E tests as the sole testing mechanism. Use them to verify complex features work. At the end of E2E tests, produce a verifiable and repeatable artifact.
The biggest enabler for us to ship hundreds of PRs per day per engineer and stop reading any code was to go all-in on headless e2e tests with digital twins.
Unit tests mostly became useless, current agents are good enough to not get some local logic wrong.
But if your tests test only user level behavior in a deterministic and fully realistic environment, you can make it very difficult for your agents to ever break anything in production.
Headless e2e tests means that you give your agents a way to control the product in a programmatic way without needing to use UI. You still need a lot of additional tests with UI, but these are typically slower, and much more flaky.
Digital Twins are fully functioning mock versions of all the services you integrate with. For us this is Stripe, Slack, Gmail and hundreds more. We have per test an fastapi web server running, that mirrors all the api routes of all these services. i.e /slack/messages/… And the app during testing then just swaps the base urls.
They get seeded with the initial state the test needs and are fully statefull (i.e if you send a slack message to it, it will later be visible in the search endpoint). This means we never have to worry about a flaky google oauth process in tests or about difficult to test race conditions with stripe.
It’s honestly now very easy to build all this in a day and instantly make it very difficult to break anything. Just give above as prompt to your agents.
one complication (or trap) with letting an agent work through software failures is that sometimes its conclusion will be that the test is wrong, and sometimes it will be right. I think any serious development process using agents has to deal with that without making it easy to redefine success every time the implementation struggles.
suppose a test expects an event after a user saves a record. the agent finds that the record is persisted correctly but the event never appears. perhaps the product has a real integration defect. perhaps that event was an internal detail that no longer belongs to the supported behavior. perhaps the observer attached too late. those explanations can produce a similar red result, but they require very different changes.
if the agent can change the implementation, the expected answer, and the observer during the same experiment, a green result becomes difficult to interpret. we may have repaired the product, corrected the test, or simply removed the evidence of the failure. even an honest correction changes what the comparison means.
this is why I suggest having a clear boundary between improving the implementation and improving our definition of success (scenarios for evidence). during a repair, the scenarios and the way we judge them stay fixed. if the agent finds evidence that the test is wrong, it should preserve the failure and propose that correction for review. once we accept the correction, we version the evaluation and measure the relevant baseline and candidate again.
I would start with something quite simple: record which tests, fixtures, observers, and scoring rules were used for the comparison, and make changes to those visible separately from the repair (outer loop changes the scenarios while inner loop changes the code). tests need to evolve as we learn, but I want to be able to explain whether a result improved because the software got better or because we corrected the instrument measuring it.
for #hillclimbing as a way to drive implementation, the part I want to spend more time on is where the scenarios come from. an agent can keep improving against the tests we give it, but if an important customer behavior never makes it into those tests, the loop has no reliable reason to work on it. we can spend a lot of effort making the existing score look better while leaving that problem untouched.
imagine a payment workflow whose tests all pass, then a customer reports being charged twice after retrying a request that timed out. before asking an agent to repair it, we need to understand what happened and define the expected behavior under that condition. can we recreate the timeout, repeat the request, and independently check how many charges were created? once that becomes a reviewed, repeatable scenario, the implementation agent has a concrete failure to investigate and a way to check whether its change helped.
this is the ongoing work that has to feed the hill climbing. documentation gives us ordinary supported workflows, historical bugs give us difficult conditions, and customer experience and telemetry expose assumptions we did not know we were making. models can help analyze that material and propose scenarios, but someone who understands the product still has to review whether the expected outcome is correct and whether the test actually observes it.
I think platform teams can make a substantial contribution here by providing access to the relevant evidence, environments where those conditions can be reproduced, and a way for product teams to maintain and run their growing collection of scenarios. when an incident is closed, I want the behavior it exposed to remain available to the next implementation cycle, rather than disappear from the evaluation flow.
following up on platform teams, I think one of the biggest changes is going to be how implementation work gets driven. the approach I am exploring puts hill climbing near the center of coding: define the behavior we need, measure where the current implementation falls short, let an agent investigate and propose a change, then run the same evaluation against the candidate and decide whether it helped. that evidence drives the next implementation decision.
Claude's #hillclimbing workflow is a useful starting point for this kind of iteration, but the enterprise problem extends well beyond having an agent rerun an eval command. a change may span services, depend on particular permissions and data, and need a platform build before it can be measured in a realistic environment. someone has to make that environment available, establish the initial conditions, collect the evidence, and verify that the candidate code actually ran. writing the patch can be the easy part of that cycle.
then there is the question of what feeds the hill climbing. the scenarios cannot come only from whatever tests the implementation agent happens to write. documentation, historical failures, customer experience, telemetry, and operational evidence all help us discover what the product must do and where our existing expectations are incomplete. turning that knowledge into reviewed, measurable scenarios is another ongoing process, and changing those expectations needs to remain visible separately from improving the code against them.
this is where I see substantial work for platform teams. they can provide the environment lifecycle, access to the relevant data, repeatable execution, telemetry collection, evidence storage, and delivery mechanisms that let a product team keep this cycle moving. the product team still owns the outcomes and the consequences of its changes, but it should not have to construct an entire evaluation and delivery infrastructure before it can work this way.
I have been thinking about what coding agents mean for enterprise platform teams, and I think the model many of us grew up with is not going to survive much longer. we put some of our strongest engineers in a central team, ask them to build the foundations for everyone else, and then organize a considerable amount of product development around waiting for that team to make the next capability available.
there were good reasons for doing this. building reliable shared software was expensive, consistency mattered, and having every feature team invent its own infrastructure created problems that the company would eventually have to operate. but reuse also came with a queue, and being told that something was on the platform roadmap could mean that your product roadmap was now waiting too.
as teams become able to build more complex software with agents, that waiting to become much harder to justify. the shared component may still be a choice, especially when operating it is difficult, but a team with a credible way to build and verify what it needs has another option. a platform whose main advantage is that it has the engineers capable of writing the code will have to find a stronger reason for everyone else to depend on it.
the opportunity I see is in providing the infrastructure that makes that independence work. teams still need realistic environments, controlled access to services and data, repeatable ways to evaluate behavior, evidence about what actually ran, and a path to production with clear ownership and recovery. they also need a way to bring what they learn from production back into the next development cycle. making those capabilities available without a new negotiation every time is substantial engineering work.
Today, we’re open-sourcing SPACE, the project I started after joining Perplexity. I’ve had the honor of leading it with a dedicated team of engineers, supported by brilliant colleagues and leaders.
I chose to work on AI because I believe safety is an engineering problem. Careful design, ambitious architecture, and high-quality craft enable us to build safer products. SPACE is the first component of our agentic runtime platform.
We’re sharing it so more teams can build safer products at scale. I’m proud of what we’ve built together and grateful to everyone involved. Excited for what’s next for SPACE and Perplexity Platform.
https://t.co/p5IasVx1QN
another thing I see in #agent#evaluation is a lot of attention on the exact path the agent took (agent trajectory), almost as if there is one correct sequence of tool calls and every other path should fail. most of the time that is testing the implementation we expected instead of the outcome the user needed.
for many real world tasks, the first question is whether the agent produced the right result. two runs can use different tools, call them in a different order, and still complete the task correctly. forcing one expected trajectory can reject completely valid behavior, and it becomes brittle every time the model learns a better way to reach the same outcome.
that does not mean the trajectory is unimportant. we need it to explain the result, catch claims that are not supported by what happened, understand how tools were used, and enforce the path requirements that are actually part of the product. if one operation really has to happen before another, or a specific action is itself part of success, then the task should say that explicitly.
I think the outcome should normally be primary, with only the trajectory constraints we can explain as real requirements, because otherwise an implementation preference slowly becomes the definition of correct product behavior.
a few more thoughts about #agentic#evals. another problem I keep running into is how we decide what we are actually paying to evaluate. I see many projects begin with the artifact they just built. they built a skill, so they create an eval for the skill, run it a few times, and eventually attach some quality number to it. it is a natural place to start, but I think it starts one layer too low.
a skill does not produce useful behavior by itself. the result also depends on the task, the model, the tools, the agent scaffold, the environment, and sometimes on the agent deciding that the skill is not needed at all. if all of that gets compressed into one number stored on the skill, the number looks precise, but it is difficult to say what it means.
what makes more sense to me is defining the complete real-world task first, including what starts it, which initial conditions exist, what outcome we expect, and what success means, then running that same task against different versions of the system. one version can include the skill, another can leave it out, and everything else can remain as similar as possible.
the thing I care about following over time is whether the system can complete the task, under which conditions, and with what reliability. the skill still matters, but more as one possible explanation for why the behavior changed than as the thing carrying a quality score of its own.
one word that has created a surprising amount of confusion when trying to run #agent#evaluation on some projects is the word "configuration". we put the model, prompt, skills, tasks, number of trials, retries, concurrency, credentials, environment setup, runner, and sometimes the judge into one configuration object, and later we cannot explain whether a result changed because the agent changed, the way we measured it changed, or the infrastructure changed.
I think there are at least three different things hiding in there. one describes what we are measuring and how the evidence becomes a result. another describes the actual system being measured, including the model, prompt, skills, tools, and scaffold. the third describes how the cloud environment is going to run both of them, including provisioning, credentials, retries, concurrency, evidence capture, and cleanup.
this is not only an argument about terminology. if I change the rubric, I changed the measurement. if I change the model, I changed the system. if I run the exact same system in a different kind of environment, I changed how it was executed. those changes mean different things when we compare results or try to reproduce and reuse them.
configuration is a convenient word when the system is small, but it becomes a junk drawer very quickly, and once everything is inside that drawer it becomes hard to say what actually changed. my recommendation is to give these three things separate identities, version them independently, and make the comparison layer expose the difference. before calling two runs comparable, we should be able to say whether the evaluation definition, the system being evaluated, or the execution environment changed.
another thing that comes to mind when I look at small #agent#evaluation examples is how often they hide the cost of recreating enough of the real product for the result to mean something. if the agent uses tools from an MCP server, reads product data, and can mutate that data while completing the task, we are no longer evaluating a prompt and a response in isolation.
every trial needs a known initial state and enough isolation that one run does not hand the answer, or the damage, to the next one. we need to observe the tool calls, capture the mutation, validate the resulting state, preserve the evidence, and either clean everything up or create another isolated environment before repeating the task. if we mock too much, the evaluation becomes cheaper but may stop representing the product we care about.
the good news is that this is not an entirely new discipline. performance engineers have been creating representative workloads, controlling initial conditions, separating product behavior from infrastructure noise, measuring variance, instrumenting dependencies, and figuring out what expensive setup can be reused, and for how long, without invalidating the measurement. agentic eval adds a stochastic model, semantic judging, and tools that can make decisions and mutate state, but much of the old performance engineering stack and, more importantly, its discipline should carry forward.
so the cost is not only model tokens, and it is not only the judge. it includes provisioning, external I/O, rate limits, state capture, reset, cleanup, and the capacity required to keep many independent experiments running. a small application can ignore much of this and get a lot of value from a simple eval loop. for a real #enterprise product, this environment lifecycle may be one of the hardest and most expensive parts of evaluation.
I think this is also going to create a very interesting space for performance engineers. many teams entering agentic evaluation are going to rediscover problems that this discipline already knows how to reason about, and the people who understand how to build trustworthy experiments around complex systems may become as important as the people writing the prompts and graders.
so far, my experience is that the agentic portion of the flow, the actual execution of the agent we are trying to evaluate, is the bottleneck in both cost and elapsed time, not the product infrastructure it talks to. I do not take that as evidence that the infrastructure does not matter, though. as we increase the number of tasks, repetitions, isolated environments, and parallel runs, I expect many of those familiar performance engineering problems to become visible very quickly.
the new #Claude eval and hillclimbing (https://t.co/PaWCUiCNLH) workflow is very interesting because it makes evaluation and optimization available to many more people, but I think the cost can be easy to underestimate when we look at relatively small examples.
the expensive part is not only creating the data set or judging the final answer. for every candidate change, the agent has to run again with its prompt and context, execute tools, produce evidence, and repeat enough trials to separate a real improvement from normal variation. then the #hillclimber makes another change and the multiplication starts again. with a large product and a meaningful task population, candidates times tasks times trials can become a very large number of complete agent executions.
after reading the current implementation, I think Claude already has some of the right pieces. it measures the noise floor, asks for a plateau rule, estimates the cost of the planned rounds, and can stop iterating when several changes fail to move the score outside that noise. those are meaningful controls, but the default is still to run the full #eval for every round, and the budget is treated as a guide that can be extended when the score is still moving.
for me, knowing when to stop is one of the most important parts of the hillclimbing loop, and a plateau is only one reason to stop. before paying for the next stage, I also want to know whether the candidate has enough remaining headroom to produce a measurable improvement, whether the evidence collected so far makes that improvement plausible, and whether proving it is worth more than the next round will cost. sometimes the correct outcome is not another experiment, it is that this particular idea has exhausted the evidence budget we were willing to spend on it.
this is where I think progressive evaluation starts looking essential for hillclimbing, not simply like a faster way to report failures. run a small number of complete tasks that are directly relevant to the proposed change, then the important product scenarios, and only then the long tail, with an explicit promotion rule between stages. weak candidates should disappear before consuming the full evaluation budget, while the few that survive still have to earn the broader coverage and repeated trials needed for a real claim.
this does not make statistically meaningful evaluation cheap. it avoids paying the maximum price for every small idea the optimization agent wants to try, which may be what makes the loop realistic for a complex product.
speaking of agent evaluation cost, systems like TypeSafe's #Jev are very interesting to me because using a large generative model to answer every bounded evaluation question is obviously wasteful. if the answer can be represented as a choice, a score, or a probability, a much cheaper decision model can reduce a meaningful part of the judging cost, assuming we have done the work to calibrate it against evidence we trust.
but I don't think that is going to make agentic evals considerably cheaper. before there is anything to judge, we still have to run the agent. the main model consumes tokens, tools execute, environments have to be prepared, external systems are touched, evidence is captured, and when reliability matters we have to do much of that multiple times. so yes, cheaper judges are going to matter quite a bit, but the agent still has to do the expensive work we are trying to measure.
Claude can now help you build evaluations and hillclimb on them.
In this article, we share guidance on eval design & skills that Claude Code can use to improve your applications.
https://t.co/PgKFC2DWth
once we accept that agentic evals are expensive, one very practical question is why we try to run everything from the beginning. launching every scenario with the maximum number of trials and the most expensive judge before looking at any early evidence is certainly exhaustive, but it can also spend most of the budget proving something the first few results already made obvious.
my colleague Gonzalo Cordero came up with the term "progressive evaluation". first reject inputs that are invalid and environments that cannot work. then run a small number of complete tasks that are likely to surface a problem early, not pieces of tasks that prove something else. if those fail badly, there may be no reason to launch the much larger run. if they pass, we continue with broader coverage, more trials, comparisons, and the semantic judging that is still needed.
the part that matters is not pretending the early layer proved more than it did. #ProgressiveEvals save a lot on the failing path, but the green path still has to earn the coverage and statistical confidence needed for the final decision. essentially, there is a lot of cost hiding in selection, ordering, and knowing when to stop, not only in making each model call a little cheaper.
the conclusion I have reached after spending a lot of time on agentic #evals is that if I want to know whether an agent can complete a real world task, I have to run something reasonably close to the real agent, with its model, tools, environment, and side effects, more than once, then capture enough evidence to judge what happened. but that can become a black hole eating tokens and infrastructure very quickly.
the mistake is assuming that rigor means running the largest evaluation we can afford at every possible opportunity. for me, an evaluation is an evidence purchase, and before paying for it I want to know which decision the evidence can change, whether that is blocking a merge, supporting a release, triggering a rollback, justifying an investment, or finding where the system is becoming unreliable. if the answer will not change anything, the run may still produce numbers, but those numbers have very little value.
this changes the design question from how often can we run the eval to how much uncertainty do we need to remove before making this particular decision. a small code change may need a narrow and inexpensive signal. a release that exposes a high-consequence workflow may justify broader coverage and enough repeated trials to estimate reliability. a periodic optimization process can spend more because it is trying to discover patterns that something like a pull request cannot reveal.
I still think extensive agent evaluation is going to be needed and in some cases critical, but not indiscriminate evaluation. I think a more sustainable system is one that treats evidence as a budget, spends it where uncertainty and consequence are high.