Custom Rules
Custom rules let you extend Sieve’s built-in moderation with rules specific to your platform. Block game-specific slurs that general models miss, allow terms that are false positives for your community, or match complex patterns with regex.
Rule Types
Section titled “Rule Types”Match exact words or phrases. Sieve handles Unicode normalization and leetspeak variants automatically.
Match patterns using regular expressions. For complex patterns that wordlists can’t capture.
Prevent specific words or phrases from being flagged. Override false positives from the AI tier.
Wordlist Rules
Section titled “Wordlist Rules”Wordlist rules match exact words or phrases. Sieve automatically normalizes Unicode and decodes leetspeak before matching, so you don’t need to add every variant manually.
curl -X POST https://api.getsieve.dev/v1/config/rules \ -H "Authorization: Bearer mod_live_your_key" \ -H "Content-Type: application/json" \ -d '{ "type": "wordlist", "action": "block", "category": "spam", "words": ["buy gold cheap", "account for sale", "boosting service"], "priority": 10 }'Use cases:
- Game-specific slurs or offensive terms not in general datasets
- Known scam phrases specific to your platform
- Brand-specific terms that should always be blocked
- Competitor names in contexts where they indicate spam
Regex Rules
Section titled “Regex Rules”Regex rules match content against regular expressions. Use these for patterns that can’t be expressed as simple word lists.
curl -X POST https://api.getsieve.dev/v1/config/rules \ -H "Authorization: Bearer mod_live_your_key" \ -H "Content-Type: application/json" \ -d '{ "type": "regex", "action": "flag", "category": "spam", "pattern": "\\b\\d{2,}k\\s*gold\\s*(for\\s*)?\\$\\d+", "priority": 5 }'Use cases:
- Matching price patterns in RMT spam (“10k gold $5”)
- Detecting URLs with specific domain patterns
- Complex obfuscation patterns unique to your platform
- Matching structured data patterns (phone numbers, crypto wallet addresses)
Allowlist Rules
Section titled “Allowlist Rules”Allowlist rules prevent specific terms from triggering moderation. Use these to fix false positives where legitimate terms in your community get flagged by the AI tier.
curl -X POST https://api.getsieve.dev/v1/config/rules \ -H "Authorization: Bearer mod_live_your_key" \ -H "Content-Type: application/json" \ -d '{ "type": "allowlist", "words": ["assassin", "killer bee", "execute order"], "priority": 100 }'Use cases:
- Game character names that contain violent terms (“Assassin’s Creed”)
- In-game abilities with aggressive names (“Execute,” “Backstab”)
- Community slang that sounds offensive out of context
- Technical terms that trigger false positives
Priority Ordering
Section titled “Priority Ordering”Rules are evaluated in priority order (higher number = evaluated first). This matters when rules conflict:
| Priority | Rule | Action |
|---|---|---|
| 100 | Allowlist: “assassin” | Allow |
| 10 | Wordlist: offensive terms | Block |
| 5 | Regex: spam patterns | Flag |
| 0 | Default pipeline | Evaluate |
A higher-priority allowlist rule will override a lower-priority wordlist block. Use this to create nuanced rule sets:
- High priority (100+): Allowlists for known false positives
- Medium priority (10-50): Wordlists for must-block terms
- Low priority (1-9): Regex patterns for soft matching
Managing Rules
Section titled “Managing Rules”List Rules
Section titled “List Rules”curl -X GET https://api.getsieve.dev/v1/config/rules \ -H "Authorization: Bearer mod_live_your_key"Delete a Rule
Section titled “Delete a Rule”curl -X DELETE https://api.getsieve.dev/v1/config/rules/rule_abc123 \ -H "Authorization: Bearer mod_live_your_key"Update a Rule
Section titled “Update a Rule”curl -X PUT https://api.getsieve.dev/v1/config/rules/rule_abc123 \ -H "Authorization: Bearer mod_live_your_key" \ -H "Content-Type: application/json" \ -d '{ "words": ["buy gold cheap", "account for sale", "boosting service", "power leveling"], "priority": 15 }'