VS Code Copilot Setup
Agent Keeper integrates with GitHub Copilot's agent mode in VS Code through the experimental agent hook system. Shell commands, file reads, and file writes are sent to Agent Keeper before or after execution.
Copilot agent hooks are currently in Preview and require VS Code 1.92+ with GitHub Copilot Chat 1.230+.
What gets monitored
| Tool | Enforcement |
|---|---|
Shell commands (runTerminalCommand) | Block or warn before execution |
File reads (readFile) | Audit after execution |
File writes (writeFile, applyEdit) | Audit after execution (no pre-execution block) |
| Prompts | Version dependent |
| MCP tool calls | Not available, Copilot does not expose MCP hook events |
| Session check-in | Auto (registered on first event) |
Installation
Get your API key from Settings > API Keys in the dashboard, then run the installer:
export AGENTKEEPER_API_URL="https://YOUR_AGENTKEEPER_URL"
export AGENTKEEPER_API_KEY="ak_live_..."
bash <(curl -fsSL "$AGENTKEEPER_API_URL/install-hooks.sh") --ide copilot
The installer stores the API key in ~/.agentkeeper/config, installs ~/.copilot/hooks/agentkeeper-hook.sh, and writes .github/hooks/agentkeeper.json in the current workspace. It also leaves a compatibility copy at ~/.copilot/hooks/agentkeeper.json.
What gets generated
{
"hooks": {
"PreToolUse": [
{
"type": "command",
"command": "bash \"$HOME/.copilot/hooks/agentkeeper-hook.sh\"",
"timeout": 5
}
]
}
}
For team rollout, deploy the same hook file and Copilot config through your device management tool after validating it against your VS Code and Copilot extension versions.
Tool name mapping
Copilot uses different tool names from Claude Code and Cursor. Agent Keeper normalizes these on ingestion.
| Copilot tool name | Agent Keeper canonical name |
|---|---|
runTerminalCommand | Bash |
readFile | Read |
writeFile | Write |
applyEdit | Edit |
searchFiles | Glob |
searchCode | Grep |
Activity in the dashboard displays the canonical names regardless of which IDE generated the event.
Known limitations
Workspace discovery. VS Code discovers .github/hooks/*.json from the open workspace by default. User-level hooks can be added through VS Code's hook file locations setting when you need machine-wide coverage.
Prompt hooks are version dependent. Copilot's hook surface is still Preview. Some builds expose only pre-tool decisions, while newer builds may include prompt and session events.
No MCP hook events. GitHub Copilot does not expose hooks for MCP tool calls. MCP activity from Copilot is not visible in Agent Keeper.
Preview stability. The Copilot agent hook system is in Preview. Hook behavior, tool names, and config schema may change between VS Code releases. Check the GitHub Copilot changelog when upgrading VS Code.
Verifying coverage
- Open VS Code from the workspace containing
.github/hooks/agentkeeper.json - Ask Copilot to run a terminal command, for example
ls -la - Check the Workstations page. The workstation should appear within a few seconds
- The shell command should be visible in the Activity tab