Give an AI Agent a Cloud Computer

Give a coding agent a persistent cloud computer with a browser.

Introduction

30 Second Summary

An AI coding assistant loses much of its value when you must keep your laptop awake or rebuild its workspace every morning. A useful workspace should wait for you with yesterday's files still in place.

In this project, you will build a Node script that gives an AI agent its own persistent cloud computer using Upstash Box. A typed summary, a browser screenshot, and the restored files will prove that each stage worked.

What You'll Build

You will demo a cloud coding workspace where an agent fixes a bug, proves the result in a browser, then returns after a pause with its work still on disk.

By the end of this project, you'll have:

  • A cloud coding workspace where an agent completes a focused task inside its own machine.
  • A typed agent summary that prints in your terminal after the task finishes.
  • A browser screenshot that shows the bug fix working inside the agent's computer.
  • A persistent workspace that pauses safely before resuming with the same files.
  • Secret Mission: Schedule the agent to run a recurring repository check and save its report in the persistent workspace.

Are there any prerequisites?

You need Node on your computer. You also need a free Upstash account.

Before We Start

Your coding agent needs a cloud machine before it can fix or test anything. Upstash Box supplies that machine.

Your local script needs Node.js to make Box API calls. An API key lets the script authenticate.

In this step, you will create the account that controls the machine. You will finish with a local project directory that can authenticate through an environment variable.

In this step, get ready to:
  • Create an Upstash account.
  • Install Node.js.
  • Prepare a local project directory with your API key available securely.
Create your Upstash account and key

Your Upstash account controls the cloud computers created by your script. The free account opens without requiring a payment card.

  • Visit the Upstash Console in your browser.
  • Choose your preferred account creation method.
  • Complete the sign-in process.
  • Confirm the dashboard opens without asking you to add a payment card.
  • Create a Box API key from the Upstash Console.
  • Name the key nextwork-box-agent.

Protect the new key

The new key is a live credential that can create resources in your account. Keep it on your machine.

Upstash only shows the complete value when you create it. Copy it before leaving the key view.

  • Copy the complete Box API key.
  • Close the key view after you have copied the value.

Why keep the key out of code?

Source files can be shared through repositories or screenshots. A local environment variable gives Node.js access to the key without placing the credential inside your script.

Can't create the Box API key?

Confirm you created your account directly through Upstash. Refresh the console after completing any email verification.

Use the official Upstash account guide if the sign-up process remains incomplete.

Help me finish my Upstash account setup and create a Box API key.

Check Node.js on your computer

Node.js runs the automation script from your computer. The version check tells you whether the runtime is already available.

  • Press Cmd+Space on macOS or the Windows key on Windows to open your search bar.
  • Type Terminal on macOS or PowerShell on Windows. Press Enter.
  • Check whether Node.js is available by running this command:
node --version

What does this command do?

The node --version command asks the installed Node.js runtime to print its version. A version number confirms your terminal can run Node scripts.

✔️ I see a version number

That version number confirms Node.js is ready to run your automation script.

  • Keep this terminal open for the rest of the setup.

ⓧ Command not found

Your computer needs Node.js before it can run the project script. The official installer includes the runtime plus npm.

  • Visit the official Node.js download page.
  • Select the LTS installer for your operating system.
  • Run the downloaded installer.
  • Return to the terminal from earlier after the installation finishes.
  • Check the installation by running this command:
node --version

What does this check prove?

The command prints the Node.js version now available to your terminal. This confirms the installer added the runtime to your system path.

You should see a version number in the terminal.

Still seeing a missing command?

Close the current terminal after the installer finishes. Use your operating system search to open a fresh terminal.

Help me make Node.js available in my terminal.

Prepare the local project

A dedicated directory keeps the Box automation separate from your other files. Your terminal must remain inside this directory when you create the script in the next step.

macOS

  • Create the upstash-box-agent directory on your Desktop by running these commands:
cd ~/Desktop
mkdir upstash-box-agent
cd upstash-box-agent
pwd

What do these commands do?

  • The first command moves your terminal to the Desktop.
  • The second command creates the upstash-box-agent directory.
  • The final command prints your current location so you can verify it.

