SSRF deny error doesn't name --allow-private-network; agents conclude localhost is unsupported
Version: v0.2.1 (observed); message unchanged on main (crates/obscura-js/src/ops.rs).
Problem. When the SSRF guard refuses a target, the error names what was blocked but not that it is a policy the operator can relax:
$ obscura fetch http://localhost:8791/
Error: ... Access to localhost domain 'localhost' is not allowed
$ obscura fetch http://127.0.0.1:8791/
Error: ... Access to private/internal IP address 127.0.0.1 is not allowedOver MCP it arrives the same way, as isError: true from browser_navigate.
Humans find --allow-private-network in --help or the README (#695/#696). AI agents driving Obscura through obscura mcp mostly don't. They read "is not allowed" as "this browser cannot reach localhost", give up on testing their own dev server, and fall back to something worse. We see this repeatedly with coding agents. The flag exists, and the error message is the only text the agent reads at that point.
Proposal. Append one hint line to the three deny messages (localhost domain, IPv4, IPv6) naming the escape hatch, e.g.:
Access to localhost domain 'localhost' is not allowed (SSRF guard; blocked by default — pass --allow-private-network or set OBSCURA_ALLOW_PRIVATE_NETWORK=1 to reach local/private addresses)If #861 (--allow-network <CIDR>) lands, the hint should point at the scoped flag first, which is the safer thing to tell an agent to use.
Two details worth considering:
- Metadata addresses. For
169.254.169.254/100.100.100.200, consider leaving the hint off, or wording it so it doesn't suggest opening them. An agent that got there by following a link on a page should stop, not look for a flag to switch off. - No hint over HTTP MCP. A server running
obscura mcp --httpfor untrusted clients arguably shouldn't advertise the flag. Showing the hint only in the CLI and stdio MCP would cover the agent case.
Downstream workaround, for reference. We run two stdio MCP servers, obscura (guarded) and obscura-local (--allow-private-network), and a client-side hook that rewrites this error into "this is the guard, use obscura-local for your own dev server". A hint in the message itself would make that hook unnecessary for everyone else.
Source: h4ckf0r0day/obscura