Grok
Route Grok's shell commands into the sandbox with a project hook.
boxer adds a hook to Grok that rewrites each intercepted command to boxer run.
Set up
boxer install grok
git add .grok .mcp.json .agents
git commit -m "Run Grok's commands in boxer"Grok loads project hooks only from a trusted folder. Launch it once with --trust. For headless
runs, set GROK_FOLDER_TRUST=0.
boxer doctor cannot see whether Grok trusts the folder. The check below is the only proof the hook
runs.
What it writes
| File | What it is |
|---|---|
.grok/hooks/boxer.json | the hook that rewrites commands |
.mcp.json | the boxer MCP server |
.agents/skills/boxer/ | the skill that tells Grok how commands run here |
Check it
boxer doctorThen ask Grok to run node -p process.platform. It prints linux.
Options
- Block the shell instead: set
[harness.grok] mode = "tool". Grok does not show boxer's session brief to the model, so its first shell command is refused once before it switches to the tool.
Tested in the matrix with hook rewrite and tool mode.