Skip to content

File transfer

File transfer should be explicit. A narrow copy operation is easier to audit and reason about than a broad writable host mount.

Terminal window
cargo run -- cp ./input.json filebox:/work/input.json
cargo run -- exec filebox -- python /work/process.py /work/input.json
Terminal window
cargo run -- cp filebox:/work/output.json ./output.json

Use host mounts only when the workflow is intentionally a development workflow and the mounted path is narrow.

Status: Planned lifecycle API.

sandbox.files.write("/work/input.json", input_bytes)
result = sandbox.exec(["python", "/work/process.py"])
output = sandbox.files.read("/work/output.json")
  • Validate guest paths; reject traversal such as ../.
  • Treat symlinks carefully when reading from the guest.
  • Avoid mounting $HOME, credential directories, SSH agents, or cloud config paths.
  • Treat snapshots as containing any files that existed in the guest at snapshot time.