You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SSH/SCP — requires SSH access to the sandbox, not available in all deployment modes (Kubernetes, remote gateways)
exec with stdin piping — exec(["cat", ">", path], stdin=bytes) breaks on binary content, hits the 4MB gRPC message size limit, loses permissions, and requires shell tools in the image
None of these work for SDK consumers who need typed, streaming, resumable file transfer as part of their programmatic workflow.
Use cases
1. Platform-managed sandboxes (Mode 2)
A platform worker (Anthropic, OpenAI) creates sandboxes on behalf of agents. The worker needs to seed files before execution and retrieve artifacts after.
Anthropic Managed Agents: Worker polls a queue, claims a session, downloads skill files into /workspace/skills/, runs the agent, then uploads output artifacts back to the platform.
OpenAI Agents SDK: Developer writes Manifest(entries={"repo": LocalDir(src="./myproject")}). The SDK calls session.write() per file during materialization. Without an UploadFile RPC, session.write() has no clean implementation — the adapter either raises NotImplementedError or falls back to exec-based hacks.
2. Framework sandbox extensions (Mode 3)
The developer's process owns the agent loop. The SDK is embedded in the same process.
OpenClaw mirror mode: Before every command, the workspace is synced into the sandbox. After every command, changes are synced back. Currently shells out to the CLI 5+ times per cycle. A streaming file transfer RPC would replace all of this with direct gRPC calls.
CI/CD pipelines: Spin up a sandbox, seed the repo checkout and test fixtures, run tests, retrieve coverage reports and build artifacts. All from a script, no CLI binary packaging needed.
3. Read-only file injection at creation time
Operators need to inject tamper-proof configuration files (persona files, policy overrides, credential bundles) that the agent can read but never modify. The current --upload runs after Landlock enforcement as the sandbox user, so it cannot write to read-only paths. File injection through gRPC before Landlock enforcement solves this. (See #1268 for the full proposal.)
4. Multi-file uploads at creation time
Today --upload accepts only one path. Seeding a sandbox with multiple directories requires tarring them together or running sandbox upload separately after creation. (See #1635 for the CLI-side fix; this issue covers the underlying RPC that both CLI and SDK would use.)
5. Async SDK consumers
SDK consumers in async frameworks (Temporal, FastAPI) need non-blocking file transfer. The current Python SDK is entirely synchronous — every call requires asyncio.to_thread(). Streaming file transfer should be designed async-first so consumers don't need to wrap every call.
6. Large file and binary content handling
Agent workloads increasingly involve large artifacts: model weights, datasets, compiled binaries, container images. The 4MB default gRPC message size limit and exec-based workarounds cannot handle these. Streaming with 64KB chunks keeps memory constant regardless of file size.
Problem
There is no programmatic way to move files in and out of sandboxes. Every file transfer today goes through either:
--uploadflag — works only at creation time, requires the CLI binary, single directory only (feat: support multiple --upload flags on sandbox create #1635 tracks multi-upload)execwith stdin piping —exec(["cat", ">", path], stdin=bytes)breaks on binary content, hits the 4MB gRPC message size limit, loses permissions, and requires shell tools in the imageNone of these work for SDK consumers who need typed, streaming, resumable file transfer as part of their programmatic workflow.
Use cases
1. Platform-managed sandboxes (Mode 2)
A platform worker (Anthropic, OpenAI) creates sandboxes on behalf of agents. The worker needs to seed files before execution and retrieve artifacts after.
Anthropic Managed Agents: Worker polls a queue, claims a session, downloads skill files into
/workspace/skills/, runs the agent, then uploads output artifacts back to the platform.OpenAI Agents SDK: Developer writes
Manifest(entries={"repo": LocalDir(src="./myproject")}). The SDK callssession.write()per file during materialization. Without an UploadFile RPC,session.write()has no clean implementation — the adapter either raisesNotImplementedErroror falls back to exec-based hacks.2. Framework sandbox extensions (Mode 3)
The developer's process owns the agent loop. The SDK is embedded in the same process.
OpenClaw mirror mode: Before every command, the workspace is synced into the sandbox. After every command, changes are synced back. Currently shells out to the CLI 5+ times per cycle. A streaming file transfer RPC would replace all of this with direct gRPC calls.
CI/CD pipelines: Spin up a sandbox, seed the repo checkout and test fixtures, run tests, retrieve coverage reports and build artifacts. All from a script, no CLI binary packaging needed.
3. Read-only file injection at creation time
Operators need to inject tamper-proof configuration files (persona files, policy overrides, credential bundles) that the agent can read but never modify. The current
--uploadruns after Landlock enforcement as the sandbox user, so it cannot write to read-only paths. File injection through gRPC before Landlock enforcement solves this. (See #1268 for the full proposal.)4. Multi-file uploads at creation time
Today
--uploadaccepts only one path. Seeding a sandbox with multiple directories requires tarring them together or runningsandbox uploadseparately after creation. (See #1635 for the CLI-side fix; this issue covers the underlying RPC that both CLI and SDK would use.)5. Async SDK consumers
SDK consumers in async frameworks (Temporal, FastAPI) need non-blocking file transfer. The current Python SDK is entirely synchronous — every call requires
asyncio.to_thread(). Streaming file transfer should be designed async-first so consumers don't need to wrap every call.6. Large file and binary content handling
Agent workloads increasingly involve large artifacts: model weights, datasets, compiled binaries, container images. The 4MB default gRPC message size limit and exec-based workarounds cannot handle these. Streaming with 64KB chunks keeps memory constant regardless of file size.
Proposed design
From RFC 0006:
is_archiveflag enables directory transfers as tar streams without requiringtarin the sandbox image.Why streaming, not tar-over-exec-stdin
tarImplementation scope
upload_path()/download_path()methods--uploadto use the new RPC internallyOpen questions
Related issues
feat: support multiple --upload flags on sandbox create(CLI-side, would use this RPC)feat: inject read-only files into sandbox at creation time(pre-Landlock injection, complementary)Python and TypeScript SDK Support(parent roadmap item)