"Be ashamed to guess APIs blindly; be proud to look things up carefully" —
until now the agents had no way to look anything up: no search, no fetch,
so market research, API usage, and competitive claims were all invented
from model memory.
agent-web-tools.ts, carried by every agent in every run (same pattern as
the workspace tools, no grant needed):
- web_search: keyless DuckDuckGo HTML backend; parses titles, unwraps the
/l/?uddg= redirect hrefs, pairs snippets; reports honestly when nothing
parses instead of fabricating results. Verified against the live endpoint.
- fetch_url: readable-text extraction (dependency-free HTML-to-text with
entity decoding), 20k-char page cap, 2MB body cap read in chunks, 30s
timeout.
- SSRF guard on both: hostnames resolve before connecting and loopback,
private, link-local, CGNAT, and reserved ranges are refused — re-checked
on every redirect hop, so a public page cannot bounce the agent into
127.0.0.1 or the cloud metadata address. IPv6 and v4-mapped forms covered.
- The fetcher is injectable, so the test suite covers the guard, redirect
policy, truncation, extraction, and the DuckDuckGo parser without
touching the network.