VS Code agent mode integration
Keep secrets and customer data out of VS Code agent mode
- Prompts: the prompt as the model will get it is masked. On a block rule's match the model gets a notice in its place
- Tool input: masked, or the call denied by a block rule, for every tool. A masked call still goes through the normal permission prompt
- Tool output: masked for every tool, with a block rule's match withheld
- File reads: masked in the view tool's result
In agent mode, VS Code lets Copilot read files, run terminal commands and call tools across your workspace. Whatever it reads can end up in the model's context.
VS Code reads every file in ~/.copilot/hooks, the same directory Copilot CLI uses. The desktop agent writes one file there, maskflare.json, so the same entries cover both. Hook support in VS Code is a preview.
Set up VS Code agent mode with Maskflare
VS Code's agent mode reads the same hook files as GitHub Copilot CLI. The Maskflare desktop agent writes one file that serves both.
# With the desktop agent: the same policy entry as GitHub Copilot
"coding_agent_hooks": { "mode": "enforce", "tools": ["copilot"] }
# One file, read by Copilot CLI and VS Code agent mode
~/.copilot/hooks/maskflare.json
# Without the desktop agent: copy examples/copilot/hooks.json from the
# Python SDK into ~/.copilot/hooks/What gets masked
- Prompts: the prompt as the model will get it is masked. On a block rule's match the model gets a notice in its place
- Tool input: masked, or the call denied by a block rule, for every tool. A masked call still goes through the normal permission prompt
- Tool output: masked for every tool, with a block rule's match withheld
- File reads: masked in the view tool's result
- Your organization's rules, including 232 credential formats, in monitor mode (count only) or enforce mode
Good to know
- There is no separate VS Code setting. Naming copilot in the policy covers both Copilot CLI and VS Code agent mode.
- Hook support in VS Code is a preview, and the hooks have not been checked live against VS Code.
- Whether VS Code shows a denial's reason in the chat pane isn't documented, so a developer may see a refused call without the reason.
- A COPILOT_HOME the user has set moves the hooks directory away from the file the desktop agent writes.
- Prompt-injection detection does not run in the hooks; it runs on MCP traffic through the gateway.
Frequently asked questions
Is VS Code a separate install?
No. The hook file is the same one GitHub Copilot CLI uses, and naming copilot in the agent policy covers both.
Is VS Code agent mode covered as fully as Copilot CLI?
The entries are the same, but VS Code's hook support is a preview and has not been checked live, so treat it as less proven than the other coding agents.
Does it cover other VS Code extensions or AI assistants?
No. It covers Copilot's agent mode through Copilot's hook files.
Other coding agents integrations
See it on your own data
Try Maskflare free.
Bring your hardest prompts.
28-day free trial or 10,000 requests, whichever comes first. Point one app at the gateway or enroll a few laptops,
and watch what gets masked. Or talk to us first.
- SOC 2 Type II: In progress
- ISO 27001: In progress
- EU hosting by default · on-premises available
- Prompts and files never stored
- Never used to train AI models
- GDPR · nDSG · DPA available
- Trust center →