Function Signature
aguara.go:120
Description
Returns metadata for all available detection rules. This includes:- 148+ built-in rules across 14 categories
- Custom rules from
WithCustomRules()if specified - Rules sorted by ID
- Optional category filtering with
WithCategory()
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | ...Option | Functional options (only WithCategory() and WithCustomRules() apply) |
Return Values
| Type | Description |
|---|---|
[]RuleInfo | Slice of rule metadata (never nil, may be empty) |
Type Definition
Examples
Basic Usage
Filter by Category
Count Rules by Severity
Count Rules by Category
List Critical Rules Only
Generate Rule Documentation
List Custom Rules
Search for Rules by Name
Markdown Table Output
Group Rules by Category
Built-in Categories
| Category | Count | Description |
|---|---|---|
prompt-injection | 22 | Instruction overrides, jailbreaks, delimiter injection |
credential-leak | 19 | API keys, private keys, database strings |
exfiltration | 17 | Webhook exfil, DNS tunneling, file reads |
external-download | 17 | Binary downloads, curl-pipe-shell |
supply-chain | 15 | Download-and-execute, reverse shells |
command-execution | 16 | shell=True, eval, subprocess |
mcp-attack | 12 | Tool injection, name shadowing |
ssrf-cloud | 10 | Cloud metadata, Docker socket |
mcp-config | 8 | Unpinned npx, hardcoded secrets |
unicode-attack | 7 | RTL override, homoglyphs |
indirect-injection | 6 | Fetch-and-follow, remote config |
third-party-content | 5 | Mutable raw content |
toxic-flow | 3 | Taint tracking |
rug-pull | 1 | Tool description changes |
Rule ID Format
Rule IDs follow the patternCATEGORY_NNN:
PROMPT_INJECTION_001- Prompt injection category, rule #1EXFIL_005- Exfiltration category, rule #5CRED_001- Credential leak category, rule #1
Loading Custom Rules
Custom rules are loaded from a directory containing YAML files:Error Handling
ListRules() never returns an error. If rule loading fails:
- Warnings are printed to
stderr - Invalid rules are skipped
- Function returns successfully loaded rules
Performance Notes
- Rules are loaded and compiled on each call
- For repeated calls, consider caching the result
- Typical execution time: < 10ms for 148 rules
Related
- ExplainRule() - Get detailed information about a specific rule
- WithCategory() - Filter rules by category
- WithCustomRules() - Load custom rules
