[BUG] Network requests outside of sandbox don't trigger `PermissionRequest` hook
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
If I tell Claude to use sandboxed bash to do something which triggers a network request outside of the sandbox, I get a permission prompt. Any PermissionRequest hook I have for this does not get called.
<img width="842" height="606" alt="Image" src="https://github.com/user-attachments/assets/4f2e6bcf-d2ee-4119-bb8c-97bc053a273f" />
What Should Happen?
The PermissionRequest hook should be triggered so it has a chance to auto-approve or deny network requests without user intervention.
Steps to Reproduce
- Clone repro at https://github.com/fongandrew/claude-sandbox-network-request. This just has a
PermissionRequesthook that spits out a log file. - Run Claude Code there
- Tell Claude Code to "use sandboxed bash to curl example.com"
- Wait until permission request pops up
- Check file system to see no log file appears
If you try the same thing with "use unsandboxed bash to curl example.com", it should generate the log file though.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.31 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