Chrome's --host-resolver-rules only glob-matches host strings, so the CIDR
entries (127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 169.254.0.0/16,
192.168.0.0/16) never matched: pages could fetch private IP literals and
names resolving to private IPs, and the live SSRF test hung dialing
169.254.169.254 until its deadline.
Replace the rules with web.EgressProxy, a loopback HTTP proxy (CONNECT and
absolute-URI HTTP) that resolves each destination, refuses it if any
address is private, and dials the validated IP directly. Chrome is pointed
at it with --proxy-server and <-loopback>, and WebRTC is limited to proxied
UDP. Stagehand's local mode allows only Chrome's own debugging port through,
which its extension needs.
SafeHTTPClient and the proxy now share one safe dialer, which races the
validated addresses happy-eyeballs style so dual-stack hosts with broken
IPv6 don't stall. isPrivateIP also covers multicast, reserved, benchmark,
Teredo and NAT64/6to4/IPv4-compatible addresses embedding a private IPv4.
- Runtime.Run rejects concurrent invocations instead of racing on shared state; panics in tools, hooks, and permission checkers are recovered and surfaced as errors/denials instead of crashing the loop
- AgentSpec.Loop now actually overrides RuntimeDeps.AgentLoop per-agent, as documented
- session.Store validates agent ID / session key as single path components, preventing traversal outside the session directory
- ValidatePathInWorkDir resolves symlinks on the target itself, not just its parent, closing a workspace-escape gap
- bash tool now fails closed on an unrecognized ExecPolicy.Level instead of allowing everything
- browser tool rejects unknown actions instead of silently no-op'ing
Bump README to v0.3.4 and document the AgentSpec.Loop override semantics.
chromedp launches Chrome as detached subprocesses; on SIGKILL, OOM, or
any path that bypasses our cleanup chain they reparent to PID 1 and
survive indefinitely. Each launch now allocates a known harness-browser-*
user-data-dir and registers it with a single detached /bin/sh watchdog
spawned via Setsid. When the parent dies the watchdog detects stdin EOF
and pkills + rm -rfs every still-tracked path. Clean teardown untracks
the path so a later hard exit can't kill the next session sharing the
process.