They should remove credentials, internal rules, and hidden routing logic from prompts and place them in governed external systems. A prompt should steer behaviour, not act as a secrets store. Security teams should also assume prompts can be inferred through model responses, so prompt content needs the same review discipline as other sensitive control logic.
Why system prompts should not be treated as a secrets store
System prompts are control inputs, not a safe place to keep credentials, internal routing logic, or hidden policy rules. If a prompt contains sensitive material, it becomes harder to govern, easier to copy into logs or traces, and more likely to surface through model behaviour. Treat the prompt as part of the exposure boundary, not as protected storage.
That is why prompt content should be reviewed with the same discipline used for other sensitive control logic. If the model can influence decisions from the prompt, then the prompt already has security value, and anything embedded in it needs explicit ownership, review, and a removal path.
What belongs outside the prompt
The cleanest pattern is to keep the prompt focused on behaviour and move sensitive material into governed external systems. Use the prompt to describe intent, constraints, and safe operating rules, while keeping credentials, secrets, and privileged lookup logic in systems designed for access control and auditability.
This separation matters because prompt text is easy to duplicate, harder to rotate, and often visible to more people and tools than teams expect. A model prompt should not carry the same burden as a secret manager, policy engine, or privileged workflow service. The more a prompt starts to contain hidden rules or embedded access data, the more it becomes an operational liability.
For teams building or reviewing AI workflows, the OWASP LLM07 System Prompt Leakage Guide is a useful reference for separating prompt steering from secret handling, and for keeping sensitive controls outside the model boundary.
How to review prompts for exposure and leakage risk
Review prompts as if an attacker, tester, or curious user could eventually infer them through outputs, logs, or indirect model behaviour. The practical question is not only whether the prompt contains a secret today, but whether it could reveal one through repetition, summarisation, fallback handling, or prompt extraction attempts.
Teams should also check where prompts are stored, copied, versioned, and observed. Prompt repositories, evaluation traces, support tooling, and debug output can all become unplanned distribution channels for sensitive content. That is especially true when prompts include hidden routing logic, escalation conditions, or special handling for particular users, because those patterns are often easier to infer than teams assume.
For AI systems that carry operational data through prompts or traces, the Generative AI Data Loss Prevention Guide and the LLM Security Guide both reinforce the need to control prompt redaction, leakage, and output handling together rather than as separate problems.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 and OWASP API Security Top 10 address the attack and risk surface, while NIST SP 800-53 Rev 5 sets the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 — Secret Leakage | System prompts can expose secrets embedded as control text or credentials. |
| NHI-07 — Long-Lived Secrets | Sensitive material in prompts is harder to rotate and governs access too broadly. | |
| Recommendation — Remove secrets from prompts and store them in governed secret-management systems. Keep prompt contents free of long-lived secrets and rotate exposed material immediately. | ||
| OWASP API Security Top 10 | API8 — Security Misconfiguration | Leaking hidden routing logic through prompts is a configuration and access-control weakness. |
| Recommendation — Move routing and policy enforcement out of prompts into controlled backend logic. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | Credentials referenced in prompts must be managed, rotated, and protected outside the model. |
| AU-3 — Content of Audit Records | Prompt logging can capture sensitive prompt content and hidden control logic. | |
| Recommendation — Manage any credentials used by AI workflows through formal lifecycle and rotation controls. Limit logged prompt content and exclude sensitive values from audit records. | ||
Practitioner Guidance
What to prioritise: remove any prompt content that would be damaging if exposed, then decide whether the remaining prompt still behaves correctly when the sensitive logic is externalised. If the answer changes materially, the prompt was doing too much.
What to verify: confirm that sensitive rules are enforced by governed systems, not merely described in the prompt, and that prompt storage, logging, and debugging paths do not reintroduce the same exposure. The control should remain effective even when the prompt is copied, inspected, or partially reconstructed.
Common mistake: teams often redact obvious secrets but leave behind policy shortcuts, routing hints, and exception logic that still disclose how the system works. That residue is often enough to create leakage, abuse, or social engineering risk.
Practitioner takeaway: design prompts to instruct behaviour, not to concentrate sensitive knowledge. If a rule, credential, or routing decision matters enough to protect, it usually belongs in a governed control plane rather than in the text the model sees.
Related resources from NHI Mgmt Group
- Sensitive Data
- How should security teams govern browser-based AI prompts that may contain sensitive data?
- How should security teams handle PCI-sensitive data in collaboration tools and AI prompts?
- How should security teams handle Amazon Machine Images that may contain sensitive data before sharing them more broadly?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 5, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org