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.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.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 that listens on an externally accessible port in the persistent terminal, then open its preview:Add
--no-open when a browser should not open automatically; the command outputs the preview URL.6
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.