| name | security |
| description | Use for secrets management, credentials handling, and security best practices. |
| triggers | ["security","secrets","credentials","api key","token","env var"] |
Skill: security
This skill covers security best practices for handling secrets and credentials.
Environment Variables
export MODAL_TOKEN_ID=your_token_id
source .env
GitHub Secrets
gh secret list
gh secret set MODAL_TOKEN_ID --body "your_token_value"
gh secret delete MODAL_TOKEN_ID
gh secret set API_KEY --env production --body "value"
GitHub UI Path
- Go to Repository → Settings
- Click Secrets and variables → Actions
- Click New repository secret
Secrets in CI/CD
env:
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
What NOT to Do
| Action | Risk | Alternative |
|---|
| Hardcode tokens | Exposed in repo | Use env vars |
| Commit .env | Secret leak | Add to .gitignore |
| Log secrets | Visible in CI | Use masking: ::add-mask::value |
| Use --body with real token | Shell history | Use file: --body "$(cat token.txt)" |
.gitignore Checklist
Ensure these are ignored:
.env
*.pem
*.key
credentials.json
token.txt
secrets/
Pre-commit Security
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
hooks:
- id: check-json
- id: check-yaml
- id: detect-secrets
Security Scanning
git-secrets --scan
git-secrets --scan-commits
git-secrets --install
Modal Credentials (Modal 1.0+)
modal token new
modal token info
modal token list
Key Rules
- Never commit secrets - Always use .gitignore
- Use GitHub secrets - For CI/CD automation
- Use Modal global config -
modal token new for local (Modal 1.0+)
- Rotate tokens regularly - Especially if compromised
- Mask in logs - Use
::add-mask:: in GitHub Actions