{
  "id": 21955925,
  "title": "Letting an agent fetch from a short allowlist inside a sandbox, and why the allowlist is per task",
  "url": "https://urgent.news/2026/11/26/letting-an-agent-fetch-from-a-short-allowlist-inside-a-sandbox-and",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-26T09:45:34.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/sandscale/letting-an-agent-fetch-from-a-short-allowlist-inside-a-sandbox-and-why-the-allowlist-is-per-task-kek"
  },
  "original_language": "en",
  "account": "When an agent needs information from the web, it is tempting to provide it with a headless browser. However, this approach is often excessive for many tasks. Reading an API reference, changelog, package's README, or status JSON typically requires only a single HTTP GET and some text extraction. A browser adds unnecessary components like a JavaScript engine, cookies, a large dependency tree, and complex behavior that were not requested. This post introduces a smaller, browser-free fetch tool that runs within a sandbox, enforces strict host restrictions through an allowlist, and returns plain text with clear limitations. This tool focuses on the tool itself and not on choosing hosts, DNS, or CDN traps, which were covered in a separate document on designing an egress allowlist. A browser-free fetch tool offers several advantages. It eliminates script execution, preventing the page's JavaScript from running. The page cannot fingerprint, redirect through script, or open additional connections on its own. Each network hop becomes a decision in the code, allowing for predictable output. The developer can set size caps, content types, and text extraction methods, ensuring consistent results for the model. However, a downside is that pages rendered entirely by client-side JavaScript may return nearly empty text. This trade-off is acceptable for most cases, such as reading documentation, references, feeds, and APIs, which are the primary sources of information that agents interact with. There are two types of allowlists to restrict a fetch's destination: a network allowlist enforced outside the code and a task allowlist enforced by the fetch tool. The network allowlist is implemented at the sandbox's network layer, proxy, or firewall, preventing the code inside the sandbox from widening the allowed list. The task allowlist, on the other hand, is specific to the task at hand. For example, a task requiring documentation for a library would only need access to that library's documentation host. This per-task approach is necessary because different tasks have different requirements, making a single wide list impractical. The task allowlist is advisory to any code that does not use the tool, but the network allowlist still needs to enforce a tight ceiling. The provided fetch tool, written in Python using the standard library, reads a JSON task containing the URL and allowlist from standard input and outputs JSON results. The tool checks for allowed schemes, verifies hosts against the allowlist, and respects redirects by passing them to the caller for checking. It also reads and respects the site's robots.txt file, treating it as allowed if the file cannot be read or if it permits fetching. Finally, the tool extracts text based on the content type, respecting the specified size limits.",
  "summary": "When an agent needs something from the web, the first instinct is often to give it a headless browser. For most tasks that is far more than it needs. Reading an API reference, a changelog, a package's README or a status JSON is one HTTP GET and some text extraction. A browser adds a JavaScript engine, cookies, a large dependency tree and a lot of behaviour you did not ask for, all of it driven by…",
  "key_points": [
    "Browser-free fetch tool runs in sandbox with strict host restrictions",
    "Task allowlist specifies per-task destination restrictions",
    "Tool outputs plain text with size limits and respects robots.txt"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}