You should see a path ending in Desktop/upstash-box-agent.

Directory already exists?

An existing directory can make the creation command report a problem. Run the remaining directory change command to use that folder.

Help me enter my existing project directory.

Windows

  • Create the upstash-box-agent directory on your Desktop by running these commands:
Set-Location ~/Desktop
New-Item -ItemType Directory upstash-box-agent
Set-Location upstash-box-agent
Get-Location

What do these commands do?

  • The first command moves PowerShell to the Desktop.
  • The second command creates the upstash-box-agent directory.
  • The final command prints your current location so you can verify it.

You should see a path ending in Desktop\upstash-box-agent.

Directory already exists?

An existing directory can make the creation command report a problem. Run the remaining location command to use that folder.

Help me enter my existing project directory.

Your terminal is now positioned inside the local project directory that holds the automation script.

Keep the key local

The next command places your credential in the current terminal session. Replace the placeholder with the key you copied from Upstash.

Keep this terminal open after setting the variable. A new terminal does not automatically inherit the value.

Before you run the final check, do you expect Node.js to find the key in this terminal session?

macOS

  • Store the copied key as UPSTASH_API_KEY in the current terminal by running these commands:
export UPSTASH_API_KEY="your-api-key-here"
node -e "console.log(process.env.UPSTASH_API_KEY ? 'API key loaded' : 'API key missing')"

What does this check do?

The first command adds the key to the current terminal environment. The Node.js check reads the variable without printing the credential.

You should see API key loaded in the terminal.

Seeing a missing key?

Confirm you replaced your-api-key-here with the key you copied. Run both commands in the same terminal.

Help me load the Upstash API key safely.

Windows

  • Store the copied key as UPSTASH_API_KEY in the current PowerShell session by running these commands:
$env:UPSTASH_API_KEY = "your-api-key-here"
node -e "console.log(process.env.UPSTASH_API_KEY ? 'API key loaded' : 'API key missing')"

What does this check do?

The first command adds the key to the current PowerShell environment. The Node.js check reads the variable without printing the credential.

You should see API key loaded in PowerShell.

Seeing a missing key?

Confirm you replaced your-api-key-here with the key you copied. Run both commands in the same PowerShell window.

Help me load the Upstash API key safely.

Setup complete. Node.js can now read your Upstash API key from the local environment without placing it in source control.

✔️ Awesome, I've got everything!

Your Upstash account is ready. Your local project directory can now run Node.js with the API key available.

ⓧ I'd like to double check the full code

At this point, your project contains setup state only. Use this checklist to compare your environment with the required end state.

  • Confirm your Upstash account opens without a payment card on file.
  • Confirm node --version returns a version number.
  • Confirm your terminal location ends in upstash-box-agent.
  • Confirm the environment check prints API key loaded without displaying the credential.

Your account credentials and local runtime are ready. Next up, you will use them to create a cloud machine for your coding agent.

Create Your Agent Box

Your account can now authorize requests. The agent still needs a cloud machine where it can work.

An Upstash Box supplies the remote workspace. This step gives it a Node.js runtime plus a coding agent.

You also provision a managed browser for the visual check later in the project. The script keeps the returned box ID so future calls can reach the same workspace.

In this step, get ready to:
  • Install the Box SDK in your local Node project.
  • Write the Box creation script.
  • Run the script to verify a running box in the dashboard.
Install the Box SDK

The local script needs the Box SDK to send requests to Upstash. The SDK provides the Box.create method used to provision the workspace.

  • Install the Box SDK in your current project by running this command:
npm install @upstash/box

What does this command do?

  • The npm command downloads the Box SDK into your local project.
  • The @upstash/box dependency gives your script access to Box.create.
  • Confirm the terminal prompt returns after the installation completes.

SDK Install Failed?

  • Check that your terminal is still inside the local project directory from the previous step.
  • Run the installation command again after your internet connection recovers.

Ask for help if the failure continues: help me troubleshoot the Box SDK installation

Write the creation script

