Key Insights
NIST's adversarial machine learning taxonomy states that current prompt injection mitigations offer no full protection. Hidden context exposure is what an attacker reaches when those mitigations fall short. An application feeds its large language model (LLM) far more than the user ever sees: instructions, policy text, tool definitions and retrieved documents.
The OWASP GenAI Security Project added that risk to its Top 10 for LLM Applications 2026 in August 2026, as LLM08. Teams can assume someone eventually extracts the material, and the damage depends on what was put there: credentials, authorization rules and workflow logic each turn a leak into an incident.
This article explains what counts as hidden context, how attackers pull it out, and how to design an application so disclosure stays harmless.
What Is Hidden Context Exposure?
OWASP's LLM08:2026 entry defines hidden context exposure as unauthorized extraction, inference or reconstruction of the material an application places in a model's context window. It replaced LLM07:2025 System Prompt Leakage and widened that entry beyond the prompt itself. The entry's principle is to keep sensitive data out of the context and to assume all of it is discoverable. An application built that way loses little when its context leaks.
The entry counts exposure as a security problem only when that material increases what an attacker can do. It names what raises the stakes: secrets, policy logic, tools, trust boundaries, workflow criteria and proprietary behavior.
What Counts as Hidden Context?
Hidden context is everything the application places in the model's context window without showing the user. The 2026 entry names the system prompt, developer instructions, retrieved policy text and tool schemas, and an application's agent configuration belongs on the same list:
System Prompts: The hidden role and behavior instructions an application sets for its model.
Tool and Function Schemas: The names, parameters and descriptions of the systems the model can call.
Policy and Guardrail Text: Rules drawn from retrieval-augmented generation (RAG) knowledge bases and configuration stores.
Retrieved Documents: RAG context assembled at runtime from external sources.
Conversation Memory: Stored turns that form part of the working context.
Agent Configuration: Embedded knowledge, tool definitions and call chains held by the agent.
Each item sits in the same window as every other. One successful extraction can return all of them at once.
Why Did OWASP Replace System Prompt Leakage with Hidden Context Exposure?
The 2025 entry was scoped to the system prompt alone, while developer instructions, retrieved policy text and tool schemas sit in the same window and carry the same risk. OWASP's LLM07:2025 System Prompt Leakage entry already said the prompt should not be considered a secret or used as a security control.

Leakage of regulated user or training data stays with LLM02:2026, covered separately under sensitive information disclosure, while agentic amplifications such as persistent memory belong to the agentic applications risk list. Generic application flaws such as server-side log leakage fall outside the 2026 entry altogether.
How Do Attackers Extract Hidden Context?
Extraction needs no breach and no unusual access. A user can ask the model directly, plant an instruction in content it reads, infer hidden rules from how it responds, or read the tool metadata an application already publishes.

