Back to blog posts
Customer Case Study

7 min read

How Spawnlabs coding agents tested live preview URLs in Baseten Sandboxes

See how Spawnlabs coding agents tested live preview URLs in Baseten Sandboxes before code reached review.

Nicolas LecomteNico is a founder of Blaxel, who usually writes about AI, agentics, and the future of AI runtimes.

Spawnlabs built AI-powered software for EPC (engineering, procurement, and construction) companies in oil and gas. Its platform let users spawn coding agents that built full-stack tools. Those agents had to validate code without breaking production.

So each agent provisioned an isolated sandbox for every new feature or fix. It tested the live preview URL before the code reached review or production. Other providers offered compute but lacked instant previews.

Baseten Sandboxes, the infrastructure foundation for autonomous agents, closed that gap. A sandbox goes on standby after about 15 seconds of network inactivity. It resumes in under 25ms with state intact.

"Blaxel's support is amazing and the overall integration experience was smooth." - Teddy Oweh, Founder, Spawnlabs

Key takeaways

  • Spawnlabs agents provisioned a sandbox for every new feature or fix and ran QA on its live preview URL.
  • Other providers Spawnlabs evaluated offered compute but lacked the instant, real-time previews it required.
  • Baseten Sandboxes enter standby after about 15 seconds of network inactivity and resume in under 25ms with state intact.
  • Creating a preview doesn't start the app, so bind the dev server to HOST and avoid reserved port 80.

Spawnlabs built a multi-agent platform for domain-aware software

In January 2026, the platform helped users solve business problems and automate enterprise workflows. Ifechukwudeni (Teddy) Oweh founded Spawnlabs in September 2025. Its team included engineers from Apple, Microsoft, NASA, and LinkedIn.

High-operations industries, such as oil and gas, lack AI-native software for complex workflows that need deep domain expertise. These industries need custom tools that encompass workflows, automations, engines, and agents. They also need a platform that can build, maintain, scale, and continuously monitor these tools in production.

Spawnlabs addressed this problem with multiple agents (backend, frontend, DevOps, QA). The agents worked in parallel to create custom full-stack software tools. While many AI tools focus on simple UI generation, Spawnlabs provided an "army" of specialist agents.

They wrote code, deployed it, ran tests, and handled ongoing monitoring and security audits. The agents worked from simple natural-language descriptions of how things should work.

"The hardest problems within businesses have always been solved by software. We're doing that, but with AI-native tools." - Teddy Oweh, Founder, Spawnlabs

Spawnlabs agents needed to validate code without breaking production

Spawnlabs agents built deep technical architecture, including user interfaces, microservices, APIs, and background jobs. These agents generated hundreds of lines of code across the full stack. How could an agent verify that its code worked before the code reached a human reviewer or production?

Traditional CI/CD pipelines are often too slow or rigid for the iterative nature of autonomous agents. Spawnlabs agents needed a way to "see" their work in real time, run QA tests, and check logs. Their test environment had to mirror production while staying fully isolated.

In practice, the agents had to:

  • Deploy code to a live URL endpoint, so both the agent and the human customer could see changes instantly.
  • Iterate on complex back-end services, such as Python-based APIs, in isolated dev environments without affecting the stable production state.
  • Run continuous security evaluations and code tests to confirm code held up before deployment.

Spawnlabs used Baseten Sandboxes to support these goals. Once an agent wrote a new feature or fix, it provisioned a sandbox with the Python SDK. The sandbox served as a development and test instance.

Agents then used this sandbox to iterate on code, run unit tests and security checks, and prepare for deployment.

"The agent starts a dev instance on Blaxel, and we go from there. If it's an API, we get live URL endpoints and we just run QA on that. If it's a website, our browser agents go through the entire website, clicking buttons, checking flows, and also checking browser logs. Because the agent has access to logs and the codebase, it can start to iterate on things in real time." - Teddy Oweh, Founder, Spawnlabs

Baseten Sandboxes provide fast, secure preview environments for agents

The Spawnlabs team evaluated several sandbox and compute providers before selecting Baseten Sandboxes. While other providers offered compute, they lacked the specific "killer feature" Spawnlabs required: instant, real-time previews. When workflows were tightly interconnected, users needed to see changes before they went live.

Isolation and secure code execution also mattered to Spawnlabs' enterprise customers. Each sandbox runs as a Firecracker microVM.

Spawnlabs requirementHow Baseten Sandboxes handle it
Instant web accessBuilt-in public and private preview URLs, with multiple previews per sandbox
Agentic controlPython SDK for automated provisioning
SpeedResume from standby in under 25ms, with state intact
SecurityVM-level isolation for executing untrusted agent code

"I personally love the previews. They really give us the quality of service that we need. That is the most important thing for us." - Teddy Oweh, Founder, Spawnlabs

How real-time previews work for coding agents

A shareable preview URL routes requests to the application inside a sandbox. The Python SDK creates both the sandbox and the preview.

A coding agent can edit files and run commands to test a change. A real-time preview gives the agent and its reviewer a running application to inspect alongside the diff.

