Breaking The Pattern How Simple Rewording Defeated An Llms Guardrails
The LLM's guardrails blocked a specific prompt injection phrase but allowed the same harmful output when the instruction was reworded. An attacker could bypass the safety mechanism to make the model produce a chosen phrase.
Published on systemweakness.com
Large Language Models (LLMs) are increasingly deployed in customer-facing chatbots. These systems are often wrapped in “guardrails” AKA safety mechanisms designed to prevent them from producing harmful, brand damaging, or policy violating responses.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the guardrail relied on matching the exact injection phrase rather than isolating instructions from user input.
Impact
An attacker could bypass the LLM's guardrails to make it produce a specific phrase, potentially leading to brand damage or policy violations.
What the attacker needed
Access to a public LLM chatbot
The fix
Guardrails should use deeper instruction isolation so that system and developer prompts cannot be overridden by user input, rather than relying on pattern matching.
How it was found
- Send a classic prompt injection asking the model to ignore previous instructions and say a specific phrase.
- Observe that the model complies and outputs the phrase.
- Try a more sensitive phrase and see the model refuse, indicating phrase-based moderation.
- Repeat the original injection and note the model now refuses, suggesting session-level tightening.
- In a fresh conversation, reword the instruction in several ways (translation, role-play, minimal instruction, story framing, fill-in-the-blank, fictional output).
- Observe that every reworded prompt successfully makes the model output the target phrase.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A prompt injection is when a user sneaks instructions into a chatbot to make it do something it should not. Here, the chatbot's safety filter only looked for one exact phrase, so changing the wording let the same bad instruction through.
What is AI / LLM?
Prompt injection, data exfiltration and tool abuse in features built on language models, and the ordinary bugs around them.