From 1ec55f7fca261423e7e35a441988eea92fd480e4 Mon Sep 17 00:00:00 2001 From: alitariksahin Date: Tue, 29 Sep 2026 14:51:47 +0300 Subject: [PATCH 1/6] DX-3089: Add Browser Use to the Connect over CDP page Co-Authored-By: Claude Fable 5.1 --- box/overall/browser/connect.mdx | 19 ++++++++++++++++++- box/overall/browser/overview.mdx | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/box/overall/browser/connect.mdx b/box/overall/browser/connect.mdx index f0552af91..ee701cdca 100644 --- a/box/overall/browser/connect.mdx +++ b/box/overall/browser/connect.mdx @@ -2,7 +2,7 @@ title: "Connect over CDP" --- -The box browser is a real Chromium, and you can drive it with the tools you already use. `cdpUrl()` returns an authenticated Chrome DevTools Protocol WebSocket URL that Playwright, Puppeteer, or Stagehand can connect to directly. There is no browser to install and nothing to manage. +The box browser is a real Chromium, and you can drive it with the tools you already use. `cdpUrl()` returns an authenticated Chrome DevTools Protocol WebSocket URL that Playwright, Puppeteer, Stagehand, or Browser Use can connect to directly. There is no browser to install and nothing to manage. For a single no-LLM step without wiring up a CDP client, replaying an observed action with [`act(action)`](/box/overall/browser/ai-actions#replay-an-action-without-an-llm) is often enough. Reach for CDP when you want fully scripted, multi-step control. @@ -76,6 +76,23 @@ await stagehand.init() await stagehand.act("click the first link") ``` +## Browser Use + +[Browser Use](https://browser-use.com) can run its agent loop on the box browser: + +```python agent.py +from browser_use import Agent, Browser, ChatAnthropic + +agent = Agent( + task="Open upstash.com/docs/box/overall/quickstart and return the install command", + llm=ChatAnthropic(model="claude-sonnet-4-5"), + browser=Browser(cdp_url=cdp_url), +) + +history = await agent.run() +print(history.final_result()) +``` + ## Mixing CDP and SDK control CDP clients and the SDK drive the same browser and the same tabs. A page opened by Playwright shows up in `box.browser.listTabs()`, and a tab created by the SDK is visible to Playwright. You can script the predictable steps like login and pagination with Playwright, hand the tab to [`act`](/box/overall/browser/ai-actions) for the steps that are easier to describe in natural language, and watch either through [Live View](/box/overall/browser/live-view). diff --git a/box/overall/browser/overview.mdx b/box/overall/browser/overview.mdx index bb317f991..32f72f1fe 100644 --- a/box/overall/browser/overview.mdx +++ b/box/overall/browser/overview.mdx @@ -73,7 +73,7 @@ print(page.title) - Drive the same browser with Playwright, Puppeteer, or Stagehand. + Drive the same browser with Playwright, Puppeteer, Stagehand, or Browser Use. From b459f98c6e38565ed089c15a6dd3ef533b374ccb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 29 Sep 2026 11:52:11 +0000 Subject: [PATCH 2/6] chore(llms): regenerate llms.txt and llms-full.txt --- llms-full.txt | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/llms-full.txt b/llms-full.txt index bde22cc90..67766ee9a 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -7870,7 +7870,7 @@ To turn a single AI-resolved step into a no-LLM one, replay an `observe()` resul # Connect over CDP Source: https://upstash.com/docs/box/overall/browser/connect -The box browser is a real Chromium, and you can drive it with the tools you already use. `cdpUrl()` returns an authenticated Chrome DevTools Protocol WebSocket URL that Playwright, Puppeteer, or Stagehand can connect to directly. There is no browser to install and nothing to manage. +The box browser is a real Chromium, and you can drive it with the tools you already use. `cdpUrl()` returns an authenticated Chrome DevTools Protocol WebSocket URL that Playwright, Puppeteer, Stagehand, or Browser Use can connect to directly. There is no browser to install and nothing to manage. For a single no-LLM step without wiring up a CDP client, replaying an observed action with [`act(action)`](/docs/box/overall/browser/ai-actions#replay-an-action-without-an-llm) is often enough. Reach for CDP when you want fully scripted, multi-step control. @@ -7944,6 +7944,23 @@ await stagehand.init() await stagehand.act("click the first link") ``` +## Browser Use + +[Browser Use](https://browser-use.com) can run its agent loop on the box browser: + +```python agent.py +from browser_use import Agent, Browser, ChatAnthropic + +agent = Agent( + task="Open upstash.com/docs/box/overall/quickstart and return the install command", + llm=ChatAnthropic(model="claude-sonnet-4-5"), + browser=Browser(cdp_url=cdp_url), +) + +history = await agent.run() +print(history.final_result()) +``` + ## Mixing CDP and SDK control CDP clients and the SDK drive the same browser and the same tabs. A page opened by Playwright shows up in `box.browser.listTabs()`, and a tab created by the SDK is visible to Playwright. You can script the predictable steps like login and pagination with Playwright, hand the tab to [`act`](/docs/box/overall/browser/ai-actions) for the steps that are easier to describe in natural language, and watch either through [Live View](/docs/box/overall/browser/live-view). @@ -8159,7 +8176,7 @@ print(page.title) - Drive the same browser with Playwright, Puppeteer, or Stagehand. + Drive the same browser with Playwright, Puppeteer, Stagehand, or Browser Use. From a8c9f7555deaaf39683ee12321003fedb6225acf Mon Sep 17 00:00:00 2001 From: alitariksahin Date: Mon, 5 Oct 2026 00:30:21 +0300 Subject: [PATCH 3/6] DX-3089: Run the Browser Use example with asyncio.run Co-Authored-By: Claude Fable 5.1 --- box/overall/browser/connect.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/box/overall/browser/connect.mdx b/box/overall/browser/connect.mdx index ee701cdca..7c45a0cf0 100644 --- a/box/overall/browser/connect.mdx +++ b/box/overall/browser/connect.mdx @@ -81,6 +81,7 @@ await stagehand.act("click the first link") [Browser Use](https://browser-use.com) can run its agent loop on the box browser: ```python agent.py +import asyncio from browser_use import Agent, Browser, ChatAnthropic agent = Agent( @@ -89,7 +90,7 @@ agent = Agent( browser=Browser(cdp_url=cdp_url), ) -history = await agent.run() +history = asyncio.run(agent.run()) print(history.final_result()) ``` From 89e52ad1f465648aa2aaa24cf82d5cbf7d88cbc8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 4 Oct 2026 21:31:06 +0000 Subject: [PATCH 4/6] chore(llms): regenerate llms.txt and llms-full.txt --- llms-full.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llms-full.txt b/llms-full.txt index 67766ee9a..bb3ea66f7 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -7949,6 +7949,7 @@ await stagehand.act("click the first link") [Browser Use](https://browser-use.com) can run its agent loop on the box browser: ```python agent.py +import asyncio from browser_use import Agent, Browser, ChatAnthropic agent = Agent( @@ -7957,7 +7958,7 @@ agent = Agent( browser=Browser(cdp_url=cdp_url), ) -history = await agent.run() +history = asyncio.run(agent.run()) print(history.final_result()) ``` From 3eeebde980388efec5810b72316e5b24ed491413 Mon Sep 17 00:00:00 2001 From: alitariksahin Date: Mon, 5 Oct 2026 00:05:47 +0300 Subject: [PATCH 5/6] DX-3107: Add the Scheduled Browser Use Agent guide for Box Co-Authored-By: Claude Fable 5.1 --- box/guides/browser-use.mdx | 166 +++++++++++++++++++++++++++++++++++++ docs.json | 1 + 2 files changed, 167 insertions(+) create mode 100644 box/guides/browser-use.mdx diff --git a/box/guides/browser-use.mdx b/box/guides/browser-use.mdx new file mode 100644 index 000000000..d627974d3 --- /dev/null +++ b/box/guides/browser-use.mdx @@ -0,0 +1,166 @@ +--- +title: "Scheduled Browser Use Agent" +--- + +Run a [Browser Use](https://browser-use.com) agent inside Upstash Box. The agent, the browser, and the files it writes all live in one box, and a schedule runs it again on a cron. + +This guide builds an agent that reads Hacker News every morning and saves a report to the box. + +--- + +## 1. Set up + +- A **Box API key** from the [Upstash Console](https://console.upstash.com/box). +- An **Anthropic API key** from [API keys](https://platform.claude.com/settings/keys). + +```bash +export UPSTASH_BOX_API_KEY=box_xxxxxxxxxxxxxxxxxxxxxxxx +export ANTHROPIC_API_KEY=sk-ant-api03-xxxxxxxxxxxx +``` + +```bash +pip install upstash-box +``` + +--- + +## 2. Write the agent + +This file runs inside the box. It starts the box's Chromium, runs the task, and writes the result to `reports/`. + +```python title="agent.py" +import asyncio +from datetime import datetime, timezone +from pathlib import Path + +from browser_use import Agent, Browser, ChatAnthropic + +TASK = """ +Go to news.ycombinator.com and find the first 3 stories about AI on the front page. +Return a markdown list with the title, link, and points of each. +Open only the first one and add a two-sentence summary of it. +""" + + +async def main(): + agent = Agent( + task=TASK, + llm=ChatAnthropic(model="claude-sonnet-4-5"), + browser=Browser( + executable_path="/usr/bin/chromium", + headless=True, + chromium_sandbox=False, + ), + ) + history = await agent.run(max_steps=15) + if not history.is_successful(): + raise SystemExit("The agent did not finish the task") + + name = datetime.now(timezone.utc).strftime("%Y-%m-%d-%H%M") + report = Path("/workspace/home/reports") / f"{name}.md" + report.parent.mkdir(exist_ok=True) + report.write_text(history.final_result()) + + +asyncio.run(main()) +``` + +--- + +## 3. Set up the box + +This script runs on your machine. It creates a box with a browser, installs Browser Use, runs the agent once, and schedules it. + +```python title="setup.py" +import os + +from upstash_box import Box + +box = Box.create( + runtime="python", + browser=True, + env={"ANTHROPIC_API_KEY": os.environ["ANTHROPIC_API_KEY"]}, +) +print(box.id) + + +def run(command): + result = box.exec.command(command) + if result.status != "completed": + raise RuntimeError(result.result) + + +# Install Browser Use and copy the agent in +run("pip install browser-use") +box.files.write(path="agent.py", content=open("agent.py").read()) + +# Run it once and print the report +run("python3 agent.py") +for file in box.files.list("reports"): + print(box.files.read(f"reports/{file.name}")) + +# Run it every day at 08:00 UTC +box.schedule.exec( + cron="0 8 * * *", + command=["python3", "/workspace/home/agent.py"], +) +``` + +```bash +python setup.py +``` + +Example output after the box id. Stories and scores will vary: + +```md +## Top 3 AI Stories from Hacker News + +1. **AI companies leak data to advertisers [pdf]** - 179 points + - Link: https://jorgegarciaherrero.com/wp-content/interactivos/20260916-Prompt-like-a-butterfly-sting-like-a-tracker-(clean).pdf + - Summary: The paper analyzes privacy practices of conversational AI services, finding that 6 out of 9 web services and 3 out of 8 Android apps leak conversation data to third parties. This includes sensitive information such as URLs, titles, prompts, and screenshots being shared alongside persistent user identifiers. + +2. **Jeeves. Reasoning improves Jev-like decision models** - 54 points + - Link: https://github.com/PostHog/jeeves + +3. **Nvidia wants to put a watchdog chip next to every AI agent** - 197 points + - Link: https://www.cnbc.com/2026/09/28/nvidia-releases.html +``` + +The box pauses when idle. Each scheduled run wakes it, and the reports stay on the box. + + + Run `setup.py` once. Each run creates a new box with its own daily schedule. + + +--- + +## 4. Read the reports + +Re-attach with the box id that `setup.py` printed: + +```python title="reports.py" +from upstash_box import Box + +box = Box.get("your-box-id") + +for file in box.files.list("reports"): + print(box.files.read(f"reports/{file.name}")) +``` + +```bash +python reports.py +``` + +Delete the box when you no longer need it: + +```python +box.delete() +``` + +--- + +## Next steps + +- [Schedules](/box/overall/schedules) to pause a schedule or get a webhook when a run finishes. +- [Connect over CDP](/box/overall/browser/connect) to drive the box browser with Browser Use from your own machine. +- [Browser](/box/overall/browser/overview) for the SDK's own `observe`, `act`, and `extract`. diff --git a/docs.json b/docs.json index 912c04624..2199fb6cb 100644 --- a/docs.json +++ b/docs.json @@ -2169,6 +2169,7 @@ "box/guides/code-review-agent", "box/guides/langchain-deep-agents", "box/guides/web-scraping-playwright", + "box/guides/browser-use", "box/guides/ai-sdk-setup", "box/guides/tanstack-setup", "box/guides/eve-setup", From 8dc15d3ccec7503a1b3cb8f07528be908f764a72 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 4 Oct 2026 21:41:27 +0000 Subject: [PATCH 6/6] chore(llms): regenerate llms.txt and llms-full.txt --- llms-full.txt | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++ llms.txt | 1 + 2 files changed, 163 insertions(+) diff --git a/llms-full.txt b/llms-full.txt index bb3ea66f7..d7a19225e 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -5011,6 +5011,168 @@ export const runCode = tool({ * [Public URLs](/docs/box/overall/preview) for authenticating the URLs `exposePort` hands out. * [Snapshots](/docs/box/overall/snapshots) to boot each conversation from a pre-installed environment. +# Scheduled Browser Use Agent +Source: https://upstash.com/docs/box/guides/browser-use + +Run a [Browser Use](https://browser-use.com) agent inside Upstash Box. The agent, the browser, and the files it writes all live in one box, and a schedule runs it again on a cron. + +This guide builds an agent that reads Hacker News every morning and saves a report to the box. + +*** + +## 1. Set up + +* A **Box API key** from the [Upstash Console](https://console.upstash.com/box). +* An **Anthropic API key** from [API keys](https://platform.claude.com/settings/keys). + +```bash +export UPSTASH_BOX_API_KEY=box_xxxxxxxxxxxxxxxxxxxxxxxx +export ANTHROPIC_API_KEY=sk-ant-api03-xxxxxxxxxxxx +``` + +```bash +pip install upstash-box +``` + +*** + +## 2. Write the agent + +This file runs inside the box. It starts the box's Chromium, runs the task, and writes the result to `reports/`. + +```python title="agent.py" +import asyncio +from datetime import datetime, timezone +from pathlib import Path + +from browser_use import Agent, Browser, ChatAnthropic + +TASK = """ +Go to news.ycombinator.com and find the first 3 stories about AI on the front page. +Return a markdown list with the title, link, and points of each. +Open only the first one and add a two-sentence summary of it. +""" + +async def main(): + agent = Agent( + task=TASK, + llm=ChatAnthropic(model="claude-sonnet-4-5"), + browser=Browser( + executable_path="/usr/bin/chromium", + headless=True, + chromium_sandbox=False, + ), + ) + history = await agent.run(max_steps=15) + if not history.is_successful(): + raise SystemExit("The agent did not finish the task") + + name = datetime.now(timezone.utc).strftime("%Y-%m-%d-%H%M") + report = Path("/workspace/home/reports") / f"{name}.md" + report.parent.mkdir(exist_ok=True) + report.write_text(history.final_result()) + +asyncio.run(main()) +``` + +*** + +## 3. Set up the box + +This script runs on your machine. It creates a box with a browser, installs Browser Use, runs the agent once, and schedules it. + +```python title="setup.py" +import os + +from upstash_box import Box + +box = Box.create( + runtime="python", + browser=True, + env={"ANTHROPIC_API_KEY": os.environ["ANTHROPIC_API_KEY"]}, +) +print(box.id) + +def run(command): + result = box.exec.command(command) + if result.status != "completed": + raise RuntimeError(result.result) + +# Install Browser Use and copy the agent in +run("pip install browser-use") +box.files.write(path="agent.py", content=open("agent.py").read()) + +# Run it once and print the report +run("python3 agent.py") +for file in box.files.list("reports"): + print(box.files.read(f"reports/{file.name}")) + +# Run it every day at 08:00 UTC +box.schedule.exec( + cron="0 8 * * *", + command=["python3", "/workspace/home/agent.py"], +) +``` + +```bash +python setup.py +``` + +Example output after the box id. Stories and scores will vary: + +```md +## Top 3 AI Stories from Hacker News + +1. **AI companies leak data to advertisers [pdf]** - 179 points + - Link: https://jorgegarciaherrero.com/wp-content/interactivos/20260916-Prompt-like-a-butterfly-sting-like-a-tracker-(clean).pdf + - Summary: The paper analyzes privacy practices of conversational AI services, finding that 6 out of 9 web services and 3 out of 8 Android apps leak conversation data to third parties. This includes sensitive information such as URLs, titles, prompts, and screenshots being shared alongside persistent user identifiers. + +2. **Jeeves. Reasoning improves Jev-like decision models** - 54 points + - Link: https://github.com/PostHog/jeeves + +3. **Nvidia wants to put a watchdog chip next to every AI agent** - 197 points + - Link: https://www.cnbc.com/2026/09/28/nvidia-releases.html +``` + +The box pauses when idle. Each scheduled run wakes it, and the reports stay on the box. + + + Run `setup.py` once. Each run creates a new box with its own daily schedule. + + +*** + +## 4. Read the reports + +Re-attach with the box id that `setup.py` printed: + +```python title="reports.py" +from upstash_box import Box + +box = Box.get("your-box-id") + +for file in box.files.list("reports"): + print(box.files.read(f"reports/{file.name}")) +``` + +```bash +python reports.py +``` + +Delete the box when you no longer need it: + +```python +box.delete() +``` + +*** + +## Next steps + +* [Schedules](/docs/box/overall/schedules) to pause a schedule or get a webhook when a run finishes. +* [Connect over CDP](/docs/box/overall/browser/connect) to drive the box browser with Browser Use from your own machine. +* [Browser](/docs/box/overall/browser/overview) for the SDK's own `observe`, `act`, and `extract`. + # Claude Managed Agents Source: https://upstash.com/docs/box/guides/claude-managed-agents diff --git a/llms.txt b/llms.txt index 0b98a79ec..c8d588f65 100644 --- a/llms.txt +++ b/llms.txt @@ -61,6 +61,7 @@ - [Upload Client](https://upstash.com/docs/blob/uploads/upload-client.md): useUpload, useServerUpload and uploadHooks, for uploading from the browser straight to storage. - [Upload Handler](https://upstash.com/docs/blob/uploads/upload-handler.md): Mount the upload route, authorize the upload in onBeforeUpload, and record the file in onUploadComplete. - [Vercel AI SDK Tools](https://upstash.com/docs/box/guides/ai-sdk-setup.md) +- [Scheduled Browser Use Agent](https://upstash.com/docs/box/guides/browser-use.md) - [Claude Managed Agents](https://upstash.com/docs/box/guides/claude-managed-agents.md) - [Build a Code Review Agent](https://upstash.com/docs/box/guides/code-review-agent.md) - [Vercel Eve Sandboxes](https://upstash.com/docs/box/guides/eve-setup.md)