[BUG] Cowork: file_upload tool returns "Not Allowed" on google.com — CDP DOM.setFileInputFiles blocked + VM network allowlist blocks all Google APIs
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?
When using Cowork to automate tasks involving Google Photos (photos.google.com), two hard blocks prevent any file upload:
Issue 1: file_upload tool returns "Not Allowed" on google.com
The file_upload tool uses Chrome's CDP command DOM.setFileInputFiles to inject files into <input type="file"> elements. Chrome blocks this command on google.com domains as a security policy. This affects the main Google Photos library page (/u/2/), album creation pages, and any other google.com property. The error is identical regardless of context or whether the file input was triggered by a user gesture.
Issue 2: Cowork VM network allowlist blocks all Google APIs
The Cowork VM only allows outbound connections to registry.npmjs.org. Any attempt to call Google APIs (photos.google.com, googleapis.com, photoslibrary.googleapis.com, drive.google.com) from Node.js, Python, or curl inside the VM returns HTTP 403 "Connection blocked by network allowlist". The SOCKS5 and HTTP proxies (socat) enforce the same allowlist.
Together these make it impossible for Cowork to upload files to Google Photos — or any Google service — through any automated approach.
What Should Happen?
Two fixes are needed:
1. file_upload tool on google.com domains
Either find a workaround for the CDP restriction (e.g. inject via a different mechanism, use the extension's elevated privileges, or use a trusted synthetic event), or at minimum document clearly which domains block DOM.setFileInputFiles so users and Claude aren't sent down a dead end.
2. VM network allowlist
Expand the allowlist to include common productivity/API domains: google.com, googleapis.com, microsoft.com, slack.com, notion.so, etc. The current single-entry allowlist (registry.npmjs.org only) makes server-side automation of any real-world web service impossible from the VM.
Error Messages/Logs
// file_upload tool (CDP DOM.setFileInputFiles blocked on google.com):
Failed to upload file(s): {"code":-32000,"message":"Not allowed"}
// Node.js / Python from VM calling Google Photos API:
HTTP 403 - "Connection blocked by network allowlist"
// SOCKS5 proxy from VM:
Socks5 proxy rejected connection - NotAllowed
Steps to Reproduce
- Open Google Photos (photos.google.com/u/2/) in Cowork's browser
- Click + → Album → Select photos → "Select from computer"
- Use
findtool to locate the file input (ref appears as type="file") - Call
file_uploadtool with any local file path and that ref - Observe: {"code":-32000,"message":"Not allowed"}
For the VM network issue:
- In a Cowork bash session, run:
curl https://photos.google.com - Observe: HTTP 403 "Connection blocked by network allowlist"
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.63 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Discovered while attempting to help a user move ~338 photos from one Google account to another using Cowork + Claude in Chrome. All technical approaches were exhausted:
- file_upload: blocked (CDP restriction)
- Fetch from VM to Google Photos upload endpoint: blocked (network allowlist)
- DataTransfer JS injection: blocked (untrusted event, Google Photos ignores it)
- Drag-and-drop via JS: blocked (isTrusted=false)
- VM HTTP server bridging: impossible (VM has only loopback interface, no external IP)
The browser JS context (Claude in Chrome extension) CAN fetch from Google domains fine — cross-account photo URLs returned 200 OK. The gap is upload: no path from local files → Google Photos upload API exists within Cowork's current constraints.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