Users discover they can coax an internal assistant into printing its full hidden instruction block, which includes an internal API endpoint and a service token. Which remediation addresses the root cause of this system prompt leakage?
Select an answer to reveal the explanation.
Short Explanation
Writing your safe combination on a sticky note and telling the note to keep quiet doesn't work. Treat the system prompt as something users will eventually read, so you keep secrets out of it entirely. The trap is adding one more "don't reveal this" instruction — that's asking the leaky bucket to hold water.
Full Explanation
System prompt leakage occurs when the instructions given to a language model are revealed to users through direct requests, role-play, or injection. The underlying risk is not the disclosure of wording but what the prompt contains: credentials, internal endpoints, and security rules that the application wrongly relies on the model to enforce. The OWASP guidance for LLM applications is to avoid placing sensitive data in system prompts and to implement security controls, such as authorization, privilege separation, and secret storage, in deterministic systems outside the model. Removing the token and enforcing access in the API itself means a leaked prompt reveals nothing exploitable. Adding an instruction not to reveal the prompt is itself prompt-based, and the same techniques that extracted the prompt can override it. Raising temperature changes output randomness, not confidentiality, and repeated attempts will still surface the content. Rate limiting slows extraction but does not prevent it, since a single successful response can expose the entire block. Exam caveat: assume the system prompt is public; it should guide behavior, not guard secrets. Operational check: rotate the exposed token immediately, move it to a secrets manager, and confirm the internal API rejects calls that lack proper user authorization.