Security

When to Re-run Evals for a Tool Change, Not a Prompt Change

Antonio Evans7 min read

A split-screen scene: on the left, a developer edits a JSON tool schema with fields like 'name', 'parameters', 'required'; on the right.
Key points

Key points

  1. 1Re-run evals for a tool change when the change alters the tool's contract: parameter names, types, required fields, return format, or side effects.
  2. 2Adding a tool changes the callable surface, so it can hijack calls that previously routed elsewhere even if no other code changed.
  3. 3Purely cosmetic edits (descriptions or examples with no semantic effect on when and how to call) can skip evals but must still be monitored.
  4. 4Treat tool changes and prompt changes as one class of diff: the risk comes from configuration, not from the text of the prompt.

Classify the diff before you decide to test

The expensive mistake in agent maintenance is not running evals. It is running the full suite on every change, which burns time and money until the team quietly stops running anything. The fix is to classify the change first, then match the test scope to the class. This is the same logic as a risk register, where each entry gets a likelihood, an impact, and a defined response, and only the high-severity entries get the heavy treatment risk register guidance from Drata.

For prompt work, most teams already have three informal classes: cosmetic (tone, wording), behavioral (instructions that change output shape), and contract (output format consumed by code). Tool changes map onto the same three classes almost one to one. A description edit is cosmetic. A new optional parameter is behavioral. A renamed parameter is contract, and contract changes are the ones that break silently, because the model usually still produces something plausible.

A useful internal test: if a downstream parser, teammate, or second tool reads the output of this tool, then any change to that output's shape is a contract change. That single question catches most of the misclassifications.

The breaking contract checklist

Run through this list on every tool diff. Each row is a yes or no. Two or more yes answers means targeted evals at minimum, and a contract class change means the full suite.

CheckQuestion to ask about the diffClass if yes
Parameter namesDid any argument key change spelling or casing?Contract: full suite
Required fieldsDid an optional field become required, or vice versa?Contract: full suite
TypesDid a string become an enum, number, or nested object?Contract: full suite
Return formatDid the response shape, field names, or units change?Contract: full suite
Side effectsDoes the tool now write, send, delete, or charge where it only read before?Contract: full suite plus a safety review
Error modesDoes it now return an error payload where it used to return empty data?Behavioral: targeted evals
Description onlyDid only prose, examples, or naming in the description change?Cosmetic: monitor only
New tool addedDoes a new callable overlap with an existing one?Contract: full suite plus routing evals
Tool removedDo other tools, prompts, or code paths reference it?Contract: full suite
Auth or scopeDid the credential, tenant, or data scope change?Contract: full suite plus security review

The side effects row deserves emphasis. Research on tool-using agents found that sensitive information can be exposed during entirely benign requests, and that successful task completion often coincided with data-handling failures the SG AISI and KR AISI evaluation. A tool that gains a write or send capability is a new security surface, not a plumbing tweak, which is the same reasoning behind least agency: an agent that needs to recommend an action does not automatically need permission to apply it guidance on third-party agent risk.

When targeted evals are enough

Targeted evals mean one narrow suite per changed tool, not the whole regression set. The rule that keeps this honest: targeted evals must include (a) the tasks that previously called this tool, (b) the tasks that should call it, and (c) a handful of tasks that should not call it. The third group is the one teams skip and the one that catches new-tool hijacking.

Anthropic's writeup on agent evals makes the mechanics concrete: a task has defined inputs and success criteria, each attempt is a trial, and a grader scores aspects of performance, with the outcome being the final environment state rather than what the agent said Anthropic's agent evals guide. That distinction matters for tool changes, because a renamed parameter may produce a fluent confirmation while the environment never changed. Grade the environment, not the transcript.

Prompt testing frameworks already carry tool configuration as part of the versioned unit, so a tool diff is testable with the same harness as a prompt diff Braintrust on prompt testing. The practical version number should bump on tool schema changes too, not just prompt text, or you lose the link between a bad run and what actually caused it.

A worked example with numbers, using an invented but representative setup: an agent has 40 tools and a suite of 300 eval tasks, of which 120 touch the tool being changed. A full suite run costs 300 tasks times 3 trials, so 900 graded trials. A targeted run covers 120 callers, plus 15 should-call and 30 should-not-call cases, which is 165 tasks times 3 trials, so 495 graded trials. That is roughly a 45 percent cut for a change that touches 40 percent of the suite. Now the decision rule: if the change is contract class, run full anyway. If behavioral class, run targeted and only escalate to full if the regression rate on the targeted set exceeds your threshold, for example more than 3 of 165 tasks failing where they passed on the baseline. Cosmetic class gets zero eval trials and a monitoring alert instead.

How tool and prompt changes interact

The interaction is where most teams get burned. A prompt edit that adds a sentence about when to use a tool is a tool change in disguise, because it changes routing. Conversely, a tool description rewrite changes the model's selection behavior as surely as a prompt rewrite, since the description is part of the context the model reads.

There is direct evidence that API behavior shifts can flip which prompt is better: a case study found that after one API update, one prompt outperformed another by 8.7 percent accuracy, reversing the earlier ranking research on regression testing for evolving LLM APIs. The lesson transfers to tools: selection rankings between overlapping tools are not stable across configuration changes, so a routing eval that passed last week is not evidence it passes now.