A box selects its capabilities during provisioning. Your Box.create call requests every capability needed by the later steps.

  • Create agent-box-template.mjs inside your local project directory by using your code editor's new-file control.
  • Paste the following code into agent-box-template.mjs:
// Load the Box client plus the built-in Claude Code model
import { Agent, Box, ClaudeCode } from "@upstash/box"

// Provision the remote workspace with the capabilities used later
const box = await Box.create({
  apiKey: process.env.UPSTASH_API_KEY,
  runtime: "node",
  agent: {
    harness: Agent.ClaudeCode,
    model: ClaudeCode.Sonnet_5,
  },
  browser: true,
})

// Retain the generated ID for later calls to this workspace
const boxId = box.id
console.log(`Box created: ${boxId}`)

What Does This Code Do?

  • The import exposes the Box client plus the built-in agent configuration.
  • The apiKey setting reads the existing UPSTASH_API_KEY environment variable without placing the credential in the file.
  • The runtime: "node" setting creates a workspace with the Node runtime.
  • The agent configuration adds the Claude Code harness to the box.
  • The browser: true setting provisions managed Chromium when the box is created.
  • The boxId constant retains the generated identifier for subsequent operations.
  • Save agent-box-template.mjs.
  • Confirm agent-box-template.mjs appears in your code editor's file list.

Script File Missing?

  • Check that you created the file inside the local project directory shown in your terminal.
  • Confirm the filename ends with the .mjs extension.

Ask for help if the file or code looks different: help me check my Box creation script

✔️ Awesome, I've got everything!

Your creation script is saved with the runtime, agent, browser, and box ID handling in place.

ⓧ I'd like to double check the full code

Your complete agent-box-template.mjs file should match this reference.

// Load the Box client plus the built-in Claude Code model
import { Agent, Box, ClaudeCode } from "@upstash/box"

// Provision the remote workspace with the capabilities used later
const box = await Box.create({
  apiKey: process.env.UPSTASH_API_KEY,
  runtime: "node",
  agent: {
    harness: Agent.ClaudeCode,
    model: ClaudeCode.Sonnet_5,
  },
  browser: true,
})

// Retain the generated ID for later calls to this workspace
const boxId = box.id
console.log(`Box created: ${boxId}`)
Run the box

The Box.create promise resolves with a live Box instance. Its id property becomes the durable handle for that workspace.

Before you run the script, which new state do you expect the dashboard to show?

  • Create the box by running your script with this command:
node agent-box-template.mjs

What Does This Command Do?

  • The node command executes the ES module in agent-box-template.mjs.
  • The Box.create call sends the workspace configuration to Upstash.

You'll see Box created: followed by the generated box ID.

  • Switch back to the Upstash dashboard from the previous step.
  • Refresh the dashboard page.
  • Locate the box whose ID matches the terminal output.
  • Confirm the box shows a running status.

That's the infrastructure hurdle cleared. Your coding agent now has a live workspace with browser support.

Box Missing From the Dashboard?

  • Compare the dashboard box ID with the ID printed in your terminal.
  • Refresh the dashboard after the creation request finishes.
  • Check that UPSTASH_API_KEY remains available in the terminal if the script reports an authentication problem.

Ask for help with the terminal output if the box still does not appear: help me debug my missing Upstash Box

Your box is running with its ID retained in the script. Next up, you'll give the coding agent a task and print its typed summary.

Send the Coding Task

Your Upstash Box is running with its own filesystem. The generated box ID keeps your script connected to that workspace.

Now you will give the coding agent a bug-fix task. A typed response contract makes its final result predictable enough for your script to use.

In this step, get ready to:
  • Add a schema for the agent's typed response.
  • Submit a focused bug-fix task to the running box.
  • Print the agent's summary in your local terminal.
Prepare typed results

A response schema defines the exact fields the agent must return. You will use Zod to require a written summary plus a test result.

  • Install Zod in your local Node project by running this command:
npm install zod

What does this command do?

This adds Zod to your project's dependencies. Your script can use it to validate the structure returned by the agent.

Good, Zod is ready. Your script can now check the agent's answer before printing it.

Did the installation fail?

