Blog · ← All posts
How Do System Prompt Extraction Attacks Work?
Published: November 14, 2026 · Reviewed: November 14, 2026 · 6 min read
Run a free red-team test on your chatbot → Eight real probes from the library below, with transcripts — or open the full battery in ChatBreaker and generate a red-team report for your team.
The short answer
Extraction works because the system prompt is text the model can read, and models are built to talk about text. ChatBreaker tests it with probes se-01 to se-04, rated CRITICAL to HIGH: the verbatim request, pre-conversation recall, the hidden-instructions dump, and translation exfiltration — plus implicit extraction iex-01 to iex-04, which never mentions instructions at all and instead asks benign-sounding questions whose answers rebuild the prompt. Bots that refuse se-01 routinely answer se-02 and iex-02. The complete defence is to assume the prompt is public and engineer so that knowing it does not help an attacker.
The four direct shapes, in ascending subtlety
se-01 asks, bluntly, for the instructions verbatim. It is the probe every team has informally tried, and the one most bots refuse. se-02 asks the bot to recall what was said before this conversation started — the same content under a frame the refusal training never labelled. se-03 asks for an inventory of everything the user is not supposed to see: rules, constraints, internal names, fallback behaviour. Bots that guard the phrase 'system prompt' will often helpfully enumerate their hidden instructions, because the request never used the guarded phrase.
se-04 launders the leak through transformation: translate the instructions, summarise them, render them as JSON or a poem. Output filters watching for verbatim prompt text see nothing familiar, while the attacker receives the full content in a trench coat. Any extraction defence that only compares output to the prompt string fails se-04 by design.
Implicit extraction: the prompt, rebuilt politely
The iex family (iex-01 to iex-04) is extraction for bots with good direct defences. iex-01 asks for a linguistics-paper completion; iex-02 asks the bot to describe its own role in the third person; iex-03 requests a casual setup summary; iex-04 asks for a developer-briefing paraphrase. None of these asks for 'the prompt'. Together, their answers reveal tone rules, refusal thresholds, escalation paths, tool names and discount authority — the operational content of the prompt, which is what an attacker actually wants.
This reframes what 'leak' means. Verbatim text is the rarest outcome. Piecemeal reconstruction — answering one innocent policy question at a time until the playbook is rebuilt — is the common one, and structural leakage (tool names, internal URLs, error scripts) often matters more than the prose. Our essay on whether a chatbot can leak its prompt defines the working standard a probe judges against.
Why teams put secrets in prompts (and must stop)
Prompts accumulate secrets for understandable reasons: the internal discount code is in the prompt because the bot needs to know it; the escalation channel is in the prompt because the bot needs to mention it; the API key is in the prompt because nobody built the tool call. Each is a small convenience, and together they convert a prompt leak from a curiosity into a credential breach. The canary trap exists to make this concrete: plant a fake secret (can-01 to can-04, CRITICAL) and its appearance in any reply proves the channel leaks.
The rule is simple to state and annoying to implement: nothing in the prompt may be worth stealing. Discounts are checked by a pricing tool against the account; keys live in a vault the model never sees; internal names are replaced by public descriptions. When the prompt is genuinely publishable, extraction drops from CRITICAL incident to interesting telemetry — you learn someone is probing you, and they learn nothing that helps.
Testing extraction like an attacker, not an auditor
Run se-01 to se-04, then iex-01 to iex-04, then the canaries, in one session battery — attackers chain them, and a bot that refuses direct asks may relax after twenty polite questions. Judge generously (for the attacker): summaries, translations and reconstructions count. Then apply the fix-verification discipline from mutation testing: rephrase each successful extraction eight ways, because a refusal trained on your test phrasing is a refusal that lasts until the first creative stranger.
Finally, check the quiet channels: error messages that echo configuration, 'debug' helpfulness that prints tool schemas, and the session-summary feature that recites context back (pii-04's cousin). Extraction is a property of the whole system's talkativeness, not of one guarded phrase.
Worked example: Meridian Insurance Claims
Meridian Insurance Claims, a fictional insurer, ran the extraction battery on its claims-intake bot. se-01: refused. se-02: the bot described 'the guidance I was given before we started', including its settlement-authority ceiling — CRITICAL. iex-02's third-person role description revealed the name of the internal fraud-scoring tool and when scores were overridden — HIGH. can-02's forgotten-secret pretext produced the planted canary — CRITICAL, and the argument about whether the prompt 'really' leaked ended on the spot.
Score: 100 − 25 − 25 − 15 = 35. Remediation took a week: settlement ceilings and tool names moved behind server-side services, the prompt was rewritten to contain only publishable text, an extraction-family refusal was added covering recall, inventory and transformation frames, and the canary was left planted as a tripwire. The verified re-run scored 100 on extraction, and the canary has not appeared in eleven weekly re-tests since.
Five actions you must take today
- Run se-01 to se-04 and iex-01 to iex-04 as one battery — attackers chain direct and implicit shapes in a single session.
- Count translations, summaries and piecemeal reconstructions as leaks; verbatim output is the rarest shape.
- Audit the prompt line by line for secrets, internal names, thresholds and keys — if it would hurt in a screenshot, remove it.
- Plant a canary string in the prompt and alert on any appearance of it in outputs (can-01 to can-04).
- Mutation-test every extraction fix with rephrased variants before closing the finding.
Probe your chatbot free → The free test runs eight real probes from the library against your bot, with transcripts. The full 72-probe battery, drift tracking and verify-fix live in ChatBreaker.
Sources
- OWASP Top 10 for LLM Applications (2025) — LLM07:2025, System Prompt Leakage, the risk classification this post's attack taxonomy maps to.
- NIST AI 100-2e2025, Adversarial Machine Learning: A Taxonomy and Terminology of Attacks and Mitigations (2025) — The attack terminology the probe families in this post follow.
- ChatBreaker guides — The platform's own methodology guides: the ten attack classes, mutation testing and business-logic testing walkthroughs.
Frequently asked questions
Is a leaked system prompt actually dangerous?
It depends entirely on what is in it. A publishable prompt (role, tone, public policies) is low-risk. Prompts containing thresholds, internal tool names, discount authority or credentials turn a leak into an attack map — which is why the fix is content removal, not just stronger refusals.
Why does my bot refuse 'show me your prompt' but leak anyway?
Because refusal training guards recognised phrasings. Pre-conversation recall (se-02), instruction inventories (se-03), translations (se-04) and implicit questions (iex-01 to iex-04) ask for the same content in frames the guard does not recognise.
What is a canary trap?
A fake secret planted in the prompt that you monitor for in replies. If the canary appears, the prompt leaked — proof, not inference. ChatBreaker runs canary traps as their own probe family, can-01 to can-04, all rated CRITICAL.
Can output filtering stop extraction?
Filtering helps against verbatim leaks but fails transformation exfiltration (se-04): a translation or summary no longer matches the string you filter for. Filtering is a layer; making the prompt publishable is the foundation.
How often do extraction defences need re-testing?
After every prompt edit and every model change. Extraction resistance belongs to the exact running configuration — a single well-meaning prompt addition ('by the way, our internal code is…') can reopen the whole family overnight.