This tool has been designed with security and privacy in mind. Please review the following important information:
When using remote AI providers (like OpenAI), this tool transmits the following data:
- List of changed files in your commits
- Git diff content (up to 8KB per commit)
- Commit messages
Important Privacy Considerations:
- This data may include sensitive information such as source code, credentials, configuration files, or proprietary data
- All data transmitted to remote providers is subject to their privacy policies and terms of service
- Consent is required: The tool will prompt for explicit consent before sending data to remote providers
- Automatic redaction: Common sensitive patterns (API keys, passwords, private keys, etc.) are automatically redacted before transmission
For maximum privacy and security:
- Use Ollama with local models (no data leaves your machine)
- Configure hooks with:
git config hooks.commitProvider ollama - Install Ollama: https://ollama.ai
All git hooks in this project follow these security practices:
- Opt-in by default: Hooks must be explicitly enabled via git config
- No automatic history rewrites: Post-commit hook requires opt-in via
git config hooks.postCommitRewrite true - Secure argument handling: All user input is properly quoted to prevent shell injection
- Backup creation: Backups are always created before history rewrites (never use
--skip-backupin production)
# Enable prepare-commit-msg (generates messages for new commits)
git config hooks.prepareCommitMsg true
# Enable post-commit (improves messages after commits)
git config hooks.postCommitRewrite true
# Use local processing with Ollama (recommended for sensitive repos)
git config hooks.commitProvider ollamaThe tool automatically redacts common sensitive patterns:
- API keys (OpenAI, GitHub, Slack, AWS, etc.)
- Private keys (RSA, DSA, EC)
- Passwords in common formats
- AWS credentials
- Base64-encoded secrets
However, you should still:
- Review diffs before committing
- Never commit secrets or credentials
- Use
.gitignoreto exclude sensitive files - Consider using local processing (Ollama) for highly sensitive repositories
To minimize supply chain risks:
- Review the hook scripts before installation
- The tool uses standard npm package management
- Hooks use
npxto run the tool (ensure you trust the package source) - For maximum security, audit the source code or use a vendored/pinned version
If you discover a security vulnerability in this project, please report it by:
- Opening a private security advisory on GitHub
- Emailing the maintainers (see repository for contact info)
- Do not open public issues for security vulnerabilities
-
For sensitive repositories:
- Use Ollama for local processing
- Audit what data is being transmitted
- Review the tool's source code
-
For team repositories:
- Coordinate hook usage with your team
- Document which hooks are enabled
- Use consistent git config settings
-
General recommendations:
- Never use
--skip-backupexcept in testing - Review AI-generated messages before pushing
- Keep the tool updated for latest security fixes
- Use
--dry-runto preview changes
- Never use
This tool implements privacy by design principles:
- Minimal data collection: Only necessary data is transmitted
- Explicit consent: Users must consent to remote API calls
- Data redaction: Sensitive patterns are automatically redacted
- Local alternative: Ollama provides full functionality without remote calls
- Transparency: All data transmission is logged and visible
For production use, consider pinning the tool version:
# In package.json
"devDependencies": {
"git-rewrite-commits": "0.4.0"
}Or in hooks, use:
npx [email protected] --stagedThis prevents automatic updates that could introduce vulnerabilities.