Confirm that your terminal is inside the same local Node project as agent-box-template.mjs. The package must be installed beside the script's existing dependencies.

Ask for help with the installation error:

Define the task contract

The agent needs a repository address plus a contract for its final answer. The schema keeps the summary separate from the test status.

  • Record the public bug-fix repository URL as https://github.com/your-org/your-app.
  • Return to agent-box-template.mjs from the previous step.
  • Scroll to the end of the file.
  • Add the repository value plus the response schema by copying this block:
const { z } = await import("zod")

// Point the agent at the repository that contains the bug.
const repositoryUrl = "[[REPOSITORY_URL=\"https://github.com/your-org/your-app\"]]"

// Require a concise summary plus the final test status.
const responseSchema = z.object({
  summary: z.string(),
  testsPassed: z.boolean(),
})

What does this code do?

  • The dynamic import loads Zod after the existing box creation code has run.
  • The repositoryUrl value tells the agent which repository to clone onto the box's persistent disk.
  • The responseSchema value requires a text summary plus a Boolean test result.
  • Save agent-box-template.mjs.
  • Confirm that the new block appears below the code that retains the generated box ID.

Does the schema show an error?

Check that every opening brace has a matching closing brace. Confirm that the property names are exactly summary plus testsPassed.

Ask for help checking the schema:

Run the coding task

The box.agent.run() call hands the prompt to the agent inside the box. The agent can use the box's shell plus persistent filesystem to clone the repository, edit the code, and run its tests.

  • Add the agent run below the response schema by copying this block:
const run = await box.agent.run({
  // Clone the repository, repair the bug, and verify the change with tests.
  prompt: `Clone ${repositoryUrl}. Fix the broken signup form validation and add a test. Run the test suite before you finish.`,
  responseSchema,
})

// Print the typed result so the completed work is visible locally.
console.log("Agent summary:", run.result.summary)
console.log("Tests passed:", run.result.testsPassed)

What does this code do?

  • The prompt gives the agent a focused definition of done. It must fix the validation bug plus add a test.
  • The responseSchema property makes the completed run return the structure you defined.
  • The final log statements expose the typed summary plus test status in your local terminal.
  • Save agent-box-template.mjs.

Before you run the script, do you expect the terminal to show free-form agent chatter or the two fields required by your schema?

  • Send the task to the coding agent by running this command from your local Node project:
node agent-box-template.mjs

What should I see?

Your terminal stays attached while the agent clones the repository, edits the signup validation, and runs the tests. Keep the terminal open until the run completes.

At the end, you will see Agent summary: followed by the agent's description of its fix. You will also see Tests passed: followed by the typed test result.

Did the agent run stop early?

Confirm that the repository URL points to a public repository. A private repository requires credentials that this project has not placed inside the box.

Check that the task block uses the existing box variable from Box.create().

Ask for help with the failed run:

That is the agent's first completed job on its own cloud computer. The fixed repository now lives on the box's persistent disk.

✔️ Awesome, I've got everything!

Great. Confirm that agent-box-template.mjs is saved before moving on.

ⓧ I'd like to double check the full code

Compare your complete agent-box-template.mjs file with this version:

import { Agent, Box, ClaudeCode } from "@upstash/box"

// Create a persistent Node workspace with an agent and browser.
const box = await Box.create({
  runtime: "node",
  agent: {
    harness: Agent.ClaudeCode,
    model: ClaudeCode.Sonnet_5,
  },
  browser: true,
})

// Retain the generated ID for later lifecycle operations.
const boxId = box.id
console.log("Box ID:", boxId)

const { z } = await import("zod")

// Point the agent at the repository that contains the bug.
const repositoryUrl = "[[REPOSITORY_URL=\"https://github.com/your-org/your-app\"]]"

// Require a concise summary plus the final test status.
const responseSchema = z.object({
  summary: z.string(),
  testsPassed: z.boolean(),
})

const run = await box.agent.run({
  // Clone the repository, repair the bug, and verify the change with tests.
  prompt: `Clone ${repositoryUrl}. Fix the broken signup form validation and add a test. Run the test suite before you finish.`,
  responseSchema,
})

