Quality and safety

Prompt Security

A prompt is not a security boundary. Models follow instructions they find anywhere in their context, including in user input, retrieved documents, and tool results. Secure AI applications combine careful prompts with controls the model cannot override.

What Is Prompt Injection?0:48 · beginner

Prompt injectionBeginner

Direct injection is a user typing “ignore previous instructions”. Indirect injection hides instructions in content the model reads: a web page, an email, a PDF, a tool result. Both try to make the model act against its instructions.

Secret and data leakageBeginner

People paste API keys, passwords, and personal data into prompts. Once sent, that data has left your control. PromptFlowEngine detects common secrets and personal data before sending and can replace them with placeholders.

Controls that do not depend on the modelIntermediate

  • Validate and authorize every tool call in code
  • Give tools the narrowest credentials possible
  • Filter retrieved content by tenant and permission
  • Validate model output (schemas, allow-lists) before acting on it
  • Redact or block sensitive data before it reaches a provider
  • Version prompts and record what was sent (metadata, not content)

Security testingAdvanced

Keep a corpus of injection attempts and run it against every prompt change, like a regression test. Signature-based detection catches known patterns but can miss new ones, so layer it with the controls above.

Key takeaways

  • Treat all non-system content as untrusted.
  • Enforce rules in code, not only in wording.
  • Test with an injection corpus on every change.
Check a prompt’s Security tab in the WorkspaceTry the security Demo Center