Join our Newsletter — 33% off our NHI Course
Home› Glossary› AI Security› LLM07 System Prompt Leakage
AI Security

LLM07 System Prompt Leakage

← Back to Glossary
By NHI Mgmt Group Updated November 26, 2026 Domain: AI Security

LLM07 System Prompt Leakage is the OWASP Top 10 for LLM Applications category where a model's hidden instructions are exposed to users or attackers. The risk lies in what those prompts contain, such as credentials, internal rules or access logic. Defenders keep secrets out of prompts and enforce authorisation outside the model.

What System Prompt Leakage Means in Practice

System prompt leakage is dangerous because hidden instructions are often treated as if they are harmless implementation detail, when in reality they can encode policy, routing logic, escalation rules, or sensitive operational assumptions. Once exposed, that material becomes reusable intelligence for bypass attempts, social engineering, and iterative prompt attacks.

The core issue is not that the prompt is “secret” in a formal sense, but that it may reveal how the application is constrained and where those constraints are weak. If the prompt includes access logic or embedded secrets, disclosure can collapse a defense layer that was assumed to stay invisible.

Why Hidden Instructions Become a Security Boundary Problem

LLM systems often mix instruction text, business rules, and safety logic in a way that is easy to overlook during development. When that content is exposed, attackers can learn what the model is told to refuse, what keywords trigger special handling, and what assumptions the application makes about identity, context, or trust.

This is why system prompts should never be relied on as a security boundary. They may shape behaviour, but they do not reliably enforce authorisation, and they can be exposed through direct prompting, jailbreak-style elicitation, tool-assisted inspection, or leaks from logs and traces. OWASP Top 10 for LLM Applications Guide is a useful parent reference for understanding how this category fits into broader LLM risk management.

How Organisations Reduce Exposure

The strongest control pattern is to keep secrets and access logic out of prompts altogether, then place enforcement outside the model where it can be verified and logged. That usually means brokered credentials, policy checks, gateway enforcement, and tool-layer authorisation rather than trusting prompt wording to hold the line.

This is also where prompt lifecycle discipline matters. Prompts should be treated as production artefacts with review, version control, rollback, and testing, because leakage often follows from poor handling of prompt content rather than from a single exotic exploit. Prompt Lifecycle Management and AI Gateway and LLM Gateway Guide both support that operational model.

When prompts must reference sensitive operations, the safer pattern is to inject credentials or permissions at runtime through a broker rather than embedding them in hidden instructions. Secrets in Prompts vs Brokered Credentials and Runtime Secrets Injection for AI Agents Without Prompt Exposure both reflect that design choice.

Detection and Review After Leakage

Once leakage is suspected, review the prompt as compromised information and look for follow-on exposure in logs, traces, cached responses, screenshots, exported config, or copied prompt templates. The immediate question is not only what was revealed, but what downstream systems were reachable because of the revealed content.

Post-incident review should also ask whether the leaked text disclosed tool names, internal policy wording, canary markers, or authorization paths that help an attacker iterate. AML.T0069 Discover LLM System Information is directly relevant to the reconnaissance side of this problem, while System Prompt Hardening vs External Guardrails helps distinguish brittle prompt-based defenses from controls that still hold after disclosure.

Risk and Threat Considerations

System prompt leakage creates a practical attack path because the prompt often reveals the model’s internal instructions, refusal style, tool names, and operational assumptions. That intelligence can make later prompt injection, extraction, or impersonation attempts more effective, especially when the leaked text includes secrets or access logic.

Failure mechanism: The application treats the hidden prompt as if concealment equals security, but an attacker elicits or extracts it and uses the revealed content to bypass constraints, target tools, or locate embedded secrets.

Impact: Exposure can lead to policy bypass, credential disclosure, unauthorised actions, broader data leakage, and a false sense that the model is enforcing controls it never truly owned.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP API Security Top 10 and MITRE ATT&CK address the attack and risk surface, while OWASP ASVS and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP ASVSV15 — Secure Coding and ArchitectureHidden instructions and control logic are part of secure design for LLM apps.
Recommendation — Keep sensitive logic outside prompts and enforce it in application architecture.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementSystem prompt leakage becomes worse when prompts carry embedded secrets or tokens.
AC-6 — Least PrivilegeLeaked prompts can expose access logic, so privilege must stay constrained outside the model.
Recommendation — Remove secrets from prompts and manage credential lifecycle separately. Apply least privilege to tools, services, and access paths the model can invoke.
OWASP API Security Top 10API5 — Broken Function Level AuthorizationHidden prompt leakage often reveals or weakens function-level access decisions in LLM-backed APIs.
Recommendation — Enforce function authorisation in the API layer, not in the prompt.
MITRE ATT&CKT1552 — Unsecured CredentialsLeakage is especially harmful when prompts contain credentials or secret values.
Recommendation — Search for embedded secrets and remove them from prompt material.

Practitioner Guidance

Why practitioners should care: The safest LLM design is the one that stays secure even when the prompt is visible. That means using prompts for guidance, not for secrets, privilege, or trust decisions.

Practitioner takeaway: If leaking the prompt would meaningfully weaken your security posture, move the sensitive logic out of the prompt and into enforceable controls around the model.

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.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 26, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org