See it in code
Start a service. Run a command. Keep working.
Save the first tab as sandbox/sandbox.yaml, start the service, then connect to its running project and run. Each command uses the image and resources you configured; the service stays available between calls.
kind: component
version: 1.1
name: sandbox-dev
plugins:
sandbox: true
run:
kind: service
container:
image: python:3.11
command: ["sleep", "infinity"]The Python, Files, and CLI tabs attach to a running service. Files inside its container are temporary; save useful results before stopping it.
Use one environment for people and agents
- Agent tools: Let an application run a bounded command, inspect files, and return results from a selected service run. The host application chooses the tools and approval policy.
- Interactive debugging: Enter the same container through a terminal, notebook, or optional SSH access to inspect a failing workload with its real dependencies.
- Repeatable evaluations: Reuse a configured image, GPU request, and data connections across sessions instead of rebuilding the environment for every task.
Bring the image and resources your task needs
Choose the container image, working directory, storage, connections, CPU or GPU resources, and placement settings. Enable the sandbox plugin to expose process, file, and terminal access inside that service container.
Keep reusable settings in a component or preset so a developer or agent can return to the intended environment. Sessions use the same workload configuration model as other Polyaxon services.
Automate commands or work interactively
Use Python or the CLI to execute commands and move files. Stream output from a long command, or start a background process and keep its execution ID to inspect it later. Use the PTY interface when the task needs an interactive terminal.
For hands-on work, run a notebook in the same service. Add the optional SSH plugin for an IDE or native terminal, or the tmux plugin for a reconnectable shell.
Automate with Python or CLI · Use notebooks · Choose interactive access plugins
Save results, then stop the service
Download useful files from the scratch workspace or write them to the run's synced outputs path. Put lasting code changes in Git and repeated dependency changes in the image. Logging an artifact reference records metadata; it does not copy an arbitrary scratch file into durable storage.
Stop the backing run when work finishes: closing a client or terminal does not release its CPU, memory, or GPU resources. Configure a timeout and an activity probe if you need idle-based cleanup.
Set the boundary for the code you run
Commands use the service container's user, mounts, credentials, and network access. Attach only the connections needed for the task, and set Kubernetes security and network controls for the code's trust level.
Polyaxon authenticates access to the selected run. The sandbox plugin does not add a microVM isolation boundary or make arbitrary hostile code safe. If an agent invokes commands, its host application must decide which tools it exposes and which actions need approval.
Secrets and connections · Network access · Agent code execution