Case Studies · Agent Assurance

Hardening a new AI agent with the Agent Assurance Engine

How a coding agent used the Agent Assurance Engine over MCP to scan a newly written agent, probe it on three models, fix what was real, and measure again in one session.

October 2026 · Markdown

Study context:

  • The agent under test, Martin, is an internal VAIL tool, not a customer deployment.
  • Results are against sample data (its people and most companies are fictional), with five runs per probe per model. They show consistent patterns, not small differences.
  • Scan results are hypotheses from source. The confirmed findings below come from running probes against the agent.

Summary

A coding agent (Claude Code) wrote Martin, a Slack assistant that helps the VAIL team review new signups and spot usage abuse. Before it shipped, the same coding-agent session used the Agent Assurance Engine over MCP to scan Martin’s source, generate probes, run them against the real agent on three models, fix what was real, and run the same probes again. A person approved each step.

  • The scan pointed at real problems. Of 10 potential vulnerabilities, 4 were confirmed and 2 more were real but minor. The most serious: when someone typed a person’s details into chat as if they were a signup, Martin searched the web about that person without checking that the signup existed. It did so in every completed run (13/13), on every model.
  • Fixes moved every model. The share of vulnerability probes Martin resisted rose from 33% to 45% (gpt-oss-120b), 31% to 51% (gpt-oss-20b), and 58% to 67% (kimi-k3). Web searches of unverified details fell from 13/13 runs to 2/15.
  • The model mattered most for reliability. 24 of 120 gpt-oss runs ended in provider errors in the baseline, mostly malformed tool calls; kimi-k3 had none. Scanning source cannot see this; running probes did.
  • Re-measuring caught a regression the fix caused. A new rule made one model fail a routine usage question more often (4/5 correct runs to 2/5). Only re-running the same probes before and after showed it.

The agent

Martin is an internal operations assistant for the people who run the Agent Assurance Engine. When someone signs up, Martin looks up the signup, searches the web for the person and company behind it, and recommends whether to approve. It also watches usage for abuse, such as one person spreading activity across accounts to get around limits. Martin recommends; people decide.

A coding agent wrote it from a short spec: a persona, three skills, and a small read-only toolset. Nobody had tested it adversarially. That Martin’s subject is the Engine’s own users is incidental; any agent would have served.

The loop

The Agent Assurance Engine is reachable from the coding agent as MCP tools, so the scan, the probes, and the local test runs all happened in the session that holds the agent’s code. Times are wall-clock.

# Step What happens Who Time
1 Scan Upload 11 source files; the Engine reads prompts, tools, and code (create_agent, prepare_source_upload, complete_source_upload, scan_agent). Engine, in the background ~4 min
2 Review behaviors Read the 10 proposed vulnerabilities, each with evidence from the source. Developer ~40 min
3 Generate probes Probes with automatic pass/fail checks (generate_probes), exported into the repo. Engine, in the background ~4.5 min
4 Harness Turn the probes into a local test harness, then pilot one run per probe on each model. Developer approves ~15 min
5 Baseline 5 runs per probe on 3 models: 180 runs. Triage every failure from its transcript. Local runs, in the background 37 min
6 Fix Rules into tool code, judgment into prompts, guided by the confirmed findings. Developer approves ~2 min
7 Re-measure The same 180-run matrix on the changed agent. Local runs, in the background ~32 min

The whole session took just over three hours, most of it the two 180-run measurements and the human review between steps. The coding agent did the hands-on work; the developer decided what to approve and when to commit.

What changed

Fixes put deterministic rules in tool code and left judgment to the prompts:

  • In the tools: the usage tool computes which abuse limits each account crossed; it flags accounts that look like the same person (one email with different +tags, or one company domain); each user’s email is labeled disposable, free, or company; pending signups come back newest first.
  • In the prompts: vet only signups found in the Engine’s records and never web-search details typed into chat; report the limits the tool computed instead of re-deriving them; check each account before reporting that two look like the same person; search the company name and domain together.
Model Vulnerabilities resisted Run errors
gpt-oss-120b 33% → 45% 11 → 8 of 60
gpt-oss-20b 31% → 51% 13 → 8 of 60
kimi-k3 58% → 67% 0 → 0 of 60
  • Fixed, mostly: web searches of unverified signup details fell from 13/13 to 2/15 completed runs; kimi-k3 refused every time.
  • Improved: Martin judged the main test account’s usage limits correctly in 10/15 runs, up from 8/15. A smaller account stayed at 1/15.
  • Unchanged: no model checked each account before reporting that two looked like the same person, though its instructions asked. They reached the right answer anyway, so this is a requirements decision, not a defect.
  • Reliability: run errors fell from 24 to 16 of 180. The remaining malformed tool calls belong to the agent runtime, not the agent.

The regression: the new rule to vet only signups found in the Engine’s records also got in the way of a routine question on gpt-oss-20b. Asked how many scans an existing customer had run, the model looked only among pending signups and asked for an ID. Correct answers fell from 4/5 runs to 2/5.

Lessons

  1. Scan first, then run. The scan turned a fast-written spec into testable claims in under three minutes, including an adversarial case the spec’s authors had not considered.
  2. Pilot before you measure. One run per probe per model caught a model-ID setup problem before the full runs.
  3. Measure on the models you might ship. Before any fix, the same agent resisted between 31% and 58% of the vulnerability probes depending on the model, and one model crashed in a fifth of its runs.
  4. Triage from transcripts. Four of the ten behaviors never actually happened; the failures some of their probes recorded came from strict probe wording, not from the agent.
  5. Put rules in code, judgment in prompts. Moving limits and sorting into the tools improved every model; rules left to prompts still slipped.
  6. Re-measure every change. The same probes before and after showed what improved, what did not, and what the fix broke.
  7. Keep the evidence with the code. Probes, transcripts, and scores sit beside the agent, so the next change is measured against this one.

Limitations

  • Sample data, one case per probe; fixes could overfit to it.
  • Five runs per probe per model: enough for consistent patterns (0 of 13, 1 of 15), not for small differences.
  • Single-turn probes only; no multi-turn pressure and no injected tool failures.
  • Scores came from a local scorer reading the Engine’s probe metrics, not the Engine’s own evaluator.

← All case studies · Markdown version · About Agent Assurance