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

**URL:** <https://community.sparkflows.ai/t/how-do-i-stop-an-agent-from-leaking-personal-data-or-being-tricked-by-a-prompt/369>\
**Category:** Agentic AI\
**Tags:** faq, genai\
**Created:** [November 5, 2026, 9:51am UTC](https://community.sparkflows.ai/t/how-do-i-stop-an-agent-from-leaking-personal-data-or-being-tricked-by-a-prompt/369 "2026-11-05T09:51:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sanskar](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@Sanskar](https://community.sparkflows.ai/u/Sanskar)\
**Post date:** [November 5, 2026, 9:51am UTC](https://community.sparkflows.ai/t/how-do-i-stop-an-agent-from-leaking-personal-data-or-being-tricked-by-a-prompt/369/1 "2026-11-05T09:51:02Z")

</div>

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](https://docs.sparkflows.ai/en/latest/agentic-ai-guide/safety-guardrails/security-guardrails.html) · [Human in the Loop](https://docs.sparkflows.ai/en/latest/agentic-ai-guide/safety-guardrails/human-in-the-loop.html)