The practical policy is a combined change log. One entry per release, listing prompt diffs, tool schema diffs, model settings, and retriever changes, because a score difference between two runs can be traced to any of them only if they travel together Braintrust on prompt versioning. Immutability helps here: once a version is created it should not be edited, so every change is a new record rather than an overwrite LangWatch on prompt management.

If a release contains both a tool change and a prompt change, test them separately first. A combined run tells you pass or fail but not which diff caused it, and separating them costs one extra targeted run.

Adding and retiring tools

Adding a tool is a contract change even when nothing existing was edited, because the callable surface grew. Two questions decide the scope. First, does the new tool overlap in purpose with an existing one? If yes, run routing evals across the full set, since the model may now prefer the newcomer on tasks that used to route correctly. Second, does the new tool have side effects or wider data scope? If yes, add a safety review and a data-handling eval suite alongside the functional one.

Retiring a tool is riskier than adding one, and it is under-tested because the deletion looks clean. Before removing, grep prompts, code, and other tools for references. A prompt that names the tool by name will now instruct the model to call something that no longer exists. A second tool that called the first internally will fail at runtime. Nested or chained tools are the common blind spot.

The same governance body that tracks models and their lifecycle can hold the tool inventory. Model registry practice includes audit trails of deployments, rollbacks, and retirements, plus monitoring integration to catch drift model registry governance. A tool registry with the same fields (owner, purpose, permitted actions, retirement trigger) makes the "who depends on this" question answerable in seconds instead of a codebase search. Organizations that skip this end up with a production blind spot: models or tools that were deprecated in name but never actually switched off Collibra on model governance.

A cadence that keeps the suite alive

Pass/fail per case against a stored baseline is the signal you want from prompt and tool tests, and prompt evaluation scores are a separate, slower signal about quality Braintrust's comparison of testing and evaluation. Keep them apart. Failing a regression check should block the release; a dip in a quality score should trigger a look, not a rollback.

Regression testing for LLMs has to handle non-determinism and many acceptable answers, which is why sample inputs, reference answers, and code-based plus judge-based checks are combined rather than relying on exact matches Evidently's regression testing tutorial. For tool changes, add deterministic assertions where possible: did the tool get called with a schema-valid argument set, did the environment state change as intended, did a prohibited tool get called. Those are cheap and unambiguous.

Finally, treat a production failure as a test case, not an incident. When a tool change causes a bad run in the wild, add that task to the suite and to the relevant risk register entry with its score and owner, which is the pattern behind structured AI risk registers an AI risk register template and general risk matrix practice of ranking by likelihood and impact risk assessment matrix overview. The register then tells you which tool changes deserve the full suite permanently, rather than re-litigating the scope call every sprint.

If you are setting up this kind of pipeline across several model providers, running the same eval harness against text, tool-calling, and embedding models through one key removes a variable from every comparison, which is what Quanta Inference is built for.

FAQ

FAQ

Is a description change ever worth a full eval run?

Usually not. If the description edit does not change when, how, or with what arguments the tool should be called, it is cosmetic and monitoring is enough. The exception is a tool with near-duplicate siblings, where wording is the only thing the model has to discriminate between them, so treat that edit as behavioral.

How do I know a new tool did not hijack existing routing?

Run a should-not-call set alongside the should-call set. The should-not-call tasks are drawn from the tasks that previously routed to other tools, and any new call on those tasks is a routing regression even if the final answer looks fine.

Do I need to re-run evals when the tool schema is unchanged but the backend behavior changed?

Yes, if the change affects return values, latency, error payloads, or side effects. The schema is the contract, but the model reasons over results, so a changed return format with an unchanged schema is still a behavioral change and deserves targeted evals.

Can one suite cover both prompt and tool changes?

It can, but do not run them together on the first pass. Run the tool diff and the prompt diff separately so a failure is attributable, then run the combined suite as a final gate before release.

What should block a release versus what should just alert?

Any contract-class failure blocks. A drop in a quality score on targeted evals should alert and route to review. Cosmetic changes have no gate at all, only a production alert if the error rate or refusal rate moves past its normal band.

Sources

Sources

  1. Risk Register: How to Build One
  2. An Evaluation of Data Leakage Risks in Tool-Using LLM Agents in ... - arXiv
  3. Third Party AI Agent Risk: Security Guide
  4. Demystifying evals for AI agents
  5. What is prompt testing? Test cases, datasets, and regression checks ...
  6. (Why) Is My Prompt Getting Worse? Rethinking Regression Testing for ...
  7. What is prompt versioning? Best practices for iteration without ...
  8. Prompt Management: Version & Deploy Prompts in ...
  9. ML model governance and registry | AI Governance Lexicon
  10. AI model governance: How to track, audit, and control AI ...
  11. A tutorial on regression testing for LLMs - Evidently AI
  12. AI Risk Register Template
  13. Risk assessment matrix: Overview and guide
About the author

About the author

Antonio Evans
Antonio Evans

Antonio Evans is the founder of Quanta Intelligence and a fractional CTO who builds HIPAA-ready AI systems for health and life-science companies. Before that he was technical co-founder of FriendsEAT for twenty years, CEO of Socialdraft, and a data engineer at IBM. Antonio lives with his dog Santino in Lisbon, Portugal.

All articles