For an overview of all available workflows, see the main README.
The AI Moderator workflow automatically detects spam, link spam, and AI-generated content in GitHub issues, comments, and pull requests. This workflow helps maintain quality discussions and protect your repository from malicious or low-quality contributions.
# Install the 'gh aw' extension
gh extension install github/gh-aw
# Add the workflow to your repository
gh aw add-wizard githubnext/agentics/ai-moderatorThis walks you through adding the workflow to your repository.
You must also choose a coding agent and add an API key secret for the agent to your repository.
You can't start a run of this workflow directly as it is triggered automatically when issues, comments, or pull requests are created.
This workflow works out of the box with sensible defaults. You can customize:
- The labels to apply for different detection types (spam, link-spam, ai-generated, ai-inspected)
- The user roles that are skipped (defaults to admins, maintainers, write access, and triage)
- The bots to skip (defaults to github-actions and copilot)
- Rate limiting settings to control how often the workflow runs
- Detection criteria and thresholds in the workflow prompt
After editing run gh aw compile to update the workflow and commit all changes to the default branch.
- New issues and their content
- Comments on issues and pull requests
- Pull request diffs and file changes
- Repository context to evaluate content relevance
- User information and roles
- Adds labels to issues and pull requests (
spam,link-spam,ai-generated, orai-inspected) - Hides comments that are detected as spam
- Requires
issues: writeandpull-requests: writepermissions (note: the workflow is configured with read-only by default, so you'll need to adjust permissions if you want it to take action)
This workflow does not perform web searches.
- Review labels applied to ensure accurate spam detection
- Monitor for false positives and adjust detection criteria if needed
- Override moderation decisions when the AI makes mistakes
- Validate hidden comments and unhide legitimate content if necessary
- Adjust the workflow configuration based on your repository's needs
- Consider exempting trusted contributors from moderation if desired
- Disable or uninstall the workflow if moderation automation is not providing value