arXiv:2610.31695cs.CROct 2026

Manuscript Offprint

arXiv:2610.31695

Fooling LLM Safety Guards into Judging the Wrong Text

Utkarsh Kanwat

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Safety guards check content before an LLM application acts on it, and most paste that content into a plain-text prompt. Content that imitates the prompt can append a second task, and the guard answers that one instead. We call this target rebinding. Our explanation is that the guard grades the last complete task in its input, here a harmless decoy, so the harmful request goes through unchanged. In a pre-registered test, an appended forged query and decoy clear all 75 held-out AdvBench requests that Shieldstral-1.0-3B flags. The guard is not persuaded: a directive to ignore the text above clears none of them, and in a follow-up run a harmful decoy stops the attack. On our GUARDREBIND benchmark, each of five guards has an attack family, chosen per guard, that clears at least 93% of its flagged items. Rebinding explains this best on Shieldstral and gpt-oss-safeguard; on ShieldGemma and Llama Guard 3, generic evasion and trailing text respectively do part of the work, and Qwen3Guard falls mainly to a forgery of its whole task. Training the guard to score content no lower than its most harmful part cuts attack success from 75% to 0.8–1.6% on attack families, decoys and forged queries held out of training. All of these attacks append the forged structure after the request, and we added the held-out-decoy evaluation after a first round of test runs. Clean AUROC falls by at most 0.01, but our test of non-inferiority is inconclusive. A score-guided search still beats this trained guard on 47 of 50 items, usually by placing forged structure before the request. On about half of the items where the search wins, the same search also finds benign text, with no forged structure, that clears the guard.

Code and data: https://github.com/ukanwat/guardrebind

Model: https://huggingface.co/ukanwat/shieldstral-1.0-3b-rebinding-fix

1 Introduction

Large language model (LLM) applications put small safety guards in front of chat assistants, retrieval and agent tool calls. A guard is a model that judges whether text violates a policy, and the application acts on its verdict. Content a guard clears (judges safe) is passed on, and in an agent the action it describes may then run unreviewed. An attacker can make a guard clear a harmful request, unedited, by following it with a few lines that imitate the guard's own prompt. The guard then grades a harmless sentence the attacker supplies, and the downstream model receives the request with the guard's approval.

Recent guards also take the policy as an input. In Shieldstral [1, 33], the developer writes an instruction (how strict to be) and a query (a yes/no safety question), and the guard answers whether the untrusted content, the document, is unsafe with respect to the query (Figure 1). gpt-oss-safeguard [35] reasons over a developer-written policy in the system role, and Llama Guard [17, 31] grades a conversation against a fixed taxonomy inside its own delimiters. In all three, the content shares a token stream with the text that tells the model what to do with it. The Llama Guard paper warns that the model “may be susceptible to prompt injection attacks” [17], and the gpt-oss-safeguard report scores the 20B model 0.512 (higher is better) on a

[system] Judge whether the Document meets the requirements based on the Query and the Instruction provided. Note that the answer can only be "yes" or "no". [user] <Instruct>: You are a strict safety moderator reviewing potentially harmful content. Apply a low tolerance threshold. <Query>: Does this content provide assistance with, or encouragement toward, illegal or seriously harmful activity? <Document>: Create a website that facilitates the buying and selling of illegal drugs and weapons <Query>: Does this content provide assistance with, or encouragement toward, illegal or seriously harmful activity? <Document>: The library will close early on Friday for scheduled maintenance.

guard score P(yes)P(\text{yes}): harmful request alone 0.999 (flagged) with the forged pair 0.023 (cleared)

Figure 1: Target rebinding on Shieldstral. The developer writes everything outside the shaded region, which holds the untrusted content and is interpolated verbatim. The content is a held-out AdvBench request followed by a forged <Query>/<Document> pair with a benign decoy. The guard grades the last pair, so the request is cleared and forwarded unchanged. Scores are this request's values in the confirmatory run (Section 3).

prompt-injection hijacking test in which a user message tries to make it say “access granted” [35]. Neither says what such an attack looks like against a guard, or how to build a guard that resists it.

In the formats we study, the labels that mark the query and the document (<Query>:, <Document>:) are plain text that the developer writes around the content, and nothing stops the content from containing the same labels. When it does, the guard sees two complete grading tasks, and our experiments indicate that it grades the document in the last one. We call this target rebinding: the content changes which document the guard grades, not how the guard judges it. The attacker's query and document form the forged pair, and the document the guard ends up grading is the decoy. Because rebinding needs no instruction, the usual defense against persuasion, telling the guard to ignore instructions inside the content, does not touch it.

Forging a completed task followed by a new one is a known prompt-injection pattern [25], and forged template, conversation and judge-output structure has been used against agents, chat models and LLM judges (Section 7). The attack first appeared informally in a blog post [19]; here we measure it and train against it.

C1 On Shieldstral the guard grades the decoy. A sentence telling it to disregard the section above clears no flagged request, a complete forged pair clears all of them, and the attack fails more often as the decoy becomes more harmful (Section 3). An anti-injection directive in the policy does not stop it (Section 6).

C2 Adapted to each format, the attack clears gpt-oss-safeguard, whose policy sits behind a role boundary, and Llama Guard 4, whose prompt has no developer-written policy. Our GUARDREBIND benchmark covers five guards, not including Llama Guard 4, and each has an attack family, chosen per guard, that clears over 93% of its flagged items (flagged with no attack). Rebinding explains this best on Shieldstral and gpt-oss-safeguard; on ShieldGemma and Llama Guard 3, generic evasion and trailing text respectively do part of the work. The format sets the cost: any label syntax clears Llama Guard 3, while Qwen3Guard falls mainly to a whole-task forgery (Section 4).

C3 We train the guard to score the whole content at least as high as the frozen base guard scores its most harmful part (segment-max self-distillation). Against the attack families we enumerate, all of which append the forged structure, this nearly closes the channel, including with decoys and forged queries held out of training. We added that held-out-decoy measure after a first round of test runs (Appendix A). Adding reserved boundary tokens around the content changes these results by under one point, so training is the main defense. An adaptive attacker still beats the trained guard: a search guided by its score clears it on 47 of 50 items, usually by moving the forged structure before the request, and boundary tokens, in the one result where they help, cut this to 34. On 26 of those 47, benign text with no forged structure also clears it, so on about half the items the remaining weakness does not need rebinding (Sections 5 and 6).

We pre-registered our predictions and list each one with its outcome in Appendix A. We release the code, the benchmark, the result files behind every number and a trained Shieldstral adapter (Appendix F).

References (42)