GitHub Copilot
GitHub Copilot doesn’t let you set a custom API endpoint in its standard configuration. It talks directly to GitHub’s servers, and there’s no setting to change that. Two ways to get protection anyway.Option 1: CLI pre-processing
Use the Takumo CLI to tokenize files before Copilot reads them. This works for any workflow where you’re feeding code to Copilot through chat or inline suggestions.Tokenize your file
Before opening a file that has secrets, tokenize it:The tokenized file has all secrets replaced:
Work with the tokenized file
Open the tokenized file in your editor. Copilot’s suggestions are based on this file — it never sees your real secrets.
Option 2: System-level proxy
Route Copilot’s API calls through a local proxy that sends them through the Takumo gateway. This is more involved but protects everything automatically.Set up the local proxy
Configure your system or editor to route HTTPS traffic through a local proxy:Then start the Takumo proxy:
Which approach to use
| Approach | Pros | Cons |
|---|---|---|
| CLI pre-processing | Simple, no proxy setup, works today | Manual step, doesn’t cover inline suggestions |
| System proxy | Automatic, covers everything | More setup, intercepts all traffic |
Copilot’s tight integration with GitHub means custom endpoints aren’t natively supported. The CLI wrapper gives you protection for files you’re actively working on. The proxy approach is more complete but requires more configuration.
Troubleshooting
Tokenized files confuse Copilot suggestions
Tokenized files confuse Copilot suggestions
Copilot uses surrounding code for context. Tokens look like strings to Copilot, so suggestions still work. If you’re getting odd completions, make sure only the secret values are tokenized — the rest of the code should be unchanged.
Proxy not intercepting Copilot traffic
Proxy not intercepting Copilot traffic
Copilot may bypass system proxy settings. Check:
- VS Code proxy settings are configured (not just system-level)
- The proxy is running (
curl -x http://localhost:8976 https://api.github.com) - Restart VS Code completely after proxy changes
Rehydration produces wrong values
Rehydration produces wrong values
Make sure you’re rehydrating with the same session that tokenized the file. If you tokenized, closed the terminal, and then tried to rehydrate, the session is gone.Keep the same terminal session open, or use the
--session-file flag to persist the vault: