# Pass raw regex to the PII guardrail

> The PII guardrail's custom_patterns now accepts raw regex strings and compiles them for you, so you can add a pattern inline instead of pre-compiling it yourself.

- Published: 2026-06-23
- Author: Agno Team
- Category: Changelog
- Canonical: https://agno-com-nine.vercel.app/articles/pass-raw-regex-to-the-pii-guardrail
- Markdown: https://agno-com-nine.vercel.app/articles/pass-raw-regex-to-the-pii-guardrail.md

The PII guardrail's `custom_patterns` now accepts raw regex strings and compiles them for you, so you can add a pattern inline instead of pre-compiling it yourself. Extending PII detection with your own rules takes one less step.

View the [PII Detection Guardrail docs](https://docs.agno.com/guardrails/included/pii) for more.
