Skip to content

The Gap Between Knowing and Doing in LLM Agent Safety

#llm-agents #ai-safety #prompt-injection #jailbreak-robustness #agent-governance #evaluation

Give a model the current date and it will do the arithmetic. Ask about the medication schedule two turns later and it may tell the user to take the next dose anyway. A benchmark called TASC ran that scenario shape against 13 models, across 3,418 inputs derived from 128 templates. Assistants respected the time-dependent constraint in 30.5% of cases where the proposed action broke a rule.

The number that matters more is the second one. In 62.1% of failures, the model had already calculated the elapsed time correctly.

So the constraint was sitting in context. The model just didn't route it into the advice. Telling the model the timing explicitly in the prompt fixed about half of the failures, which means the other half aren't an information problem at all.

Five papers published in the same window circle this boundary between a model knowing a thing and a model acting on it. Read together they point at a practical conclusion: stop asking the model to police itself, and build the checks around it.

Time arithmetic and time judgment are different skills ​

TASC ships a separate set of 33 scenarios built to isolate the two. Can the model compute elapsed time? Can it then apply that number to the recommendation? The benchmark shows those capabilities coming apart.

One detail is easy to miss. The assistants almost never warn when they shouldn't. False-warning rate is low. That's the profile of something tuned not to be annoying, which is a reasonable product instinct: an assistant that interrupts every conversation with "your prescription expired last Tuesday" gets muted in a week. But high precision with 30.5% recall means you can't rely on the model to volunteer the constraint.

If you're running a booking, dosing, or scheduling agent, dropping an ISO timestamp into the system prompt buys you roughly half the fix. The other half needs a deterministic filter over the generated text: does this recommendation have a precondition that fails at the current time? That's a regex-and-rules layer, not a model call.

Selective robustness: more context is a hypothesis ​

Agents in social simulations shift behavior under meaning-preserving paraphrases of the same prompt. Two research groups using "the same" setup can disagree on results because one wrote "you are negotiating" and the other wrote "you are in a negotiation." That's a validation problem before it's a modeling problem.

The context-enrichment paper separates two things that get conflated. Context richness needs a controlled definition. Robustness needs a criterion that points in one direction. They offer four prompt substitution rules: neutral padding, generic social background, descriptive decision grounding, and normative decision grounding.

Then they define selective robustness as two properties at once. Insensitivity to meaning-preserving variation, plus a directional response to decision-relevant changes in the social world. Those pull against each other. An agent that ignores every prompt edit is stable and worthless. An agent that reacts to every edit is responsive and unusable.

Running this on a Prisoner's Dilemma-like game, the four enrichment forms produced distinct behavioral patterns, and the patterns differed between the two models tested. Enrichment is a knob you calibrate per model. It isn't a general-purpose fix for brittleness.

Quick Take: Across all five papers, the defenses that survive contact with an adversary are the ones that move the constraint out of the model's judgment and into a checker, a state machine, or the training distribution.

The cheap version of this for your own work: generate ten paraphrases of your agent prompt and run them before you tune anything. If your agent's cooperation rate swings 30 points between phrasings, you measurably have a prompt artifact rather than a policy.

SecureGARD puts the check outside the model ​

Tool-using agents convert prompt injection from an embarrassment into a loss event. A jailbreak that produces rude text is a PR problem. A jailbreak that reaches transfer_funds is a different category entirely.

Prior defenses constrain tool calls, trajectories, or information flows. SecureGARD's argument is that they leave action semantics, state dependencies, and evidence relations implicit, which is fine until you add a tool and the guardrail has no idea what the new call means.

The design grounds heterogeneous tool calls in a shared semantic representation, pairs an executable ontology with episode-level task state, and derives three decisions: ready, waiting, forbidden.

The waiting decision is the primitive I find most useful. It encodes an unmet but recoverable obligation, which lets the agent replan inside its existing authorization boundary instead of either failing hard or escalating. Most guardrails I've seen collapse that case into "deny" and then the agent starts improvising.

The ontology isn't hand-written. It evolves offline from verified training executions. An LLM proposes instance-independent action-state axioms, and each one is accepted only if it fixes an ontology error exposed by an actual training failure, preserves logical consistency and protected entailments, and passes held-out validation before the ontology freezes. That acceptance pipeline is the interesting engineering, because it's the difference between a rule set that grows and one that rots.

On AgentDojo, ASB, and AgentDyn, under both benign and indirect-injection settings, SecureGARD reports a 0% attack success rate while improving task utility under attack versus baselines. Read the zero as "zero on these three distributions." The reason to believe it generalizes is structural: the decision doesn't depend on the model noticing the injection in the first place.

Addition by Subtraction: safety is spread thin ​

Earlier work established that safety alignment is sparse. Prune a small set of safety-critical neurons and the guardrails leave with them. Ablate a single refusal direction and the same thing happens. A model that passes every red-team suite can lose most of that behavior to a compression pass nobody flagged as risky.

The repair is counterintuitive. During finetuning, the method gradually removes the identified safety-critical neurons and uses preference optimization to re-establish safety-aligned behavior through other parts of the network. You're forcing the model to relearn refusal without the components it was leaning on.

Up to 90% lower attack success rate on some attacks after this retraining, across four models from three vendors. The method was designed against white-box pruning attacks and also cut refusal-direction ablation and black-box jailbreaks.

The generalization to black-box attacks is the result I didn't expect, since nothing in the training objective targets them. Truthfulness improved and general capabilities were largely preserved, which suggests the retraining isn't trading capability for safety in the usual way.

