Skip to content
GitHub Login

Sandboxes

Isolated environments for code execution on 8080 Edge — create, list, connect, and stop sandboxes via the CLI or API.

Sandboxes are short-lived, isolated compute environments tied to your 8080 project. They sit next to inference and Edge infrastructure so you can execute code—including AI-generated or agent-driven Python—safely, with access to the file system and utilities, without running that workload on end-user devices or a distant server.

The 8080 sandbox command group manages sandboxes from your terminal.

Prerequisites: Install and log in with the 8080 CLI (see Quickstart). Run commands from a project directory that you initialized with 8080 init.

8080 sandbox create starts a new sandbox and prints its ID. Use that ID with 8080 sandbox connect and 8080 sandbox stop when you are done.

8080 sandbox create
8080 sandbox connect <sandbox_id>
8080 sandbox list
8080 sandbox stop <sandbox_id>

Run 8080 sandbox --help for options (image, resources, labels, etc., as your CLI version exposes). Use 8080 sandbox connect to open an SSH-like interactive session into a running sandbox; replace <sandbox_id> with the ID from create or list.

The 8080 SDK offers an easy-to-use interface for creating and running code in a sandbox. To get started adding sandbox functionality to your 8080 application, add code like the following that implements tool calling with Python code execution:

from e80_sdk import eighty80_app
app = eighty80_app()
api = app.completion_sdk()
@app.tool
async def run_python(code: str) -> str:
"""
Execute Python code in a sandboxed environment and return the result.
Args:
code: Python code to execute. Use print() to output results.
"""
async with app.sandbox() as sandbox:
return sandbox.run_python(code)
@app.endpoint("/chat")
async def chat(request: app.Request):
body = await request.json()
body["tools"] = app.get_tools()
return api.chat.completions.create(**body)

You can create, list, and stop sandboxes over HTTPS with your 8080 API key (same Bearer token as the inference API). Paths below follow the usual https://api.8080.io/v1/... pattern; field names may match the CLI’s JSON output—check the API reference for the latest schemas.

POST /v1/sandboxes creates a sandbox for the project associated with your credentials (or the project you pass in the body, if supported).

curl -s -X POST "https://api.8080.io/v1/sandboxes" \
-H "Authorization: Bearer $_8080_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'

The response includes an id (and usually status). Use that id for connect-oriented flows and for stop.

GET /v1/sandboxes returns sandboxes for your project.

curl -s "https://api.8080.io/v1/sandboxes" \
-H "Authorization: Bearer $_8080_API_KEY"

Stop a specific sandbox by ID (exact method and path may be POST with a stop action—align with the published OpenAPI spec).

curl -s -X POST "https://api.8080.io/v1/sandboxes/<sandbox_id>/stop" \
-H "Authorization: Bearer $_8080_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'

Interactive connect sessions are negotiated by the CLI (authentication, routing, and session tokens). If you need programmatic access, use the endpoints documented for sandbox sessions or exec in the API reference, or continue to use 8080 sandbox connect <sandbox_id> for a terminal UI.