Guide

Connect a screenshot for your agent to analyze

Connect an image into the core — browser drag-drop, the agent reads it via `sh`, and the failure modes when content-type doesn't match.

5/18/2026 · connect0 · 2 min

Connect an image into the core so your agent can OCR it, inspect it, and reason over what's on screen.

The agent is good at reading code, bad at reading screenshots — but it can run tools that are good at reading screenshots. Get the screenshot into the sandbox first.

Quick path: the browser helper

"I'm going to send you a screenshot of an error message. Make me an upload link for screenshot.png, image/png."

The agent calls upload.create_link without content_length (or with the right size if you have it handy). You get back a browser_url. Open it in any logged-in tab, drag the PNG in, done.

The agent reads it

Inside the sandbox, the agent has tesseract, imagemagick, and python with Pillow available out of the box:

sh "tesseract /workspace/screenshot.png - 2>/dev/null"

The OCR'd text comes back, the agent reasons about it. For UI screenshots, tesseract is surprisingly capable on modern monospace dev-tooling fonts.

For more sophisticated image analysis (object detection, layout extraction), the agent installs whatever it needs via pip install — needs egress=open for that.

Content-type matters

The PUT must use Content-Type: image/png to match what's signed in. Easy to get wrong if you're using a generic upload widget:

  • Drop a .jpg into a link issued for image/png → 403.
  • Drop a screenshot saved as .png from a tool that wrote JPEG bytes inside → 403 (content-type matches PNG, but R2 doesn't introspect the body).

If you're unsure, ask the agent to issue a link with content_type: "application/octet-stream" (the default) and let the sandbox figure out the format from magic bytes via file or python-magic.

Sizes

A typical screenshot is ~200 KB to 2 MB. Well under any meaningful cap. For 4K screen captures or long scroll-shots you might creep into 5–10 MB range; still fine for single-PUT.

Privacy

A screenshot might contain things you'd rather not have in the audit trail — chat messages, dashboard data, browser tabs. The upload_link row records:

  • target_path ("screenshots/error-message.png") — visible to you and operators.
  • bytes_received and a hash from R2's etag.
  • No content — we never read the bytes.

The bytes themselves are in R2 under your project's prefix; they stay there until you sh "rm" them or the project is hard-deleted.

Next steps

Where this fits

This is the Connect everything pillar of connect0 — the core that connects everything your company runs on. An image is just another source you connect into the core, where the agent's vision and OCR tools can turn pixels into something it can act on. Start building → · All guides →