Separate the client from execution
The client is the program that sends commands: your agent or another application. The sandbox runs those commands and returns output, files, and status. The client can inspect the results before sending the next command.
Define the starting point
Save the code and configuration as an exact source revision. Record the input version and the subset to read. Specify the tools, resource limits, and storage and service access the task needs.
The Datalab custom resource declares team resources, virtual clusters, and session storage in Kubernetes.
Follow the execution loop
This example describes the steps. Use your platform’s client to carry them out:
Conceptual pseudocode
source = save_code_and_config(project)
inputs = select_data_snapshot(dataset, version)
environment = define_environment(tools, resources)
execution = start(environment)
execution.send(source)
result = execution.run(task, inputs)
assessment = evaluate(result, acceptance_checks)
save_run(source, inputs, environment, task, result, assessment)
execution.stop()
Read large inputs from their existing storage using fixed data references. Inspect the output before revising the approach or saving the result.
Save what the next run needs
Before stopping the sandbox, save useful source changes and outputs in storage that will remain available. Link them to the input data, environment, command, and checks in a run record.
Saved files can be reused by a new sandbox. Running processes stop with the old one; they cannot resume from a source revision.
For a concrete deployment example, read the Provider Datalab sandbox guide. It explains how to start a sandbox, send files and commands, and reuse session storage after replacing the workload.
For process and file API details, see the upstream Agent Sandbox Runtime API. Use the interfaces supported by your deployed runtime version.