PromptInjectionGuardrail

PromptInjectionGuardrail parameters and the default prompt injection patterns it checks for.

Parameters

ParameterTypeDefaultDescription
injection_patternsOptional[List[str]]NoneLiteral substrings to check in the input. None or an empty list uses the built-in defaults. Custom patterns must be lowercase.

Matching behavior

The guardrail lowercases the input and checks whether it contains any configured pattern. Patterns are literal substrings, not regular expressions.

Custom patterns are not normalized. Write them in lowercase so they match the normalized input.

Injection patterns

The default list of injection patterns handled by the guardrail are:

  • "ignore previous instructions"
  • "ignore your instructions"
  • "you are now a"
  • "forget everything above"
  • "developer mode"
  • "override safety"
  • "disregard guidelines"
  • "system prompt"
  • "jailbreak"
  • "act as if"
  • "pretend you are"
  • "roleplay as"
  • "simulate being"
  • "bypass restrictions"
  • "ignore safeguards"
  • "admin override"
  • "root access"
  • "forget everything"