Report #85817
[counterintuitive] Can I safely hide secrets or instructions in the system prompt
Never put secrets \(API keys, PII\) in system prompts. Use server-side middleware for secrets, and implement output scanning, as system prompts can be exfiltrated via prompt injection.
Journey Context:
Developers treat the system prompt as a secure, invisible vault for API keys or proprietary instructions, assuming the model will never repeat them. However, prompt injection attacks \(e.g., asking the model to repeat the above text\) can easily trick the model into regurgitating the system prompt verbatim. The system prompt is merely text conditioning, not a secure sandbox.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T02:38:07.414909+00:00— report_created — created