AgentEnv: Turning Recorded Captures into Offline RL Harnesses

Compiling HAR/CDP observations into deterministic local tool environments where agents practice tasks with zero live side effects.

Abstract. Training and evaluating coding agents against live web apps is slow, flaky, and unsafe. REA’s export_environment_bundle[1]Bundle contractexport_environment_bundle writes a self-contained local environment folder from recorded CDP or HAR captures for repeatable offline rollouts.github.com/morluto/rea compiles recorded CDP and HAR captures into deterministic local harnesses that expose structured WebMCP and Vercel UI SDK controls with zero live side effects.

Offline RL Pipeline

Step through the four stages (Capture, Compile, Replay, and Grade) to see how REA pins network responses by SHA-256 digest and isolates agent rollouts from external systems[2]Interactive illustrationThe pipeline explorer below is an illustrative walkthrough of the four stages; toggling zero-egress updates the simulated replay preview.github.com/morluto/rea.

Interactive Figure · AgentEnv Pipeline

From Recorded Capture to Deterministic Offline Harness

Record passive CDP network frames, DOM accessibility snapshots, and WebMCP tool declarations from a real session without mutating the target.

INPUT
Live browser tab (CDP) or saved HAR / SAZ trace
OUTPUT
Content-addressed Evidence bundle (SHA-256 manifest)
SIDE EFFECTS
Read-only observation
rea capture_browser_scenario --origin https://app.example.testdeterministic
{
  "evidence_id": "ev_cdp_0194",
  "origin": "https://app.example.test",
  "requests_captured": 18,
  "webmcp_tools": ["orders.list", "orders.cancel"],
  "bundle_sha256": "9f4b2c...e18a"
}
Every stage is inspectable via blogAgent.snapshot(). Toggle between stages or flip zero-egress mode to see how REA isolates agent rollouts from live systems.

Agent Bridge Efficiency

Pairing deterministic offline environments with Vercel UI SDK’s snapshot() and act() bridge eliminates DOM scraping overhead during rollouts[3]Bridge savingsThree-run median numbers from the Vercel UI SDK settings-screen evaluation; gains come from structured tool calls rather than pixel/DOM loops.github.com/vercel-labs/ui.

Figure 2 · Agent Bridge Benchmark

Browser-Only vs. UI SDK Agent Bridge (3-Run Medians)

Median total tokens in thousands across 3 runs (lower is better)
React76% fewer
Base UI + browser tools
291.7k
UI SDK Agent Bridge
69.5k
Vue60% fewer
Reka UI + browser tools
226.5k
UI SDK Agent Bridge
90.2k
Svelte64% fewer
Bits UI + browser tools
259.1k
UI SDK Agent Bridge
92.8k
Modeled after SID-2 Technical Report interactive charts. Controls use @ui-sdk/react/segmented-control and @ui-sdk/react/switch and are directly inspectable and actionable via the Agent Console.

Notes & References

  1. Vercel Labs (2026). “Introducing UI SDK: A library of behaviors to build your components. Made for agents.” github.com/vercel-labs/ui
  2. REA Project (2026). “Reverse Engineer Anything: One MCP for reverse engineering across binaries, applications, and runtime behavior (v6.8.0, 229 tools).” github.com/morluto/rea
  3. REA Showcase (2026). “Rebuilding DX-Ball 1.07 from its executable: sound panning reconstruction & 3,205 oracle checks.” rea.tools/showcase/dx-ball
  4. REA Showcase (2026). “How Notion Desktop 7.6.1 copies text and HTML across its Electron preload/IPC bridge.” rea.tools/showcase/notion
  5. Editorial craft references: SID-2 Technical Report (three-column reading grid, inline figure toggles, margin sidenotes) and Architect Labs Frostbite (editorial left rail, serif display headlines, cobalt telemetry). sid.ai & architectlabs.com