Asking the Model Directly
A user can ask the model to repeat, summarize or translate its instructions, and a prompt injection attack can carry the same request inside content the model reads. Asking for a translation or an encoded version often succeeds where a direct request is refused, because a filter watching for verbatim disclosure never sees the words it was built to catch.
Refusal instructions fail inconsistently. A confidentiality instruction sits in the same channel as the attacker's input, and nothing forces the model to rank it above a later request. A defense that passes testing on one deployment does not transfer to the next.
Prompt Injection Through Content
The request does not have to come from the user at all. Indirect prompt injection places it inside content the model ingests, a route that recurs across documented prompt injection examples. The instructions arrive through a separate channel such as documents, emails or websites, often as invisible text, and they inherit the privileges of the AI system that reads them.
A planted instruction can ask the model to disclose the system prompt, tool schemas and retrieved text sitting in its context. Any document, email or web page the model reads becomes a possible extraction channel.
Inference from Model Behavior
Hidden rules can be reconstructed without the model ever printing them. OWASP's 2025 entry notes that attackers will almost certainly determine many guardrails and formatting restrictions by using the application and observing the results. A refusal worded identically every time, or a boundary that flips between two similar requests, exposes the criteria behind it. Refusing to print the prompt therefore hides nothing.
Prompts can also be reconstructed from the output of ordinary queries rather than from a direct request, and a reconstruction that differs in wording while staying close in meaning is still a leak. Exact-match detection will not catch it. Probing of this kind targets the prompt itself, the special characters it uses and the keywords that reveal which functions are reachable.
Tool and Function Descriptions
Metadata the application publishes on purpose can reveal internal systems. In the Model Context Protocol (MCP) specification, clients request a tool list and receive each tool's name, description and input schema.
A tool list reveals which actions an agent can execute and which resources it can reach, such as OneDrive, SharePoint or an exfiltration path like sending email. An attacker can often collect that list by asking the agent which tools it has. MCP treats tool annotations as untrusted unless they come from a trusted MCP server. The content of a description, including any internal hostname or permission it names, remains the application's own responsibility.
What Happens When Hidden Context Leaks?
The damage from a leak depends on what the context held. The common outcomes divide by the kind of material exposed:
Embedded Credentials Become Reusable Access: API keys, database credentials and user tokens held in a prompt reach an attacker who reuses them.
Disclosed Rules Open a Route Around Guardrails: A prompt that reveals its refusal wording gives an attacker the phrasing to avoid, and leaked formatting rules enable improper output handling.
Retrieved Content Exposes Data the User Should Not See: Database rows or PDF text in a RAG context can be extracted through direct prompting.
Role and Tool Details Support Reconnaissance: A prompt stating that an admin role grants full access teaches an attacker the permission model, and exposed tool permissions widen the risks of excessive agency.
Each outcome traces back to what went into the context rather than to a failure of the model. What the context holds limits a leak more than any instruction given to the model.
How Can Teams Reduce Hidden Context Exposure?
Leak tolerance is the design target: a disclosure stays low-impact because secrets and enforcement do not live in the context. Prompt hardening and output inspection lower exposure, but the NIST taxonomy's finding on incomplete mitigation rules either one out as the only control.
Keep Secrets and Authorization Outside the Context
OWASP's 2025 entry recommends moving keys, database names, user roles and permission structures out of system prompts and into systems the model does not directly access. The pattern it describes keeps API tokens in the application: the model emits a tool call naming an action and its arguments, server-side code attaches the credential from a secrets store, and the model never receives the key.
The same entry states that critical controls such as privilege separation and authorization bounds checks must not be delegated to the model. These checks need to run deterministically and be auditable, which OWASP notes LLMs are not currently suited to. Where tasks need different access levels, it recommends separate agents, each holding the least privilege its task requires, with extensions running as the specific user through narrowly scoped OAuth.
Limit What Retrieval Can Pull In
Permission-aware retrieval keeps a leak bounded to what the requesting user could already read. That means access control metadata on every vector chunk, an access check at retrieval time because permissions may change after ingestion, and tenant isolation in shared vector stores. Classifying knowledge base data and accepting it only from verified sources narrows what can enter the index.
For content arriving from outside the organization, NIST lists filtering instructions out of third-party data and spotlighting, which helps models separate trusted from untrusted data. NIST describes both as reducing injection risk rather than removing it.
Monitor Outputs and Test with Red Teaming
OWASP's 2025 entry recommends an independent system that inspects output for compliance rather than an instruction placed inside the prompt. Matching responses against distinctive fragments of the hidden context is one detection layer. Paraphrased or partial leaks carry no matching fragment and pass that layer untouched.
Extraction tests belong in routine security work, not a one-off review. NIST also reports that a small set of fixed queries extracted more than 60% of prompts across certain model and dataset pairs. Extraction testing covers training data, the system prompt, conversation history and whatever retrieval pulled into the context for that request.
Design the Prompt for the Day It Leaks
Asking the model, planting an instruction in a retrieved document, watching how refusals behave, and reading a tool list all reach the same material. The controls that survive are structural: credentials in a secrets store, authorization enforced in code, retrieval filtered by the requesting user's permissions, and output inspected by a separate system. A context window built that way holds nothing worth stealing on the day it is printed in full.
Frequently Asked Questions
What is hidden context exposure?
Hidden context exposure is risk LLM08 in the OWASP Top 10 for LLM Applications 2026, covering unauthorized extraction, inference or reconstruction of the instructions and operational context an application gives its model but hides from users. It becomes a security problem when that context holds secrets, policy logic or tool details an attacker can use.
Is hidden context exposure the same as system prompt leakage?
No, hidden context exposure is the 2026 successor to System Prompt Leakage, which was LLM07 in the 2025 list. The newer entry covers the system prompt along with developer instructions, retrieved policy text and tool schemas. Agentic amplifications such as persistent memory sit on a separate OWASP list.
What is an example of hidden context exposure?
A banking assistant whose hidden prompt states its transaction and loan limits is one example: an attacker who extracts those rules learns exactly where the thresholds sit. A prompt naming the database behind an application is another, since it tells an attacker what to target.
How do you prevent system prompt leakage?
Teams limit the harm instead of relying on secrecy, because prompt-based defenses fail inconsistently across models. They keep credentials and connection strings out of prompts and tool schemas, enforce authorization in application code, filter retrieval by user permissions, inspect outputs with a separate system and repeat red team testing.
Why can't a prompt instruction keep context secret?
A confidentiality instruction is plain text in the same channel as the attacker's input, with no hard boundary forcing the model to rank it above later requests. Attackers also bypass such instructions through translation, encoding, multi-turn persuasion or plain inference from ordinary responses.