The preview request path is:

(1) Agent edits files → sandbox → dev server listening on its port
(2) Browser or QA agent → preview URL → sandbox port → dev server
(3) Dev server response → preview URL → browser or QA agent

Creating the preview doesn't start the application.

Start the dev server and check that it responds before handing the URL to a reviewer:

  1. Create or reuse the sandbox: Call SandboxInstance.create_if_not_exists(), which creates the sandbox or reuses it if it already exists. The region parameter is optional today but will become mandatory in a future SDK version.
  2. Bind the dev server to HOST: Each sandbox gets an injected HOST environment variable. Bind your server to that address. The server must be reachable externally for the preview to load.
  3. Pick a port: Point the preview at the port your dev server listens on. The system reserves port 80, so run dev servers on a port such as 3000.
  4. Create the preview: Call sandbox.previews.create_if_not_exists() with a name and the port. Preview names only need to be unique within a sandbox. Read the URL from preview.spec.url.
  5. Choose the access mode: Previews are public or private. For a private preview, list its tokens and reuse one that stays valid for your session.

The access mode controls who can open the preview:

Public previewPrivate preview
AccessNo authenticationToken required
Setup"public": True in the preview specObtain a valid token and reuse it for URL access
ExposureAnyone holding the link reaches the appOnly token holders reach the app
FitsCustomer demos and browser agents without an auth flowInternal QA and apps that serve sensitive data

A single sandbox can host several previews. A full-stack build could expose the API on one port and the frontend on another. Each preview gets its own URL. To serve previews from your brand's domain, register it as a custom domain.

A custom domain also turns on wildcard subdomains. You can then designate a fallback preview to catch requests for unrecognized subdomains instead of returning a 404.

A preview's response headers can set Cross-Origin Resource Sharing (CORS) rules. With those rules, a frontend on another origin can call the API preview.

Previews also follow the sandbox lifecycle. Without an active connection, a sandbox enters standby after about 15 seconds and keeps its state. External network connections that are open at that transition don't survive it.

An active WebSocket or TCP connection has a 15-minute no-data limit. Once that limit passes, the connection closes, and the sandbox enters standby. After standby, have your QA agent open a new connection instead of reusing the old one.

What previews gave Spawnlabs and how to set them up

When this case study first ran in January 2026, Spawnlabs used what is now Baseten Sandboxes. The company delivered AI-generated software to a range of oil and gas firms and planned to expand to other industries.

The ability to "spawn" safe, previewable environments on demand was a core component of its technical advantage. By offloading preview-infrastructure management to Baseten Sandboxes, Spawnlabs could focus on refining the logic of its multi-agent platform.

Agent Drive (in private preview) adds shared artifact storage across sandboxes.

This Python SDK example creates a Baseten Sandbox, then a public preview with CORS headers:

Python
import asyncio
from blaxel.core import SandboxInstance

async def main():
# Create a new sandbox, or reuse it if it already exists
sandbox = await SandboxInstance.create_if_not_exists({
"name": "my-sandbox",
"image": "blaxel/base-image:latest", # public or custom image
"memory": 4096, # in MB
"ports": [{ "target": 3000 }], # optional; ports to expose
"region": "us-pdx-1" # optional today; will become mandatory in future SDK versions
})

`# Create public preview, or reuse it if it already exists`  
`preview = await sandbox.previews.create_if_not_exists({`  
    `"metadata": {"name": "my-preview"},`  
    `"spec": {`  
        `"port": 3000,`  
        `"public": True,`  
        `"responseHeaders": {`  
            `"Access-Control-Allow-Origin": "https://example.com",`  
            `"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS, PATCH",`  
            `"Access-Control-Allow-Headers": "Content-Type, Authorization, X-Requested-With, X-Blaxel-Workspace, X-Blaxel-Preview-Token, X-Blaxel-Authorization",`  
            `"Access-Control-Allow-Credentials": "true",`  
            `"Access-Control-Expose-Headers": "Content-Length, X-Request-Id",`  
            `"Access-Control-Max-Age": "86400",`  
            `"Vary": "Origin"`  
        `}`  
    `}`  
`})`

`# Get preview URL`  
`url = preview.spec.url`  

if __name__ == "__main__":
asyncio.run(main())

FAQs about real-time previews for coding agents

What are real-time previews for coding agents?

A real-time preview is a live URL for the dev server inside an agent's sandbox. The agent and a human reviewer open the same running app while the agent keeps editing. Spawnlabs used previews for API checks and browser-agent QA before code reached production.

Why does a sandbox preview URL show nothing when the dev server is running?

The server usually isn't reachable from outside the sandbox. Bind it to the address in the HOST environment variable instead of localhost. Also confirm the preview targets the port the server listens on. Port 80 won't work because the system reserves it.

Should a coding agent's preview be public or private?

Use a private preview when the app touches sensitive data or internal systems. Access then requires a token. Public previews suit demos and automated browser checks because they need no authentication.

Related articles