What Are Rules?
Rules are security patterns that detect specific threats in your code. Each rule:- Has a unique ID (e.g.,
PROMPT_INJECTION_001) - Targets specific file types (
.md,.txt,.yaml, etc.) - Matches against regex or substring patterns
- Reports findings at one of 5 severity levels: CRITICAL, HIGH, MEDIUM, LOW, INFO
- Belongs to a category (e.g.,
prompt-injection,credential-leak) - Includes remediation guidance for fixing the issue
Listing Rules
View all available rules from the CLI:Explaining Rules
Get detailed information about a specific rule:- Full description
- Detection patterns (regex and contains)
- Example true positives and false positives
- Remediation guidance
- Severity and category
Rule Categories
The 177 rules are organized into 13 categories:| Category | Rule Count | Focus Area |
|---|---|---|
| Credential Leak | 22 | API keys, tokens, private keys |
| Prompt Injection | 22 | Instruction overrides, jailbreaks |
| Supply Chain | 21 | Download-execute, reverse shells |
| External Download | 16 | Binary downloads, auto-installs |
| MCP Attack | 16 | Tool injection, capability escalation |
| Data Exfiltration | 16 + NLP | Webhook exfil, DNS tunneling |
| Command Execution | 15 | shell=True, eval, subprocess |
| MCP Config | 11 | Unpinned packages, hardcoded secrets |
| Indirect Injection | 11 | Remote config, fetch-and-follow |
| SSRF & Cloud | 11 | Metadata URLs, internal IPs |
| Third-Party Content | 10 | Unsafe eval, missing SRI |
| Unicode Attack | 10 | RTL override, homoglyphs |
| Toxic Flow | 3 | Source-to-sink taint tracking |
How Rules Work
Pattern Matching
Most rules use regex or substring matching:Match Modes
Rules can require any pattern to match (OR logic) or all patterns (AND logic):Exclude Patterns
Rules can suppress matches in specific contexts:Code Block Awareness
In markdown files, findings inside fenced code blocks (```) are automatically downgraded one severity level:
- CRITICAL → HIGH
- HIGH → MEDIUM
- MEDIUM → LOW
- LOW → INFO
Disabling Rules
Disable specific rules from the CLI:.aguara.yml:
Overriding Severity
Adjust severity for specific rules:NLP-Based Rules
The NLP Analyzer (markdown-only) detects prompt injection patterns using structural analysis:| Rule ID | What It Detects |
|---|---|
NLP_HEADING_MISMATCH | Benign heading followed by dangerous content |
NLP_AUTHORITY_CLAIM | Section claims authority with dangerous instructions |
NLP_HIDDEN_INSTRUCTION | HTML comment contains action verbs |
NLP_CODE_MISMATCH | Code block labeled safe but contains executable content |
NLP_OVERRIDE_DANGEROUS | Instruction override + dangerous operations |
NLP_CRED_EXFIL_COMBO | Credential access + network transmission |
Toxic Flow Rules
The Taint Tracker detects dangerous data flows:| Rule ID | Source → Sink Flow |
|---|---|
TOXIC_001 | User input → shell execution (no sanitization) |
TOXIC_002 | Environment variable → shell command |
TOXIC_003 | API response → code evaluation |
Next Steps
Browse All Categories
See all 13 categories with rule counts and descriptions
Write Custom Rules
Extend Aguara with your own YAML detection rules
