Agent Skills
Namespace publishes Devbox skills innamespacelabs/agent-skills. A skill is an instruction pack for coding agents. It gives the agent a repeatable workflow for creating Devboxes, loading source code, running commands, and cleaning up after the task.
For a worked example, see Testing with Devboxes and agent skills.
Install the skill in a project when you want the repository to carry the same agent instructions for everyone. Install it globally when you want to use the skill across projects from your own machine.
- Project
- Global
Run this from the project directory:
Creating and Configuring Devboxes
Agents usually create Devboxes non-interactively. For a simple one-off task, the CLI flags are enough. For repeatable tasks, a spec file gives the agent a concrete configuration to generate, review, and reuse.Ephemeral Devboxes
Ephemeral Devboxes are useful for one-off agent tasks. An agent can create an ephemeral Devbox, load source code onto it, run a build or test command, collect the result, and stop it.ephemeral ties the Devbox’s instance and storage to a single run. When it stops, both are deleted, which is useful for fire-once test or build runs.
Create an ephemeral Devbox from the CLI:
Spec File Configuration
A spec file lets an agent define the Devbox name, image, size, repository, lifecycle, and network policy in one place.devbox.yaml
name_prefix when the agent should not choose an exact Devbox name. Namespace appends a random suffix to the prefix. This lets several agents or shards create Devboxes at the same time without colliding on names.
Dynamic Configuration with Stdin
Agents can also generate a spec dynamically and pass it over stdin. Pass- to read the spec from stdin.
--from_format for JSON or TOML.
Egress Filtering
A Devbox can be restricted to a list of allowed outbound domains. This is useful when an agent should only reach source hosts, package registries, model APIs, or other services needed for the task. Setnetwork_policy.egress_domains in the Devbox spec. Prefix a domain with *. to include its subdomains. Namespace infrastructure domains are allowed so the Devbox can operate.
network_policy to use the workspace default. If a task needs private services, combine domain allowlists with your existing workspace integrations and access controls.
See Egress filtering for more details, including how to monitor allowed and denied outbound requests.
Handling Secrets
Do not put tokens or passwords in prompts or spec files. Store them in the Namespace vault and reference the secret ID from the Devbox spec.Pool API
The Pool API lets an agent reuse warm Devboxes across tasks. A pool is identified by a tag. When the agent has work to do, it acquires a Devbox from that pool. If an unleased Devbox already exists for the tag,devbox acquire leases it and returns its name. If none is available, Namespace creates a new Devbox, adds it to the pool, leases it, and returns the new name. When the task finishes, the agent releases the lease and the Devbox stays available for later work.
devbox delete when the pool member should be removed.
Useful Commands for Agents
Agents usually drive Devboxes through non-interactive CLI commands. Three are especially useful:devbox exec for running commands inside the Devbox, devbox logs for reading their output, and devbox upload for copying files in. devbox ssh remains the right choice when a task needs a terminal or piped input.
Run Commands with devbox exec
devbox exec runs a command in a Devbox. This is useful after the agent has acquired a lease or created an ephemeral Devbox.
-- separates Devbox CLI arguments from the command that should run inside the Devbox.
Each run is recorded as an execution with its own ID, and its output is retained on the Devbox. This suits agents well: the agent can read the output when it needs it, rather than holding a connection open for the duration of the command.
For long-running commands such as test suites and builds, start the command detached with -d. The CLI returns the execution ID immediately, and the command keeps running independently of the agent’s connection:
devbox exec go before the Devbox name.
See Executing Commands for the full reference.
Stream Output with devbox logs
devbox logs streams the output of an execution. It replays the output captured so far, then follows the live output, and returns when the execution completes.
devbox logs list with JSON output:
exit_code. This is how an agent checks whether a detached run succeeded.
Upload Files with devbox upload
devbox upload copies a local file into a Devbox. Agents commonly use it to upload a patch, a generated config file, or a test artifact.
When to Use devbox ssh
devbox ssh also runs commands, and it allocates a terminal and forwards standard input — so reach for it when the task needs an interactive program or piped data:
devbox exec, so the run is recorded and its output retained.
Claude Managed Agents
Claude Managed Agents can run on Namespace Devboxes. Each Claude agent session is backed by an ephemeral Devbox that is provisioned when the session starts. See the Claude integration guide for setup steps.Cursor Cloud Agents
Cursor Cloud Agents can run on Namespace Devboxes. Each agent session is backed by a fresh Devbox that is provisioned when the session starts, and torn down when the session ends. See the Cursor Cloud Agents guide for setup steps.Devin
Devin agents can run on Namespace Devboxes. Each Devin session is backed by a fresh Devbox that is provisioned when the session starts, and the Devboxes used by Devin can run on both Linux and macOS. See the Devin on Devboxes guide for setup steps.Best Practices
- Expire ephemeral Devboxes and release leases on success, failure, and cancellation so work does not keep running after the agent is done.
- Treat pooled Devboxes as warm, not clean. Reset the repository, check out the intended ref, and apply the current task’s changes before running commands.
- Use
name_prefixfor parallel work to avoid name collisions when several agents or shards create Devboxes at the same time. - Use
--no_checkoutorrepository.disabled: truewhen the agent needs a sandbox but does not need the default repository. - Use
from_secret_idfor secrets andnetwork_policy.egress_domainsto restrict outbound access to the domains the task needs. - Start long-running commands with
devbox exec -dand collect their output withdevbox logs, so the run is not tied to the agent’s connection.