Slide 24 of 27
Part 4 · PreventionSlide 24
Slide 24 ยท Mitigation 6 of 6
Limit what context the model sees in the first place.
๐Ÿ“„ OWASP LLM Top 10:2025 ยท LLM07 Prevention โ€” Access Controls
OWASP โ€” Access Controls
Apply Least-Privilege Principles to Model Context

“Apply the principle of least privilege to system prompts. Only include information that is necessary for the model to perform its intended function. Avoid including sensitive or proprietary information that is not strictly needed.”

The EchoLeak exploit (slide 13) exfiltrated not just the system prompt but the entire context window โ€” including tool definitions, conversation history, and operational metadata. The more context a model holds, the more an injection-based leak can exfiltrate. Least privilege on context is the structural defense against this class of attack.

โ†’ Audit every element of the system prompt: does the model need this to do its job?
โ†’ Remove everything that doesn’t pass that test
โ†’ For multi-tenant deployments, ensure different user sessions cannot share context
โ†’ Apply the same least-privilege thinking to conversation history, retrieved RAG documents, and injected tool output โ€” all of it is in scope for leakage

Print out your system prompt. Highlight everything the model does NOT need to respond to a typical user query. Everything highlighted is extractable surface area that could be removed. Reduce it.

๐Ÿ’ผ Business takeaway

Ask your team whether the AI is given access to the full conversation history and all context in your system โ€” or only what's necessary for the current interaction. The more context the model has access to, the more it can inadvertently reveal.

โ† BackNext โ†’ The Matrix โ€” all mitigations vs all incidents