Configure AK/SK credentials or obtain valid short-lived STS credentials through
agentkit login. To inject a local Codex subscription into the sandbox, first complete codex login on your machine.End-to-end flow
1
Create a development tool
Create a If the project already has a suitable tool, skip this step and select it in later commands with
CodeEnv tool. The CLI waits for it to become ready and writes its ID and name to .agentkit/sandbox.yaml in the current project.--tool-id or --tool-name.2
Inject Codex login credentials
Inject the local Codex subscription into a dedicated session. Reuse the same Use
--session-id in later commands to return to that session.--auth-file or --codex-home to select another credential source. Set the provider to claude to inject a local Claude subscription instead.
With --provider codex, the CLI writes the Codex OAuth config inside the sandbox session; later codex commands in the same session use that login config and default model.3
Upload the project and open a terminal
sandbox exec provides an interactive terminal. --copy uploads the project before connection, and --mode tmux creates or attaches to a persistent terminal named after the session ID.agentkit sandbox exec --tool-name dev-sandbox --session-id dev --mode tmux to avoid uploading over remote edits again. After saving the tool name in .agentkit/sandbox.yaml, later commands can omit --tool-name.4
Transfer files
After the session exists, use
sandbox scp to copy files or directories between local and sandbox paths. Prefix remote paths with sandbox:.5
Open a web preview
Start a web server in the persistent terminal, for example on In the sandbox browser, navigate to
127.0.0.1:3000 inside the sandbox. The following command opens the sandbox browser interface, initially showing the session file directory:http://127.0.0.1:3000. This address belongs to the remote sandbox and is not reachable through your local browser’s loopback interface. sandbox web returns the sandbox browser interface URL; it does not publish an arbitrary application port as a public URLAdd --no-open to return the interface URL without opening a browser6
Clean up resources
Confirm that required files have been downloaded. To delete only the development session, identify both the tool and session. To delete the entire tool, omit the session ID.
Scripted execution
sandbox shell runs one non-interactive command in a session and outputs JSON, making it suitable for scripts:
sandbox exec tasks, write entries in agentkit-sandbox-run.yaml, then run agentkit sandbox run --config agentkit-sandbox-run.yaml. See the sandbox command reference for the configuration format.
Practical guidance
- Reuse a fixed
--session-idfor the development environment, and inspect locally cached sessions withagentkit sandbox list. - When a project has multiple tools, pass
--tool-idor--tool-nameexplicitly to avoid connecting to the wrong environment. - Use
sandbox exec --mode tmuxfor long-running interactive work, and regularly download important results to local or persistent storage. - Delete sessions and tools when they are no longer needed to stop consuming cloud resources.