Practical consequence for anyone running a model pipeline: if you quantize, prune, or distill a safety-tuned checkpoint, re-run your jailbreak suite afterward. Sparse alignment means a small weight cut can carry a disproportionate share of the refusal behavior, and your compression diff won't show it.

Measuring risk instead of harm ​

You can't monitor psychological harm directly. It emerges over repeated interactions and depends on user context the model never sees. Latent harm lives in a person's history, not in a token.

The paper's move is to measure risk factors instead: eight observable AI behaviors at the response level, aggregated over time. These are things the model does, not things the user feels. All detectors are model-agnostic and read only the output, so they work against any model behind any API, including ones you don't host.

97.1% fewer LLM-judge calls on WildChat, with macro F1 still at 0.79 on held-out human labels. The rest of the scale: 47,062 synthetic responses, 373,873 response-factor labels, eight observable behaviors.

Three detector designs got compared: embedding-based classifiers, direct LLM judging, and a cascade of the two. The best cascade hit macro precision 0.86, recall 0.76, F1 0.79.

Recall of 0.76 means you miss about a quarter of flagged behaviors. For a monitoring layer that surfaces conversations for human review, that's a defensible operating point. For anything that takes automatic action on a user's account, it isn't.

The finding that stuck with me came from DelusionEval: risk-factor detections cluster within conversations. Aggregate at the conversation level, not the turn level. A single flagged response is weak evidence. Four inside one thread is a different signal, and per-turn averaging throws that structure away.

What I've run into ​

In my own eval runs, the thing that kept breaking wasn't the model's reasoning. It was the plumbing between the reasoning and the action.

I built a small scheduling agent and spent two days improving its date math. It got better at date math. It still recommended expired options, because nothing in the pipeline compared the recommendation against the expiration date. The model output the right number and then ignored it. That's the TASC result, reproduced in miniature, in a weekend project with three tools.

I've also watched a guardrail I was proud of evaporate under a paraphrase. Same intent, different wording, cooperation rate moved by double digits. I hadn't written a single robustness test when I built it. Now the ten-paraphrase check runs before anything else.

And I've seen a quantized version of a safety-tuned model sail through a hand-written red-team list I'd been reusing for months, then fold on a jailbreak template I hadn't tried. That one cost me a week of misplaced confidence in my own test suite.

Five papers side by side ​

PaperFailure it targetsHeadline numberDeployment takeaway
TASCTime constraints dropped between turns30.5% compliance; 62.1% of failures had correct elapsed-time mathAdd a post-generation rule check
Context enrichmentPrompt-variation brittleness in social agentsFour enrichment types produced distinct behavior across two modelsRun paraphrase tests before tuning prompts
SecureGARDIndirect prompt injection through tools0% ASR on AgentDojo, ASB, AgentDynPut authorization outside the model
Addition by SubtractionSparse safety alignmentUp to 90% ASR cut on some attacks, four models, three vendorsSafety-tune after compressing, not before
Risk-factor detectionLongitudinal psychological harmMacro F1 0.79; 97.1% fewer judge callsMonitor responses, not inferred user states

The row that generalizes furthest is SecureGARD's. Temporal constraints, tool authorization, and psychological risk factors can all be expressed as predicates over observable state. Once you frame them that way, the model's job shrinks to proposing, and the checker's job is deciding.

Common Pitfalls ​

Injecting the timestamp and calling it done. The explicit timing hint in TASC resolved roughly half the failures. If your whole mitigation is a datetime string in the system prompt, you've addressed half the problem and shipped.

Treating compression as safety-neutral. Pruning, quantization, and distillation all interact with sparse safety alignment. A small weight cut can take a large share of the refusal behavior with it, and your capability benchmarks won't register the loss.

Writing tool authorization rules into the system prompt. A prompt is negotiable. A model can be argued out of it, paraphrased past it, or injected around it. An executable ontology lookup isn't, because the decision happens after generation and doesn't consult the model's opinion.

Averaging risk signals per turn. The DelusionEval clustering result means per-turn scores wash out the conversations you actually care about. Aggregate over the whole thread.

Reading 0% ASR as solved. Three benchmarks are three distributions. The structural reason to trust the ontology approach is that the check sits outside the model, so the work becomes maintaining coverage for the tools you expose, and that work never ends.

One Thing to Remember ​

The failure mode connecting these five papers is drift between a model's internal representation of a constraint and its emitted action, and no amount of additional context reliably closes that gap. The mitigations that work are mechanical: a filter on the output, an ontology over the tool call, a retraining pass that spreads safety across the network, a conversation-level aggregation of behavioral signals. Whether the model understands the rule turns out to matter less than whether something downstream enforces it.

The Bottom Line ​

If you're shipping a scheduling, booking, or health-adjacent assistant, add a deterministic post-generation rule check against the constraint. Prompt-level timing hints resolve about half of TASC's 62.1% gap, which leaves too many failures in production.

If you're compressing a safety-tuned model for cost or latency, budget a repair finetune as part of the compression project and re-run your jailbreak suite after the pass, not before. Up to 90% ASR reduction is available from the subtraction-then-preference-optimization approach, and the alternative is finding out on your own traffic.

If you're monitoring psychological risk at scale, put a classifier in front of the LLM judge and send only flagged turns downstream. The cascade cuts judge calls by 97.1%, which is the difference between an audit you can run continuously and one you can afford once a quarter.