// Print the typed result so the completed work is visible locally.
console.log("Agent summary:", run.result.summary)
console.log("Tests passed:", run.result.testsPassed)

Your coding agent has repaired the repository and reported the result in a predictable format. Next, you will open the fixed app inside the box's browser and capture visual proof that it works.

Verify the Fix in a Browser

The coding agent has changed the repository. Its typed summary explains the completed fix.

A summary cannot show the app's actual behavior. The Upstash Box headless browser gives you visual proof by opening the app and saving a full-page PNG screenshot.

In this step, get ready to:
  • Open the fixed app in the Box browser.
  • Capture the rendered page as a screenshot.
  • Inspect the screenshot for the requested fix.
Open the fixed app in the Box browser

The Box browser runs inside the same cloud machine as the fixed repository. This lets it reach the running app from the environment where the agent completed its work.

  • Locate the URL where the agent started the fixed app in the typed response from the previous step.
  • Record that address here: the fixed app URL.
  • Return to agent-box-template.mjs in your local Node project.
  • Move to the line immediately after the typed agent summary is printed.
  • Append the browser verification code by copying the following block:
import { writeFile } from "node:fs/promises"

// Open the fixed app after its server is ready.
const tab = await box.browser.tab.create("[[APP_URL="the fixed app URL"]]", {
  waitUntil: "domcontentloaded",
})

// Save visual proof of the rendered fix.
await writeFile("page.png", await tab.screenshot({ fullPage: true }))
console.log("Screenshot saved to page.png")

What does this code do?

  • The box.browser.tab.create() call opens the fixed app in a new browser tab.
  • The domcontentloaded value waits for the page structure to load before the script continues.
  • The tab.screenshot() call captures the entire scrollable page.
  • The writeFile() call saves the image as page.png beside your script.
  • Save agent-box-template.mjs by pressing Cmd+S (macOS) or Ctrl+S (Windows).

Before you run the script, consider whether the screenshot will match the agent's typed summary.

  • Run the updated automation script from your local Node project by using this command:
node agent-box-template.mjs

What does this command do?

The node command executes agent-box-template.mjs. The browser verification runs after the typed agent response is printed.

Chromium boots when the browser is used for the first time. The terminal should finish with Screenshot saved to page.png.

Screenshot not created?

Confirm that the fixed app URL points to the running app. Use the address from the agent task output.

Check that the app process is still running inside the Box before the browser tab opens. Also confirm that the Box was created with its browser enabled.

Ask for help with debugging the missing browser screenshot.

Inspect the browser screenshot

The saved image records what the Box browser rendered after the agent changed the repository. The visible result now provides evidence beyond the agent's summary.

Before you open the image, consider which visible detail should prove that the requested fix succeeded.

  • Press Cmd+Space (macOS) or the Windows key (Windows) to open your search bar.
  • Type Finder on macOS or File Explorer on Windows into the search bar.
  • Press Enter.
  • Navigate to the local Node project directory that contains agent-box-template.mjs.
  • Double-click page.png to open the screenshot.

You should see the corrected state described by your coding task. Compare the visible behavior with the typed agent summary.

That is the key proof captured. Your fixed app now renders successfully inside the Box browser.

Fix missing from the screenshot?

Check whether the screenshot shows the correct app page. A different URL can display an unrelated service or an older page.

Confirm that the app server loaded the repository files changed by the agent. Restart the app process inside the Box if it still serves an older build.

Ask for help with checking why the browser still shows the old behavior.

✔️ Awesome, I've got everything!

Great. Confirm that page.png shows the requested fix before moving on.

ⓧ I'd like to double check the full code

The browser verification section at the end of agent-box-template.mjs should look exactly like this.

import { writeFile } from "node:fs/promises"

// Open the fixed app after its server is ready.
const tab = await box.browser.tab.create("[[APP_URL="the fixed app URL"]]", {
  waitUntil: "domcontentloaded",
})

// Save visual proof of the rendered fix.
await writeFile("page.png", await tab.screenshot({ fullPage: true }))
console.log("Screenshot saved to page.png")

