Subscribe to the Non-Human & AI Identity Journal

Prompt Hygiene

The discipline of deciding what can and cannot be shared with an AI tool during prompting. It covers sensitive data exclusion, approved use cases, and review expectations so that employees do not turn chat interfaces into uncontrolled data sinks.

Expanded Definition

Prompt hygiene is the practical discipline of controlling what information enters an AI prompt, who is allowed to prompt a system, and what review or approval is required before sensitive content is shared. In NHI and agentic AI environments, it is not just about etiquette. It is a governance control that reduces accidental disclosure of secrets, customer data, internal architecture, credentials, and operational instructions to tools that may log, retain, or reuse input. Guidance varies across vendors on what counts as acceptable prompt content, so organisations should treat prompt hygiene as a policy-backed behaviour, not an informal best practice.

It is closely related to data loss prevention, acceptable use, and access governance, but it is narrower than general security awareness because it focuses on the prompt as a decision point. Strong prompt hygiene also supports the intent of the NIST Cybersecurity Framework 2.0, especially around data protection and governed access. The most common misapplication is assuming users can sanitize prompts ad hoc, which occurs when organisations deploy AI tools without clear rules for secrets, regulated data, or escalation paths.

Examples and Use Cases

Implementing prompt hygiene rigorously often introduces friction for staff, requiring organisations to weigh faster AI-assisted work against the cost of stricter review and lower convenience.

  • A support analyst asks an AI assistant to draft a troubleshooting plan using a redacted ticket, rather than pasting the full ticket with API keys and customer identifiers.
  • A developer uses approved prompt templates for code review and explicitly excludes repository secrets, build tokens, and internal endpoint names.
  • A security team documents which use cases may include operational context and which require human review before any prompt is submitted, aligned with the governance approach described in the Ultimate Guide to NHIs.
  • An AI agent receives only the minimum task context needed to act, rather than full mailbox access or broad incident-response notes, reducing unintended exposure.
  • Compliance teams restrict prompts involving regulated records and require escalation when a user cannot complete the task without sensitive source material.

These patterns reflect the same discipline organisations use to keep secrets out of uncontrolled locations. NHI Mgmt Group notes that 79% of organisations have experienced secrets leaks, with 77% of those incidents causing tangible damage, which shows how quickly a casual prompt can become a security event. For broader AI governance context, the NIST Cybersecurity Framework 2.0 is a useful reference point for mapping policy to operational controls.

Why It Matters in NHI Security

Prompt hygiene matters because AI tools often sit close to the same information flows that expose NHIs in the first place: tokens, keys, service account details, deployment instructions, and incident context. If employees are not trained to exclude secrets from prompts, the organisation can inadvertently create a second copy of sensitive material in chat logs, model traces, or third-party retention systems. That is especially dangerous when the prompt includes credentials used by service accounts or automation pipelines, since compromise can spread from a single conversation into production systems.

This term also matters because NHI risk is already widespread. NHI Mgmt Group reports that 80% of identity breaches involved compromised non-human identities such as service accounts and API keys, and 96% of organisations store secrets outside secrets managers in vulnerable locations. Prompt hygiene helps reduce the chance that those same assets are exposed through casual AI use. It also supports zero trust expectations by forcing explicit decisions about data sharing rather than assuming trust in the chat interface. Organisations typically encounter the consequences only after a prompt has exposed a secret, at which point prompt hygiene becomes operationally unavoidable to address.

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 Agentic AI Top 10 address the attack and risk surface, while NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-02 Prompt hygiene limits secret exposure and uncontrolled sharing in AI-assisted workflows.
NIST CSF 2.0 PR.DS Prompt hygiene supports data security by reducing accidental disclosure of sensitive information.
OWASP Agentic AI Top 10 JSON null Agentic systems need input boundaries so prompts do not expose data or expand tool misuse.

Prevent secrets in prompts and enforce approved disclosure rules for all AI interactions.