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:
-
Prompt Safety
-
Jailbreak Attempt
Review the violation details, update the request, and try again.
Jump to:
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
Issue
This error occurs in the Agent action when the input triggers a content moderation policy. The action does not process the request or return output.
Cause
This error occurs when the request contains content or instructions detected by the Prompt Safety guardrail. This can include requests that:
-
Ask the agent to generate prohibited or unsafe content.
-
Attempt to test or bypass safety protections.
-
Ask the agent to reveal restricted information.
-
Introduce security, privacy, legal, or compliance risks.
Resolution
Follow these steps to resolve the error:
-
Review the request and remove unsafe, prohibited, or unnecessary instructions.
-
Remove instructions that attempt to test or bypass safety protections.
-
Clearly describe the required business outcome.
-
Update the request and run the Agent action again.
Issue
This error appears in the workflow instance activity when the Agent action receives a 403 response from the connector.
Cause
This error occurs when the Agent action input triggers the Prompt Safety guardrail.
The connector rejects the request and returns the following message: Input violates content moderation policies. Input: [prompt_safety]
Note: The message displayed in the instance activity might be shortened.
Resolution
Follow these steps to resolve the error:
-
Review the Agent action input that caused the error.
-
Remove unsafe, prohibited, or restricted instructions.
-
Remove instructions that attempt to bypass or test safety protections.
-
Rewrite the request to focus on the required business outcome.
-
Run or resubmit the workflow with the updated request.