Evolving model- & domain-specific harnesses for securing agents.
An agent that turns language into real-world effects can be subverted through the content it reads — or through a malicious request itself. Instead of hand-designing one fixed defense for every deployment, EvoSafeHarness searches the harness around a frozen model — a natural-language policy P coupled with executable code logic C — tailored to exactly how that model breaks in that domain.
A tool-using agent can be subverted two ways: indirectly, through content it reads — a file, an email, a tool result — and directly, through a malicious request itself. Both exploit the same gap, between the task a user intended and the actions an adversary can induce, and that gap widens with every tool the agent can reach. The defenses we have are real, but they share one weakness.
A detector tuned to one model misfires on another; a tool gate calibrated for one domain over-blocks in the next. One fixed artifact cannot fit every deployment.
A framing one cautious model treats as a hard wall, a more compliant model walks straight through. Each model fails in its own idiosyncratic way.
That mismatch — between a defense designed once and the model and domain it must actually protect — is exactly where attacks live.
So the unit worth optimizing is not the model, but the harness around it — searched per model and per domain.
The model stays frozen — but the pipeline that wraps it (system messages, gates that screen each tool call, sandboxes, output audits) is entirely ours to write. It is the one place a security decision can sit beyond the attacker's reach, and unlike the model, it is programmable and searchable.
…
Five real candidates (v0→v4), real cascade scores, and one round that scored well but got rejected on review — built from the proposer's own search logs for one of the fifteen cells.
The policy transform applied to the model's context — trust-boundary declarations, provenance framing, refusal criteria. On AgentDojo, an authority-anchoring policy with an anti-over-refusal clause reaches 0.0% ASR at 82.8% utility.
Any program valid under the application's adapter — deterministic gates on tool calls, output sanitizers, per-trajectory state, quarantined classifier calls. On DecodingTrust this is load-bearing: six of the fifteen returned bundles drop the NL policy entirely.
Both surfaces act through a small interception API — anything expressible there is searchable. These are interception points, not a fixed taxonomy of mechanism slots:
Three short demos that show the rationale behind the design. The same attack is stopped by very different machinery depending on the model and the domain — pick one, then hover any component to see what it does, which taxonomy slot it fills, and which surface it lives on.
A deeper, step-by-step replay of one real direct attack and one real indirect attack, built from the held-out evaluation logs — see exactly where each is caught.
Across the fifteen returned harnesses, what carries between deployments is the principle — scope, provenance, effect authorization — never the concrete predicate, state machine, or hook graph. Domain semantics fix which safety relations and trajectory state must be protected; the victim's failure behavior fixes whether each check is semantic or deterministic, cached or recomputed, and placed before or after execution.
Four benchmark families, both attack channels, and one adaptive attacker. Pick a benchmark: each panel shows the cross-model summary first, with the per-model breakdown one click away. Baselines are ported once and frozen; EvoSafeHarness is searched per cell, and held-out outcomes never reach the search.
CaMeL also reaches zero ASR — at 41.0% utility, half of ours. The searched policy anchors authority in the user's request and tells the agent to ignore embedded commands while continuing the task, killing both attack-following and over-refusal at once.
Frozen and re-run on unseen shopping / GitHub / daily-life suites: 75.0% utility at 0.0% ASR. The rule keys on where an instruction originates and whether an action stays in the user's scope — not on suite names or tool vocabulary — so it survives the domain shift.
In the hard regime the search compiles semantics into deterministic runtime structure: six of the fifteen returned bundles drop the NL policy entirely, and four run with no auxiliary LLM at all — a separate secure agent per domain and per victim.
Freeze the harness and let a PAIR attacker rewrite prompts against the live agent: ASR moves from 9.7% to a mean of 19.5% across three attacker models at a refinement budget of 16 — still below the undefended agent facing static prompts (23.6%). The relations it enforces depend on provenance and scope, not on any attack's wording.
If this work is useful to your research, please cite the paper.
@article{evosafeharness2026,
title = {EvoSafeHarness: Evolving Model- and
Domain-Specific Harnesses for Securing Agents},
author = {Li, Nanxi and Ma, Yingzi and Cao, Yulong and Suh, Edward
and Li, Bo and Song, Dawn and Xiao, Chaowei},
year = {2026}
}