> For the complete documentation index, see [llms.txt](https://docs.collieai.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.collieai.io/security-rules.md).

# Security Rules

- [Security rules overview](https://docs.collieai.io/security-rules/overview.md): How CollieAi security rules work — the input/output guardrails pipeline with 9 rule types for PII redaction, prompt injection blocking, and text processing.
- [Enforcement Mode](https://docs.collieai.io/security-rules/enforcement-mode.md): How CollieAi enforcement mode works — run security rules in monitor mode to observe their impact on live traffic, then promote them to enforce when you're confident.
- [PII detection and redaction](https://docs.collieai.io/security-rules/detecting-pii.md): How CollieAi detects and redacts PII in LLM applications — regex patterns, checksum-validated structured IDs, and dictionary matching for automated PII redaction and data masking.
- [Regex patterns](https://docs.collieai.io/security-rules/detecting-pii/regex-patterns.md): How CollieAi regex rules detect and mask PII — use Python regular expressions or 28 built-in presets to redact emails, secrets, cards, and custom patterns in LLM messages.
- [Structured IDs](https://docs.collieai.io/security-rules/detecting-pii/structured-ids.md): How CollieAi structured-ID detection redacts PII — checksum-validated credit cards (Luhn), IBANs (MOD-97), SWIFT/BIC, and national IDs, with far fewer false positives than regex.
- [Dictionary matching](https://docs.collieai.io/security-rules/detecting-pii/dictionary-matching.md): How CollieAi dictionary matching filters content — fast Aho-Corasick word-list matching for profanity, PII keywords, prompt injection, and custom terms across 23 languages.
- [PII Allowlist](https://docs.collieai.io/security-rules/detecting-pii/pii-allowlist.md)
- [Blocking Threats](https://docs.collieai.io/security-rules/blocking-threats.md): How CollieAi blocks threats in LLM traffic — prompt injection and jailbreak detection, malicious URL filtering, base64 payload detection, and a real-time streaming output guard.
- [Prompt injection](https://docs.collieai.io/security-rules/blocking-threats/prompt-injection.md): How CollieAi detects and blocks prompt injection and jailbreak attempts — fast ML classifiers (Sentinel v2, DeBERTa, PromptGuard) with configurable confidence thresholds.
- [LLM detection](https://docs.collieai.io/security-rules/blocking-threats/llm-detection.md): How CollieAi LLM detection catches prompt injection and off-purpose use — a quick sorting phase and a careful check that reads the conversation for the messages that need it, with prompts you can rewr
- [URL filtering](https://docs.collieai.io/security-rules/blocking-threats/url-filtering.md): How CollieAi URL filtering blocks malicious links — normalize URLs (RFC 3986) and filter by domain, scheme, and port to stop phishing, exfiltration, IP-literal, and SSRF attempts.
- [URL reputation](https://docs.collieai.io/security-rules/blocking-threats/url-reputation.md): How CollieAi URL reputation blocks known-malicious links — exact matching against the abuse.ch ThreatFox and URLhaus threat-intelligence feeds, with freshness, failure policy and exclusions you contro
- [File policy](https://docs.collieai.io/security-rules/blocking-threats/file-policy.md): How the CollieAi file\_policy rule decides what the structural signals of a file attached to a job do — hidden text, hidden sheets, active content, a mismatched type: block, monitor or ignore. Preview:
- [Base64 Payloads](https://docs.collieai.io/security-rules/blocking-threats/base64-payloads.md): How CollieAi detects base64 payloads — identify data URIs and raw base64 in prompts, tool calls, and responses, then block executables, enforce MIME and size limits, and stop exfiltration.
- [Streaming guard](https://docs.collieai.io/security-rules/blocking-threats/streaming-guard.md): How CollieAi's streaming guard delivers real-time GenAI content moderation — classify model output across 8 risk categories and set per-category block, mask, or monitor rules per business need.
- [Text Processing](https://docs.collieai.io/security-rules/text-processing.md): How CollieAi text-processing rules prepare LLM messages — Unicode normalization to defeat obfuscation and language detection to enforce language policies before other rules run.
- [Normalization](https://docs.collieai.io/security-rules/text-processing/normalization.md): How CollieAi normalization defeats text obfuscation — Unicode (NFKC), homoglyph mapping, zero-width removal, and whitespace cleanup so downstream rules see clean, standardized text.
- [Language detection](https://docs.collieai.io/security-rules/text-processing/language-detection.md): How CollieAi language detection filters and routes LLM messages by language — FastText lid.176 across 176 languages, with allowlist/blocklist modes and language context for model routing.
- [Context analysis](https://docs.collieai.io/security-rules/context-analysis.md): Analyze the data you send to the model alongside the prompt — retrieved documents, tool output, records — so an injection hidden in that data is caught, not just one in the user's prompt.
