AutoTreasury AI handles sensitive treasury funds and private keys. Security is our top priority.
- NEVER commit
.envfiles to git - ALWAYS use
.env.exampleas a template only - NEVER include actual private keys or API keys in code
-
PRIVATE_KEY - Your BNB wallet private key
- Keep this absolutely secure
- Use a dedicated wallet for development
- Never reuse production keys in development
-
OPENAI_API_KEY - Your OpenAI API key
- Protect this key - it has billing implications
- Use environment-specific keys
- Rotate keys regularly
-
DATABASE_URL - Database connection string
- Use strong passwords
- Restrict network access
- Enable SSL/TLS for connections
-
.envis listed in.gitignore - No hardcoded credentials in source code
- Test wallets only contain test tokens
- API keys have appropriate rate limits
- Database uses strong authentication
-
Use Test Networks
- Always test on BSC testnet first
- Use test BNB from faucets
- Never test with real funds
-
Code Quality
- Follow Solidity best practices
- Use latest stable compiler version
- Enable all compiler warnings
-
Testing
- Write comprehensive unit tests
- Test edge cases and failure scenarios
- Use fuzzing for critical functions
- Complete security audit
- All tests passing
- Gas optimization review
- Access control verification
- Reentrancy protection verified
- Integer overflow protection
- External call safety checked
-
Authentication
- Implement proper API authentication
- Use JWT or similar tokens
- Rotate secrets regularly
-
Rate Limiting
- Prevent API abuse
- Implement per-user limits
- Monitor for suspicious activity
-
Input Validation
- Validate all user inputs
- Sanitize data before processing
- Prevent injection attacks
-
Wallet Connection
- Use WalletConnect or similar
- Never request private keys
- Clear sensitive data on disconnect
-
Data Handling
- Validate addresses before transactions
- Confirm all actions with users
- Display transaction details clearly
-
Regular Updates
pnpm audit pnpm update
-
Audit Dependencies
- Review package.json regularly
- Remove unused dependencies
- Check for known vulnerabilities
-
Lock Files
- Commit pnpm-lock.yaml
- Review changes in lock files
- Use exact versions for critical packages
DO NOT open a public issue. Instead:
- Email security contact (to be added)
- Provide detailed description
- Include steps to reproduce
- Suggest a fix if possible
- 24 hours: Initial acknowledgment
- 7 days: Assessment and timeline
- 30 days: Fix and disclosure (coordinated)
- Use separate wallets for dev/test/prod
- Enable 2FA on all accounts
- Keep development machines secure
- Use VPN for sensitive operations
- Use hardware wallets for mainnet deployments
- Implement multi-sig for treasury contracts
- Test deployment scripts on testnet first
- Have rollback procedures ready
- Monitor contract events
- Set up alerts for unusual activity
- Track gas prices for deployments
- Log all API access
This security policy will be updated as the project evolves. Last updated: 2026-02-19
Remember: Security is everyone's responsibility. When in doubt, ask!