EngineeringNov 27, 2026 3 min

System Prompts Are Not a Vault: Keep Secrets Out of Instructions

Anything placed in a system prompt can eventually be revealed. Move credentials and authorization rules to systems that actually enforce them.

Glowing text instructions escaping from a translucent container
By TrendGuru Research

OWASP lists system prompt leakage as a distinct risk for LLM applications. The core lesson is simple: a system prompt shapes behaviour, but it is not a security boundary. Determined users can often coax a model into revealing or paraphrasing its instructions.

What does not belong in a prompt

  • API keys, passwords or connection strings.
  • Internal role names that reveal privilege structure.
  • Authorization rules the application relies on, such as "only admins may…".
  • Details about filtering logic that help attackers bypass it.

Enforce outside the model

Check permissions in the application before a tool runs. Store secrets in a secret manager and inject them only into the service that needs them. Write prompts on the assumption that they will be published one day; if that would be harmful, the design needs to change.

Sources and scope

Editorial analysis based on OWASP's 2025 guidance on system prompt leakage.

https://genai.owasp.org/llmrisk/llm072025-system-prompt-leakage/

Share this article
Keep Reading

© 2026 TrendGuru AI