Why queue redelivery changes how you contain an agent browser
How at-least-once queue redelivery changes containment for a headless agent browser: costs bounded before work, limits on attempts and work, and a JavaScript interpreter fenced off.

On this page
Feed let a = []; a.push(a); String(a); to an interpreter that lacks aggregate heap and native-recursion bounds, and three statements can kill the process well inside its step budget. In most server architectures, that is a recoverable failure. Standard containment for untrusted scripts pairs a step budget with a memory cap, or puts an out-of-process watchdog over the worker to kill and replace a wedged runtime, which is the model I used in a code-execution service I built for the company’s agents. Both approaches work well as long as a dead worker costs only the request or job it was running.
Put an at-least-once queue in front of the worker and that assumption breaks. When a lease is acknowledged only on completion, a crash sends the message straight back to the restarted process, so one hostile page keeps a public service down for as long as the request stays in the queue. Delivery semantics determine what is safe to ship. Under redelivery, aggregate memory and native recursion replace step counts as the qualification bar: every cost has to be bounded before work begins, and any component whose costs cannot yet be bounded stays off, however well it works.
That constraint shaped a headless browser engine I built for agents. Written in Rust on the standard library alone, it installs as source into services on Ferrite, a platform I built for constrained applications. Following Cloudflare’s Kitesurf, an agent-focused headless browser, the engine trades rendering fidelity for a bounded footprint so agents can pull page text, links, and the occasional screenshot without carrying Chromium into every sandbox. A public render service runs the engine on Ferrite, leasing requests from a queue and acknowledging each lease only after its reply is published. Static rendering is bounded up front; the engine’s JavaScript interpreter stays disabled in production.
Measuring static capability
Keeping scripts disabled is only practical if static rendering still covers what agents actually need. Measured against Chrome on about a thousand popular sites with scripts off, compatibility is reported per capability rather than collapsed into a single pass rate. Across every site that loads, document titles match Chrome and extracted links average 0.999 agreement, while software rasterization with a built-in bitmap font diverges from web fonts and pulls the all-properties pass rate down to about 42 percent. Splitting the score by capability makes the trade-off explicit: pixel fidelity is where the engine compromises, while static extraction already handles the workload the service ships for.
Bounding cost before work begins
With scripts off, every remaining stage still has to enforce its limits before allocating memory or recursing on the native stack, because an OOM kill or stack overflow triggers the same redelivery loop. Screenshot memory is projected across the raster canvas and PNG encoder before any buffer is allocated: single screenshots above 192 MiB are refused up front, and concurrent screenshots reserve against a shared 224 MiB budget inside a 512 MB process.
Tree depth creates the same risk for the native stack, where layout and extraction both recurse. Documents nested deeper than 256 elements are rejected before layout by an iterative pass over the DOM arena, because a 50,000-deep page overflowed the stack without it.
Bounding work rather than output
Even with upfront admission checks, the obvious limit is often the wrong one because it caps the visible result while leaving the work behind it open. Subresource caps bound fetch attempts rather than successful loads: counting only successes let a page with 50 failing links of each kind issue 50 outbound fetches per resource type without reaching the ceiling.
CSS var() expansion requires the same separation between output and work. A 15-level chain expanded a single declaration to 2.1 MB, which an output cap catches, whereas a chain of empty custom properties did exponential resolution work while producing nothing at all. Expansion is bounded on both resolution work and output size.
Disabling the JavaScript interpreter at compile time
Applying that bar to scripting leaves the larger half of the engine disabled in production. Roughly 31,000 of the engine’s 51,000 lines of Rust are a JavaScript interpreter that executes production builds of React, Preact, Vue, and jQuery and passes their test suites. It bounds execution steps and JavaScript call depth, not aggregate heap allocation or native stack recursion.
The render service checks a compile-time constant set to false and refuses page scripts and the Chrome DevTools Protocol interface before evaluating the request body, reading session state, or issuing a network fetch, with a test asserting that order. Any other deployed consumer enforces the same compile-time fence, leaving static rendering available while ensuring no runtime flag can expose an unqualified interpreter.
Correctness work on the interpreter continues behind the fence, but passing framework suites demonstrate behavior only on the inputs they cover, not safety on hostile ones. Page scripts stay disabled until aggregate allocation and native recursion are bounded and reviewed.
Chris Chabot, October 2026