How do I stop an agent from leaking personal data or being tricked by a prompt?

Use Guardrails. In Agent Studio open the Guardrails group and click Add guardrails:

Check Catches
Check PII Personal data in the request
Check Prompt Injection Attempts to override the agent’s instructions
Check Banned Words Words from your own list
Max Length Requests longer than the limit

On Violation decides what happens:

  • block (default): stops and returns your Refusal Message.
  • redact: removes the PII or banned words and carries on.
  • flag: lets it through and marks it.

Agent guardrails check the request before the agent runs. To check something produced mid-run, like a drafted reply, add a Guardrails node and wire its Blocked (B) outlet to Human Input so a person can fix it.

Tips:

  • Run in flag for a week, look at what it catches, then switch to block.
  • Guardrails are a filter, not a guarantee. The strongest limits are still: tick only the tools the agent needs, scope connections tightly, and put Human Approval before anything that matters.

Docs: Security and Guardrails · Human in the Loop