<< Home | Work
Prevented accidental commit of API keys twice
| Area | Work |
| AI used | GitHub Copilot |
| Source | r/mcp |
| Posted | 2025-12-09 |
The move
Use the DiffPilot MCP server to review local code diffs and scan for secrets before pushing.Steps
- Install the DiffPilot extension from the VS Code Marketplace.
- Open your project in VS Code and checkout your feature branch.
- Open Copilot Chat and type @workspace #find_secrets to scan for sensitive data.
- Use @workspace #review_code to get a code review of your current branch against main.
Prompt for your AI
Review my current branch changes against the main branch. Focus specifically on [security vulnerabilities and error handling].
What happened
The developer needed to review code changes without creating a GitHub PR or using cloud-based tools. They built DiffPilot, an MCP server that allows Copilot to analyze local git diffs directly in VS Code. This tool enabled them to catch API keys before committing them to the repository.Watch out
Ensure your local environment is configured correctly to allow MCP server execution. Always double-check sensitive files manually as a secondary precaution.Give it to your agent
Read https://howtheyuse.ai/p/prevented-accidental-commit-of-api-keys-twice.md and help me do this.