Skip to content
LogoLogo

Guardrails

What a guardrail catches

Guardrails are provided by specialist services. Depending on how yours is configured, it can catch things like:

  • Personal data (names, emails, card numbers, health identifiers)
  • Prompt injection and jailbreak attempts
  • Prohibited topics you define
  • Hate, harassment, violence and sexual content
  • Confidential or off limits phrasing

Where it sits

Loading diagram...

Supported providers

ProviderYou configureCredential
AWS Bedrock GuardrailsAWS region, guardrail ID, guardrail versionIAM role ARN, access key ID, secret access key
Google Model ArmorGCP project ID, location, template IDService account JSON

Set it up

1. Connect a provider (admin)

Sidebar → GuardrailsConnect provider → choose the provider → fill in the configuration and credentials → save.

Studio validates and encrypts the credential. It is never returned by the UI or the API.

Guardrails connections page

2. Attach it to an agent

Agent Builder → Guardrails section → choose the connection, then choose which side it checks.

Attaching needs only Editor on the agent. Every member can read guardrail connections by default, so the picker works for non admins.

The builder Guardrails section with a provider and mode selected

Choosing a mode

ModeChecksGood for
InputOnly what the user sendsStopping prompt injection and blocking sensitive data before it reaches the model
OutputOnly what the agent repliesMaking sure nothing unsafe or confidential reaches the reader
Both (default)Input and outputAlmost every production agent

What happens when a guardrail fires

  1. The run stops at that point.
  2. The user sees a clear message saying the content was blocked.
  3. A guardrail step is written into the run's trace, showing which stage fired and why.

The blocked content is not delivered.

The snapshot rule

When a run starts, the guardrail connection and mode are frozen onto that run. Changing the agent's guardrail afterwards does not rewrite history. A trace from three months ago still shows exactly which guardrail was in force at the time, which is what makes it useful as evidence.

Guardrails are one layer, not the only one

LayerProtects against
GuardrailsUnsafe content going in or out
Tools action selectionAn agent doing something it should not be able to do at all
RBAC, teams and permissionsThe wrong people configuring or running an agent
InstructionsEveryday behaviour and tone
Audit logs and Audit tracesNot knowing what happened

Use all of them. A guardrail is the last line, not the first.

Troubleshooting

ProblemCheck
Everything is blockedThe guardrail policy in the provider console is probably too broad. Tune it there.
Nothing is ever blockedConfirm a connection is actually attached and the mode covers the side you expect.
Model Armor rejects the locationUse a regional location such as us-central1, not global.
Bedrock credential rejectedCheck the role ARN format and that the role can call the guardrail.