Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
ADR 0272: Judge a public-network address on the route the request will dial
- Status: Accepted for implementation
- Date: 2026-09-17
- Related: ADR 0177, ADR 0243, ADR 0245, ADR 0321, D413, D414, issue #419, PR #473
Context
createPublicHttpsClient guards every credential-free public HTTPS fetch the skill
market makes from Electron main and classified each hop with Node's local resolver.
The request itself dials through Chromium's proxy stack, where a proxied hostname
is resolved by the proxy, so the pre-check judged an address no request would use
and refused working setups: a TUN resolver answering with a synthesized fake-IP in
the RFC 2544 range failed every catalog source even though the transport worked
(issue #419). PR #473 made that refusal legible without moving the boundary, and
this record moves it.
Decision
- The address verdict follows the route the request will actually take. Before
each hop is dialed, the client asks the session carrying
fetchImplfor its proxy decision on exactly that URL (Session.resolveProxy), and the sharedclassifyProxyRoutereduces the answer toproxied,direct, orunknown. - A proxied route replaces the local address verdict; it does not remove it.
On
proxied,isAcceptableResolvedAddresstolerates only thebenchmarkclass that a TUN fake-IP resolver synthesizes, while every other non-public class and an unanswered resolver still refuse. directandunknownkeep the pre-ADR rule by default. Onlypublicpasses there; an explicitallowFakeIpsetting may additionally permit thebenchmarkplaceholder class for transparent router or TUN deployments and never another non-public class, a mixed answer may pin one acceptable address (ADR 0321), andunknownfails closed.- The syntactic guard is untouched.
isSafePublicHttpsUrlstill runs first, redirects staymanualunder a hop cap, and every hop re-runs the whole check. - The route travels with the refusal.
PublicNetworkRefusaland its detail gainroute, so diagnostics state which route the address was judged on.
Consequences
- Proxied and fake-IP users get a working skill market, and direct-route users keep the old verdicts with an opt-in limited to benchmark placeholders.
- On a proxied route the app's only peer is the user-configured proxy, so reaching internal targets is bounded by that proxy's own rule set.
- The MCP market applies the same route-aware verdict and pays one extra
resolveProxyround trip per hop, and a TUN user with no proxy the app can see is still refused.
Alternatives
- Delete the DNS gate for every request: rejected, it removes the SSRF guard for direct users too.
- Relax the benchmark range unconditionally: rejected, it accepts an answer the app cannot attribute to an interception layer.
- Check the peer after connecting: unavailable, because Electron's
net.fetchexposes no peer address.