The AGI Detector is an open-source project designed to be run locally by individual users. Security is a shared responsibility between the maintainers (who provide secure code) and users (who protect their API keys and environment).
| Version | Supported |
|---|---|
| 2.x | β |
| < 2.0 | β |
- SSRF Protection: URL validation prevents crawling of localhost, private IPs, and cloud metadata endpoints
- Safe JSON Parsing: All JSON parsing includes error handling to prevent application crashes
- Input Validation: API endpoints validate all query parameters and request bodies using Zod schemas
- Request Limits:
- Maximum request body size: 1MB
- Maximum response size: 10MB
- Request timeouts: 30 seconds
- Redirect limits: 3 maximum
- Security Headers:
- X-Frame-Options: DENY
- X-Content-Type-Options: nosniff
- Referrer-Policy: strict-origin-when-cross-origin
- X-XSS-Protection enabled
- Browser Security: Playwright launches without dangerous flags (--disable-web-security removed)
- Dependency Management: Regular dependency updates to patch known vulnerabilities
- Uses Prisma ORM with parameterized queries (SQL injection safe)
- No raw SQL queries with user input
- Connection encryption enforced via SSL/TLS
NEVER commit .env files to version control!
Your .env file contains sensitive credentials:
- OpenAI API key
- Database connection strings
- Brave API key
- Firecrawl API key
Best Practices:
- Keep
.envfiles local only - Use different API keys for development and production
- Rotate API keys regularly
- Use read-only database credentials when possible
- Monitor API usage for unusual activity
The crawler is designed to access public AI research sources only. However:
DO:
- β Use the default trusted sources (OpenAI, DeepMind, Anthropic, etc.)
- β Crawl publicly accessible research blogs and papers
- β Respect rate limits and robots.txt
DON'T:
- β Modify the code to crawl localhost or internal network addresses
- β Crawl private or authenticated endpoints
- β Bypass the URL validator
- β Use the crawler for unauthorized data collection
Run these commands regularly to get security patches:
npm update
npm audit fixCheck for vulnerabilities:
npm auditIf you discover a security vulnerability, please report it responsibly:
DO NOT create a public GitHub issue for security vulnerabilities.
Instead, please:
- Email the maintainer at: [security contact - add your email]
- Include:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
We will:
- Acknowledge receipt within 48 hours
- Provide a fix timeline within 7 days
- Credit you in the fix (unless you prefer to remain anonymous)
- Notify users of the security update
For non-critical security improvements or questions:
- Open a GitHub issue with the label
security - Start a GitHub Discussion in the Security category
Security updates are released as:
- Patch versions (2.0.x) for minor security fixes
- Minor versions (2.x.0) for significant security improvements
- Major versions (x.0.0) for breaking security changes
Subscribe to GitHub releases to get notified of security updates.
This tool is designed for local use only. Do not:
- Deploy API endpoints publicly without authentication
- Expose the database to the internet
- Share your instance with untrusted users
If you need multi-user access, implement:
- User authentication (JWT, OAuth, etc.)
- API key authentication for endpoints
- Rate limiting per user
- Role-based access control
This application relies on third-party services:
- OpenAI API: Data sent to OpenAI for analysis
- Firecrawl: URLs sent to Firecrawl for crawling
- Brave Search: Search queries sent to Brave
Privacy Implications:
- Article content is sent to OpenAI for AGI analysis
- Crawled URLs are visible to Firecrawl
- Search terms are visible to Brave
Recommendations:
- Review OpenAI's data usage policy
- Use API keys with appropriate usage limits
- Consider self-hosted alternatives for sensitive use cases
Before submitting a PR, ensure:
- No hardcoded secrets or API keys
- All user inputs are validated
- SQL queries use parameterized statements
- External URLs are validated before fetching
- Error messages don't leak sensitive information
- Dependencies are up to date (
npm auditpasses) - New API endpoints have input validation
- Tests cover security-sensitive code
| Date | Auditor | Type | Findings | Status |
|---|---|---|---|---|
| 2025-10-26 | Internal Review | Full Security Audit | 10 | β Fixed |
October 2025 Security Hardening:
- Added SSRF protection with URL validator
- Implemented safe JSON parsing across all API routes
- Added input validation using Zod schemas
- Fixed browser security flags in Playwright
- Updated vulnerable dependencies (axios, babel)
- Added security headers (X-Frame-Options, etc.)
- Implemented request size limits
- Added comprehensive security documentation
This security policy is part of the AGI Detector project and is licensed under the same MIT License.
Last Updated: October 26, 2025 Policy Version: 1.0