This section opens the app in the Box browser. It saves the rendered page as page.png for comparison with the typed agent summary.

You now have visual evidence that the coding agent's fix works in the running app. Next, you will snapshot the Box disk and confirm that its files survive a pause and resume.

Snapshot and Resume the Box

Your headless browser already proved that the bug fix works. That evidence covers the working app at this moment.

Your Upstash Box now needs to preserve the verified workspace after compute stops. A snapshot records the Box disk at this point in time.

Your Node.js script will pause the Box after it becomes idle. It will retrieve the same workspace with Box.get and inspect the retained files.

In this step, get ready to:
  • Capture a snapshot of the verified Box disk.
  • Check the idle state before pausing the Box.
  • Retrieve the Box and confirm that its repository remains on disk.
Add the persistence lifecycle

The lifecycle code checkpoints the repository after the browser verification. It then pauses the Box before reconnecting through its saved ID.

  • Open agent-box-template.mjs in your existing local project.
  • Move to the end of agent-box-template.mjs.
  • Append the persistence lifecycle by adding this code:
// Save the verified repository as a point-in-time checkpoint.
const snapshot = await box.snapshot({ name: "your-app-ready" })
console.log("Snapshot created:", snapshot.id)

// Confirm that the completed work has left the Box idle.
const { status } = await box.getStatus()
console.log("Status after work:", status)

// Pause the Box now so this project can test the resume cycle.
await box.pause()
console.log("Original box:", box.id)

// Retrieve the same Box and inspect its preserved workspace.
const sameBox = await Box.get(box.id)
const files = await sameBox.files.list("/workspace/home")
console.log("Retrieved box:", sameBox.id)
console.log("Files after resume:", files)

What does this code do?

  • The snapshot() call captures the Box filesystem after the bug fix has been verified.
  • The snapshot ID identifies the saved checkpoint.
  • The getStatus() call reports the Box state after the earlier work has finished.
  • The pause() call releases the Box compute while preserving its filesystem.
  • The Box.get call retrieves the existing Box through its generated ID.
  • The file request wakes the retrieved Box and lists the preserved workspace under /workspace/home.
  • Save agent-box-template.mjs.

This run repeats the earlier agent task before reaching the lifecycle code. Expect it to take several minutes while the agent finishes its work and the browser captures the result.

Before you run the script, do you expect the Box IDs to match after the pause?

  • Run the completed automation script by running this command:
node agent-box-template.mjs

What happens during this run?

The script creates the Box and completes the earlier bug-fix workflow. The new lifecycle code runs after the browser screenshot has verified the result.

The final file request reaches the retrieved Box. That request wakes its preserved workspace so the script can inspect the disk.

You should see a snapshot ID followed by the Box status. The values beside Original box: and Retrieved box: should match.

The output after Files after resume: should include the repository directory from the earlier agent task.

Lifecycle output missing?

Confirm that the lifecycle code sits at the end of agent-box-template.mjs. Code placed inside an earlier callback may never reach the pause step.

Check that the existing import still includes Box from the Box SDK. The retrieval call needs that class.

If the file list is empty, confirm that the path is exactly /workspace/home.

Ask for help with the lifecycle output.

Verify the retained workspace

Matching IDs prove that the script retrieved the original Box. The retained repository listing proves that pausing did not replace its filesystem.

Before you compare the results, do you expect the dashboard to show the same Box ID printed in both terminal lines?

  • Compare the values beside Original box: and Retrieved box: in your terminal.
  • Inspect the output beside Files after resume: for the repository directory.
  • Switch back to the Upstash dashboard from earlier.
  • Locate the Box whose ID matches the terminal output.
  • Confirm that the matching Box remains available after the pause and retrieval cycle.

You should see the same Box ID in both terminal lines and in the dashboard. The terminal file listing should still contain the repository whose bug fix appeared in your browser screenshot.

That closes the loop: the same Box reconnects after the pause. Its repository remains on disk with the bug fix you already verified in the browser.

✔️ Awesome, I've got everything!

Great work. Save agent-box-template.mjs with the snapshot and retrieval lifecycle in place.

