Example Rules Configuration#
This directory contains example rule configurations for the moderation system.
Setup#
-
Copy this entire directory to create your production rules:
cp -r rules.example rules -
Edit the files in
rules/to configure your moderation rules:accountAge.ts- Rules for flagging accounts based on ageaccountThreshold.ts- Rules for flagging accounts that exceed thresholdshandles.ts- Pattern matching rules for handles/usernamesposts.ts- Pattern matching rules for post contentprofiles.ts- Pattern matching rules for profile descriptionsconstants.ts- Global allow lists and shared constants
-
The
rules/directory is ignored by git to keep your moderation rules confidential.
Rule Structure#
Each rule type has a specific structure. See the example files for details on required fields and options.
Common Fields#
label- The label to apply when the rule matchescomment- Internal comment/reason for the actionreportAcct/reportPost- Whether to create a reportcommentAcct/commentPost- Whether to add a commenttoLabel- Whether to apply a labelcheck- The pattern/condition to match against
Optional Fields#
whitelist- Patterns that should override the main check (false positives)ignoredDIDs- DIDs exempt from this specific rule
Security#
Never commit the rules/ directory to version control. Keep your moderation rules confidential.