feat: add security email filter to email worker#1446
Conversation
Automatically filter out generic/vague security vulnerability reports and send professional auto-replies explaining our security reporting requirements. Key features: - New 'security' email category for generic vulnerability reports - AI-powered and heuristic-based detection of generic security reports - Auto-reply with clear requirements for valid security reports - Distinguishes between: - Generic reports (e.g., "we found XSS") → auto-reply with requirements - Specific reports with code references (e.g., "line 42 in file.ts") → support - Third-party issues (Supabase, jQuery, Cloudflare) → out of scope The auto-reply explains: - We pay for valid security reports - What we need (specific file paths, line numbers, PoC) - What's out of scope (Supabase, third-party libraries, generic scanner output) - Links to our GitHub repositories This reduces noise from mass security scanner reports and bounty hunters sending vague findings without specific code references. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughAdds a new 'security' email category, detection heuristics, and an AI-driven auto-reply path. The classifier and main email handler route security-classified messages to a specialized flow that generates and sends security-focused responses via Anthropic Claude. Changes
Sequence DiagramsequenceDiagram
participant EmailReceiver as Email System
participant Classifier
participant Router as Main Handler
participant ClaudeAPI as Anthropic Claude
participant MailOut as Mail Sender
EmailReceiver->>Classifier: classifyEmail(parsedEmail)
Classifier->>Classifier: classifyEmailHeuristic(detect security signals)
Classifier-->>Router: return category='security'
Router->>Classifier: generateSecurityAutoReply(env, email)
Classifier->>ClaudeAPI: build prompt & call API
ClaudeAPI-->>Classifier: security auto-reply (subject, text, html)
Router->>MailOut: send auto-reply (with Message-ID)
MailOut-->>Router: send result/status
Router-->>EmailReceiver: log result
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79a8966747
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const validSecurityReportPatterns = [ | ||
| /github\.com\/cap-go/i, // References our GitHub repos | ||
| /cap-go\/capgo/i, | ||
| /cap-go\/website/i, | ||
| /supabase\/functions\/_backend/i, // References our backend code |
There was a problem hiding this comment.
Consider endpoint-only security reports as valid
When AI classification is disabled or unavailable, the heuristic uses validSecurityReportPatterns to decide if a security report should be routed to support. That list only checks for repo/file/path references, so a report that provides a concrete vulnerable endpoint or URL (e.g., /api/... or https://capgo.app/...) but no file path will be treated as generic and auto-replied, potentially dropping actionable reports. Consider treating endpoint/URL evidence as valid in this heuristic so specific vulnerability reports still reach support.
Useful? React with 👍 / 👎.
Auto-formatting changes from linter. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add patterns to recognize security reports that reference specific API endpoints or capgo.app URLs as valid reports, not generic spam. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|


Summary (AI generated)
securityemail category to detect generic/vague security vulnerability reportsMotivation (AI generated)
Security researchers and automated scanners frequently send vague vulnerability reports without specific code references (e.g., "we found Prototype Pollution on your website" without mentioning actual vulnerable code). These generic reports:
The security email filter automatically:
Business Impact (AI generated)
Test Plan (AI generated)
Generated with AI
Summary by CodeRabbit
New Features
Refactor / Improvements
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.