ⓧ I'd like to double check the full code

Keep the cumulative script from the earlier steps unchanged. Confirm that the final lifecycle section of agent-box-template.mjs matches this reference exactly.

// Save the verified repository as a point-in-time checkpoint.
const snapshot = await box.snapshot({ name: "your-app-ready" })
console.log("Snapshot created:", snapshot.id)

// Confirm that the completed work has left the Box idle.
const { status } = await box.getStatus()
console.log("Status after work:", status)

// Pause the Box now so this project can test the resume cycle.
await box.pause()
console.log("Original box:", box.id)

// Retrieve the same Box and inspect its preserved workspace.
const sameBox = await Box.get(box.id)
const files = await sameBox.files.list("/workspace/home")
console.log("Retrieved box:", sameBox.id)
console.log("Files after resume:", files)

Secret mission

Build a Box Recovery Runbook

Your Box resumed with its earlier files intact. Turn that result into a recovery runbook that proves the same workspace survived from snapshot to working browser result.

Clean Up Your Resources

Clean Up Your Resources

The project fits the Upstash Box free tier. Stored cloud state remains after your final test.

Choose whether to keep your resources available, let the Box auto-pause for later, or delete the project resources entirely.

Cost warning

Paused Box storage or retained snapshots can build charges once your account moves beyond the free allowance.

The Delete option prevents these cloud resources from continuing to use storage.

Resources you used:

  • The Upstash Box retrieved through Box.get, including the repository files on its persistent disk.
  • The disk snapshot created after the bug fix and browser verification.
  • The local Node project directory containing agent-box-template.mjs.
  • The screenshot produced by the Box's headless browser after the bug fix.

Keep everything running

No action is needed. Choose this if you want to continue experimenting with the agent workspace.

  • Leave the Box idle when you are not using it.
  • Keep the disk snapshot available for future recovery.
  • Keep the local Node project directory as your automation template.
  • Keep keepAlive unset so the Box can auto-pause while idle.

Pause - I'll come back to this later

Auto-pause stops active CPU usage after the Box sits idle. Its disk state remains available for your return.

  • Stop sending new agent requests to the Box.
  • Stop sending new browser requests to the Box.
  • Keep keepAlive unset in agent-box-template.mjs.
  • Wait for the Box to return to its idle state.
  • Confirm in the Upstash dashboard that the Box is no longer active.
  • Leave the disk snapshot in place.
  • Leave the local Node project directory in place.

Delete - I don't want to use this again

Deleting the Box and snapshot permanently removes the cloud copy of the repository. Your automation script stays safe after you copy it out of the local project directory.

  • Return to the signed-in Upstash dashboard.
  • Select the Box that matches the generated box ID from your automation script.
  • Select the disk snapshot created after the bug fix.
  • Use the snapshot's deletion control to remove it.
  • Confirm the disk snapshot no longer appears for the selected Box.
  • Use the selected Box's deletion control to remove the Box.
  • Confirm the generated box ID no longer appears in the dashboard.

That closes the cloud storage loop. The remaining cleanup is local.

  • Copy agent-box-template.mjs from the local Node project directory to a separate location you use for reusable scripts.
  • Use your system's file manager to delete the local Node project directory.
  • Delete the browser screenshot from the location where you saved it.
  • Confirm the local Node project directory no longer appears in its original location.
  • Confirm the browser screenshot no longer appears in its original location.

Cleanup is complete. Your saved script now stands alone as a reusable template.

Nice Work!

Nice Work!

You did it! You built a Node automation script that gives a coding agent its own persistent Upstash Box. Your agent can now fix a repository bug inside a cloud workspace that survives an idle pause.

You've learned how to:

  • Create a browser-equipped coding workspace with Box.create. Run a bug-fix task inside it through box.agent.run.
  • Validate the agent's result through a typed response schema. Capture a browser screenshot that proves the requested fix works.
  • Preserve the workspace with a disk snapshot. Retrieve the idle Box with Box.get to confirm that its repository files persist.
  • Secret Mission: Pushed your persistent agent workspace further through the optional project extension.

Ready to quiz yourself?