AI agent evaluation after the evals pass
AI agent evaluation mostly ends at release. In production, rank live runs by rarity and stop bad tool calls with rules checked before they run.
AI agent evaluation mostly ends at release. In production, rank live runs by rarity and stop bad tool calls with rules checked before they run.
Most AI agent evaluation happens before release. A team runs the agent over a test set and ships if an LLM judge or a reviewer passes enough of the cases. In LangChain's State of Agent Engineering survey, just over half of respondents ran offline evals on test sets and over a third ran online evals on live traffic. Both grade a tool call after it has already run. Amiril moves the checks you can already write into the agent's process, where they run before each tool call.
An offline eval is a fixed set of inputs, a run of the agent over each one and a scorer that says pass or fail. The scorer is code, a judge model or a reviewer. LangChain's respondents leaned on people and judges, human review at 59.8% and LLM-as-judge at 53.3%. Text metrics like ROUGE and BLEU, which compare an answer's wording with a reference answer, had all but dropped out, and they never looked at tool calls in the first place.
Braintrust ties this to the release. Its comparison with Galileo describes a GitHub Action that runs the evals on every pull request and blocks the merge when scores fall below a threshold. The same page lists its real-time guardrails as "No built-in runtime blocking". A team can keep that merge gate and send the same spans to Amiril through a second OpenTelemetry exporter.
Keep the eval suite for prompt changes and model swaps, where the question is whether the new model still looks up the invoice before it pays it. Most LLM evaluation tooling grew up scoring answers for correctness and grounding. With an agent the tool calls in each test case can be scored as well. In most test sets a case is one run: a user message and the tool calls the agent made to answer it. This check reads the calls one case recorded and fails it if any invoice_id went to issue_payment twice:
from collections import Counter
def no_double_payment(tool_calls: list[dict]) -> bool:
paid = Counter(
call["args"]["invoice_id"]
for call in tool_calls
if call["name"] == "issue_payment"
)
return all(count == 1 for count in paid.values())In production, a customer has the agent pay an invoice and asks about the same invoice again four messages later. That message starts a new run. The agent pays a second time, and each run on its own passes the check. You'll add that conversation to the test set as one case, and it will guard the next release, though it does nothing about the payment already sent.
Online evals point the same scorers at production traffic, often at a sample of it. Among respondents with agents in production, 94% had some kind of observability, and 44.8% ran online evals.
The judges in AI agent evaluation tools read a finished trace. One marks a double payment after the second payment has gone out, and only if double payments are in its criteria.
The Python check reads tool names and arguments and nothing else. It has no reason to wait for the run to end, so it can run on the live call before issue_payment does. In Amiril that is a rule:
@id("one-payment-per-invoice")
@per("invoice_id")
@sentence("This invoice was already paid in this session")
block (
agent == "payments",
tool == "issue_payment"
)
when {
issue_payment{}
};issue_payment{} in the when block matches an earlier payment, and @per("invoice_id") narrows it to earlier payments for the same invoice, from any run in the session. A session is the runs that share one session id, such as a conversation, so the rule sees the payment from four messages earlier and blocks the second one before it runs. The model gets this back in place of the tool's result:
The call to issue_payment was not performed. Rule one-payment-per-invoice blocked it: This invoice was already paid in this session. Do not retry this call with different arguments or achieve the same outcome another way; tell the user it was not performed.
The check runs inside the agent's process against a local copy of the published rules, so it adds no network request in front of issue_payment. Publish a change and every running process picks it up within about a minute, while the agent keeps running. If Amiril can't be reached, the agent goes on enforcing the last rules it had. The SDK wraps the tools of a LangGraph, Google ADK or LiveKit agent, or of a loop you wrote yourself.
When the failure is new, Amiril starts from the agent's history instead of a criterion. It reads the agent's traces and ranks each run by rarity, in bits, built from the values and step orders that were rare for that agent. A run that skipped a step the agent nearly always takes gets a rarity factor like this:
verify_payee was not called, which happened in 4 of 1,200 other runs
The run's standing, such as Top 1%, compares it with the last 30 days of runs. When several runs share the problem, Amiril groups them into an issue, and an AI investigator reads a sample and writes up what they have in common. Tracing tools will show you these runs too, if you know to go looking. Amiril reads traces sent over OpenTelemetry or uploaded from Langfuse.
Where a rule could have stopped the runs in an issue, the issue carries a rule suggestion. Amiril drafts the rule with an AI model and replays it over past runs. It keeps the draft only if it catches some of the issue's runs and fires on at most one in a hundred of the agent's other runs. The suggestion shows its effect in a line such as "Would have blocked 4 of 5 runs". For the skipped check, the draft could be:
@id("verify-before-pay")
@sentence("{payee} was not verified earlier in this run")
block (
agent == "payments",
tool == "issue_payment"
)
unless {
verify_payee{ args.payee == call.args.payee }
};Create rule opens it in the editor as a draft you can change.
Before you publish, Test on past calls replays any saved version over the tool calls from the last 24 hours, 7 days or 30 days. It lists each call the rule would have fired on, with the agent, the tool and the sentence.
The rule is now the thing under test, with last week's payments as its test set, the setup AI agent evaluation uses for the agent itself. If the list holds a payment you think was fine, edit the rule and test again. Once published, a rule starts in Shadow, where it checks every call and records what it would have done, and the call runs anyway. When every call Shadow records is one you meant to stop, switch the rule to Enforce.
Amiril ranks your agent's runs by rarity once its traces arrive, and the traces quickstart gets them there.