Where does the bug appear (feature/product)?
Cursor CLI
Describe the Bug
Cursor CLI Agent doesn’t honor HTTP_PROXY/HTTPS_PROXY environment variables - API key validation fails behind corporate proxy
Environment:
OS: Red Hat Enterprise Linux 8.10 (Ootpa)
Agent Version: 2026.01.09-231024f
Bundled Node.js: v24.5.0
Corporate Proxy: Fortinet-Proxy (HTTP CONNECT)
Steps to Reproduce
The Cursor CLI agent fails to validate API keys when running behind a corporate HTTP proxy. The error message is “The provided API key is invalid” even though the key is valid and works on other systems without a proxy.
The bundled Node.js runtime does not automatically use HTTP_PROXY/HTTPS_PROXY environment variables. Node.js’s built-in https module requires explicit proxy configuration (like http.request with CONNECT method), but the Cursor agent doesn’t implement this.
Proof:
curl works through the proxy:
curl -x $http_proxy https://api.cursor.com/ # Works
Bundled Node.js with explicit proxy works:
// Using http.request with CONNECT method through proxy - WORKS
Bundled Node.js with https.get (how agent uses it) - FAILS/TIMES OUT:
https.get(‘https://api.cursor.com/’) // Times out, ignores HTTP_PROXY
Same API key works on Ubuntu 22.04 (same network, no proxy required for that VM).
Expected Behavior
Cursor CLI agent should respect HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables, similar to how curl and other CLI tools work.
Operating System
Windows 10/11
Current Cursor Version (Menu → About Cursor → Copy)
$ cursor-agent --version
2026.01.09-231024f
Additional Information
The above report was generated using cursor agent on my windows.
- Summary of Everything We Tried
Session Summary: Debugging Cursor CLI on RHEL 8.10
Step What We Tried Result
1 Verified API key format
Valid (key_xxx…, 68 chars)
2 Checked proxy connectivity with curl
Works - reached api . cursor . com
3 Checked SSL certificates
Valid, no errors
4 Tried agent --verbose
Flag doesn’t exist
5 Tried agent login with NO_OPEN_BROWSER=1
Gives URL but can’t complete (no browser on VM)
6 Tried agent login --device-code
Flag doesn’t exist
7 Unset CURSOR_API_KEY and tried fresh auth
Login times out
8 Passed API key directly with --api-key flag
Still “invalid key”
9 Tried agent --list-models
“No models available” (key accepted but no access)
10 Compared with working Ubuntu system
Same key works on Ubuntu!
11 Compared OS versions RHEL 8.10 vs Ubuntu 22.04
12 Compared glibc versions 2.28 (RHEL) vs 2.35 (Ubuntu)
13 Compared OpenSSL versions 1.1.1k (RHEL) vs 3.0.2 (Ubuntu)
14 Checked bundled Node.js binary
Runs fine (v24.5.0)
15 Tested Node.js HTTPS request
TIMES OUT - doesn’t use proxy
16 Tested Node.js with explicit proxy (CONNECT)
WORKS!
17 Tried GLOBAL_AGENT_* env vars
No effect
18 Disabled proxy entirely
Can’t reach internet without proxy
Root Cause:
Node.js does NOT automatically honor HTTP_PROXY/HTTPS_PROXY environment variables. The Cursor agent needs to explicitly implement proxy support, which it currently doesn’t do.
Does this stop you from using Cursor
Yes - Cursor is unusable