Part 6 · LLM Application Security
LLM08: Hidden Context Exposure
Anything placed in a model's hidden context may be discovered, so it must never be what keeps a system secure.
What it is
Hidden context exposure is the unauthorized extraction, inference, or reconstruction of system instructions and operational context. In 2026, this entry replaced and broadened System Prompt Leakage.
Hidden context includes the system prompt, developer instructions, retrieved policy text, and tool schemas. Exposure matters most when that context contains secrets or reveals rules an attacker can exploit.
How the attack unfolds
The leak is rarely the final harm. The danger is what the leaked context enables next.
What can be exposed
- Secrets: credentials or internal URLs placed in a prompt.
- Decision rules: refund limits, escalation criteria, or filtering logic.
- Tool schemas: names and parameters that map the attack surface.
- Retrieved policy: internal guidance added to the context at runtime.
Real-world case
In February 2023, a student used prompt injection to make Bing Chat reveal its internal instructions and the codename "Sydney".
Defenses
- Keep secrets out of context. Assume anything the model can read may be revealed.
- Enforce rules deterministically. Do not make the prompt the only control.
- Authorize independently. Apply access control outside the LLM.
- Design for publication. The system should remain safe if its prompt became public.
- Monitor extraction attempts. Treat repeated probing as a signal.
Common misconception
"Telling the model to keep its prompt secret protects it."
That instruction can be bypassed. Security must not depend on the prompt staying hidden.
Key takeaways
- Hidden context may be extracted or inferred.
- Never place secrets in a prompt.
- Critical rules must be enforced outside the model.