Troubleshoot guardrail violations

Guardrails are built-in safety and reliability checks that help agents respond securely, appropriately, and in accordance with organizational policies.

When a request triggers a guardrail, the agent pauses the request and provides information about the violation. This does not necessarily mean that the request was incorrect. The request may contain content or instructions that introduce safety, security, privacy, compliance, or reliability risks.

The following guardrail violations can occur:

  1. Prompt Safety

  2. Jailbreak Attempt

Review the violation details, update the request, and try again.

Prompt injection

Prompt injection occurs when instructions attempt to change an agent’s intended behavior. It can occur directly through a request or indirectly through content that the agent processes, such as a web page or file. A jailbreak attempt is a type of prompt injection that tries to make the agent ignore its safety protections or operating instructions.

Prompt Safety

A Prompt Safety violation occurs when a request may contain unsafe, harmful, inappropriate, or prohibited instructions.

This can include requests that:

  • Ask the agent to perform unsafe or prohibited actions.
  • Request harmful, malicious, or sensitive content.
  • Conflict with organizational policies.
  • Introduce security, legal, privacy, or compliance risks.
  • Include instructions that are unrelated to the intended task.

  • Include unsafe or misleading instructions in content provided to the agent.

Resolve a Prompt Safety violation

  • Clearly state the business outcome you want to achieve.

  • Remove unsafe, harmful, or prohibited instructions.

  • Separate your instructions from any content you want the agent to review.

  • Remove instructions from external content that are not required for the task.

  • Rephrase the request to ask for guidance, best practices, analysis, or an approved action.

  • Submit the request again.

Jailbreak Attempt

A Jailbreak Attempt violation occurs when a request appears to bypass the agent’s instructions, safety protections, security controls, or intended behavior. Jailbreak attempts can use direct instructions, hidden content, encoded text, multiple languages, or other techniques intended to avoid safety checks.

This can include requests that attempt to:

  • Override system instructions.

  • Tell the agent to ignore previous instructions or policies.

  • Disable safety protections.

  • Reveal hidden prompts, policies, or internal configuration.

  • Make the agent operate outside its intended capabilities.

  • Get around organizational controls or guardrails.

  • Hide instructions by using encoded text, unusual characters, or other unclear methods.

Resolve a Jailbreak Attempt violation

  • Ask directly for the information or task you need.

  • Remove instructions that tell the agent to ignore rules, policies, or previous instructions.

  • Remove requests for hidden prompts, system messages, or internal configuration.

  • Replace encoded, hidden, or unclear instructions with plain language.

  • Focus on the required business outcome rather than changing how the agent operates.

  • Submit the request again.

Best practices for writing requests

To reduce guardrail violations:

  • Use clear and specific instructions.

  • Include only the information required for the task.

  • Clearly identify content that the agent must review or summarize.

  • Review copied, attached, or external content before submitting it.

  • Remove instructions from external content that conflict with the intended task.

  • Request only actions permitted by your organization.

  • Review agent output before using it to make decisions or complete sensitive actions.

Troubleshoot content moderation errors