This project uses Husky pre-commit hooks to prevent accidental commits of sensitive data.
The pre-commit hook automatically scans for:
- ✅ API keys (Groq, OpenAI, Anthropic, OpenRouter, etc.)
- ✅ Access tokens
- ✅ Private keys (RSA, EC, DSA, OPENSSH)
- ✅ AWS credentials
- ✅ GitHub/GitLab tokens
- ✅ .mcp.json files (contains API keys)
- ✅ .env files with secrets
cd typescript-mcp
npm install
npm run prepare # Sets up Husky hooks# Run security scan manually
npm run security:check
# Or from project root
node typescript-mcp/scripts/security-scan.jsThe following files are automatically blocked from commits:
| File Pattern | Reason |
|---|---|
.mcp.json |
Contains API keys |
.env |
Environment secrets |
.env.local |
Local environment |
.env.*.local |
Environment overrides |
*.pem |
Private keys |
*.key |
Encryption keys |
credentials.json |
Service account credentials |
- Revoke the secret immediately
- Remove from git history:
git filter-branch -f --index-filter \ "git rm --cached --ignore-unmatch path/to/secret" \ --prune-empty --tag-name-filter cat -- --all git push origin --force - Create new secret and update your configuration
- Use environment variables for all secrets
- Never commit
.envfiles - Use
.env.examplewith placeholder values - Rotate secrets regularly
- Use separate keys for development and production
If you discover a security vulnerability, please:
- Do not open a public issue
- Email: security@codesight.dev (if available)
- Allow 48 hours for response
The security scanner checks for these patterns:
// API Keys
- api_key = "..."
- apikey = "..."
- GROQ_API_KEY = "sk-..."
- OPENAI_API_KEY = "sk-..."
- ANTHROPIC_API_KEY = "sk-ant-..."
- OPENROUTER_API_KEY = "sk-or-v1-..."
// Tokens
- access_token = "..."
- github_token = "ghp_..."
- gitlab_token = "glpat-..."
// Private Keys
- -----BEGIN PRIVATE KEY-----
- -----BEGIN RSA PRIVATE KEY-----
// Cloud Credentials
- AWS_SECRET_ACCESS_KEYAdd security scanning to your CI/CD pipeline:
# GitHub Actions example
- name: Security Scan
run: |
cd typescript-mcp
npm run security:checkFor security-related questions, contact the maintainers.