Explain delivery_ips_not_public when a VPN/gateway hides the caller - #6
Merged
Conversation
The server folds the requester's address into the delivery allow-list, so behind a corporate VPN or secure gateway the API sees a private address and refuses — no flag avoids it, and the bare 400 reads like a fault. Emit guidance (stderr, plus a hint field in the --json error envelope) that names the routing cause, states it is not a security block, and tells AI agents to defer to the user rather than touch network settings. Suppressed when the user passed the rejected IP themselves or the rejected addresses are public.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Behind a corporate VPN or secure gateway (e.g. Cloudflare WARP), the provisioning API can see the request arriving from a private address. The requester's address is always folded into the delivery allow-list, so provisioning fails with
delivery_ips_not_public— no flag avoids it, and the bare 400 gives the user (or an AI agent driving the CLI) nothing to act on.This adds guidance when that error's rejected private address was server-derived rather than user-supplied:
--json: additivehintfield inside the existing error envelope (non-breaking).--ip(compared with IPv6 normalization, not string equality), every rejected address is public, or the message has no parseable IP while--ipvalues were given.Lives in
ip-check.tsalongside the existing delivery-IP/VPN logic and reuses itsisPublicIp; not added to the public library surface.Test plan
hintpresent in--jsonerror envelope; human mode emits guidance on stderr🤖 Generated with Claude Code