Conversation
The metro egress proxy now answers a destination outside a session's egress allowlist with a branded 403 carrying X-Kernel-Proxy-Error: network_policy_denied. The monitor only classified branded 502s, so those denials produced no proxy_error event. Accept 403 at the status gate and add network_policy_denied to the published code enum, so the event carries the typed code instead of unknown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
meliaj
force-pushed
the
hypeship/proxy-error-network-policy-403
branch
from
October 5, 2026 21:26
b47b9c1 to
2fef758
Compare
meliaj
marked this pull request as ready for review
October 5, 2026 21:48
The cdpmonitor README and the TestProxyErrorE2E comment still described proxy_error as 502-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The proxy already serves destination_route_unavailable and origin_response_incomplete as branded 502s, and the API enum lists both, but the image reported them as unknown with a raw_code. Also rename the status-gate subtest now that 403 is classified, describe the 403 status by when the proxy sends it, and note in the README that a CONNECT the proxy refuses outright surfaces as network_loading_failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 5, 2026
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
The metro egress proxy is gaining per-session egress allowlists. When a destination isn't on the allowlist, the proxy answers with a branded 403 carrying
X-Kernel-Proxy-Error: network_policy_denied. Other proxy-layer failures still return 502.Before this change, the CDP monitor only checked branded 502s, so a denial produced no
proxy_errorevent. This PR:network_policy_deniedto the publishedproxy_errorcode enum, so the event carries the typed code instead ofunknownwith araw_code. The spec descriptions now mention the 403.destination_route_unavailableandorigin_response_incompleteto the enum as well. The proxy already serves both as branded 502s, but the image reported them asunknownwith araw_code.proxy_erroras 502-only, and notes that a CONNECT the proxy refuses outright, such as a denied CONNECT to a port other than 443, shows up only asnetwork_loading_failedbecause Chromium doesn't expose the refusal.The 403 handling can ship before or after the proxy change: until the proxy sends these 403s, nothing changes for them. The two added codes take effect as soon as an image with this change ships. It does need to be in a released image before kernel/docs#657 is published, since that PR says denials show up as
proxy_errorevents and drops the proxy errors page's note thatorigin_response_incompleteisn't reported.Validation
cd server && go test ./lib/cdpmonitor/... ./lib/events/... ./lib/oapi/...KERNEL_CDPMONITOR_CHROME_E2E=1 go test ./lib/cdpmonitor/ -run TestProxyErrorE2Eagainst real Chromium, with new cases fornetwork_policy_denied(403),destination_route_unavailableandorigin_response_incomplete. The last two come back asunknownwith the previous generated enum.lib/oapi/oapi.gowas regenerated by running theoapi-generatesteps directly. Unrelatedgo mod tidychanges togo.sumwere left out.test-server-e2e).🤖 Generated with Claude Code
Note
Medium Risk
Changes network telemetry classification for 403 responses and expands the public proxy_error enum; mis-gating could false-positive on unrelated 403s, though the header gate limits that.
Overview
Extends CDP monitor
proxy_errordetection so branded metro responses withX-Kernel-Proxy-Errorare recognized on 403 as well as 502, enabling typed telemetry when egress network policy blocks a destination (network_policy_deniedwith status 403). Plain site 403s without the header still do not emitproxy_error.The OpenAPI/
oapiproxy_errorcode enum gainsnetwork_policy_denied,destination_route_unavailable, andorigin_response_incomplete, with docs noting 403 vs 502 and that some CONNECT refusals remainnetwork_loading_failedonly. Unit and Chromium E2E tests cover the 403 gate and new codes; README event taxonomy is updated accordingly.Reviewed by Cursor Bugbot for commit 493f2d3. Bugbot is set up for automated code reviews on this repo. Configure here.