Run a sequence of steps in one sandbox
POST /execute
Accepts two request shapes:
- Envelope (
ExecuteRequest):{ "steps": [...], "cache": ..., "stop_on_failure": ... }. The response is anExecuteResponse. SDKs always use this form. - Legacy list (
StepList): a bare array of steps. The response is a bareStepResultList. When the server cache is enabled, every step of a legacy request is treated as cacheable.
Steps run in order in a shared workspace mounted at /faber. Files
written by one step are visible to later steps; /tmp is shared too
but is not part of cached layers. Each task gets its own PID namespace,
cgroup and seccomp filter.
A step result has the same shape as its step: an object for a single task, an array (in the same order) for a parallel step.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
object
Program to run. Resolved through PATH inside the sandbox unless it contains a /.
object
Written to the task’s standard input, which is then closed
Workspace-relative path (normalized, no .., no leading /) to file
object
Absolute directory inside the sandbox to start in. Defaults to the workspace /faber.
Versioned seccomp policy. v2 profiles are allowlists (an unlisted
syscall fails with ENOSYS); v1 profiles are denylists. compile_*
tasks may create processes and namespace-scoped sockets (compilers,
interpreters, build tools); native_* tasks may do neither (running a
compiled submission). A denied syscall kills the task with SIGSYS
and outcome policy_violation.
Declares the task deterministic so its step may be stored in and
replayed from the step cache. A step is cacheable only when every
task in it is. Overrides the request-level cache default.
Tasks that run concurrently. Each has its own PID namespace and cgroup; they share the workspace.
object
Program to run. Resolved through PATH inside the sandbox unless it contains a /.
object
Written to the task’s standard input, which is then closed
Workspace-relative path (normalized, no .., no leading /) to file
object
Absolute directory inside the sandbox to start in. Defaults to the workspace /faber.
Versioned seccomp policy. v2 profiles are allowlists (an unlisted
syscall fails with ENOSYS); v1 profiles are denylists. compile_*
tasks may create processes and namespace-scoped sockets (compilers,
interpreters, build tools); native_* tasks may do neither (running a
compiled submission). A denied syscall kills the task with SIGSYS
and outcome policy_violation.
Declares the task deterministic so its step may be stored in and
replayed from the step cache. A step is cacheable only when every
task in it is. Overrides the request-level cache default.
Default for tasks that do not set cache. Only a leading run of
cacheable steps is ever cached: a step after a non-cacheable step
depends on state that may differ between runs, so it is always
executed. Ignored when the server cache is disabled.
When a step has a task that did not exit with status 0, report the
remaining steps as not_started instead of running them.
object
Program to run. Resolved through PATH inside the sandbox unless it contains a /.
object
Written to the task’s standard input, which is then closed
Workspace-relative path (normalized, no .., no leading /) to file
object
Absolute directory inside the sandbox to start in. Defaults to the workspace /faber.
Versioned seccomp policy. v2 profiles are allowlists (an unlisted
syscall fails with ENOSYS); v1 profiles are denylists. compile_*
tasks may create processes and namespace-scoped sockets (compilers,
interpreters, build tools); native_* tasks may do neither (running a
compiled submission). A denied syscall kills the task with SIGSYS
and outcome policy_violation.
Declares the task deterministic so its step may be stored in and
replayed from the step cache. A step is cacheable only when every
task in it is. Overrides the request-level cache default.
Tasks that run concurrently. Each has its own PID namespace and cgroup; they share the workspace.
object
Program to run. Resolved through PATH inside the sandbox unless it contains a /.
object
Written to the task’s standard input, which is then closed
Workspace-relative path (normalized, no .., no leading /) to file
object
Absolute directory inside the sandbox to start in. Defaults to the workspace /faber.
Versioned seccomp policy. v2 profiles are allowlists (an unlisted
syscall fails with ENOSYS); v1 profiles are denylists. compile_*
tasks may create processes and namespace-scoped sockets (compilers,
interpreters, build tools); native_* tasks may do neither (running a
compiled submission). A denied syscall kills the task with SIGSYS
and outcome policy_violation.
Declares the task deterministic so its step may be stored in and
replayed from the step cache. A step is cacheable only when every
task in it is. Overrides the request-level cache default.
Examples
Compile once (cached), then run two test cases in parallel
{ "stop_on_failure": true, "steps": [ { "cmd": "gcc", "args": [ "-O2", "-o", "main", "main.c" ], "cache": true, "files": { "main.c": "#include <stdio.h>\nint main(void){int a,b;scanf(\"%d %d\",&a,&b);printf(\"%d\\n\",a+b);return 0;}\n" } }, [ { "cmd": "./main", "stdin": "1 2\n", "sandbox_profile": "native_v2" }, { "cmd": "./main", "stdin": "40 2\n", "sandbox_profile": "native_v2" } ] ]}Legacy bare list
[ { "cmd": "echo", "args": [ "hello" ] }]Responses
Section titled “ Responses ”Every step ran or was skipped. Task failures (non-zero exit, timeouts, OOM, policy violations) are reported per task inside the body, not as HTTP errors.
object
The task’s process was created; its exit status and output are
reported. A cmd that cannot be executed (not found, not
executable) is reported here too: exit_code is 127 and stderr
starts with a faber: line saying why.
object
Exit status; 128 + signal number when killed by a signal
object
How the task ended
Signal number that ended the task, if any
Replayed from the step cache; stats are those of the original run
The task did not run to an exit status: its sandbox could not be set
up for it (for example a missing working_dir, outcome
infrastructure_failure), or it never started because an earlier
step failed (stop_on_failure) or the overall deadline had passed
(outcome not_started). A cmd that is not found is a
CompletedTaskResult with exit code 127.
object
object
How the task ended
Signal number that ended the task, if any
The task’s process was created; its exit status and output are
reported. A cmd that cannot be executed (not found, not
executable) is reported here too: exit_code is 127 and stderr
starts with a faber: line saying why.
object
Exit status; 128 + signal number when killed by a signal
object
How the task ended
Signal number that ended the task, if any
Replayed from the step cache; stats are those of the original run
The task did not run to an exit status: its sandbox could not be set
up for it (for example a missing working_dir, outcome
infrastructure_failure), or it never started because an earlier
step failed (stop_on_failure) or the overall deadline had passed
(outcome not_started). A cmd that is not found is a
CompletedTaskResult with exit code 127.
object
object
How the task ended
Signal number that ended the task, if any
object
Whether the server’s step cache is enabled
Steps replayed from the cache instead of executed
Steps executed by this request and written to the cache
The task’s process was created; its exit status and output are
reported. A cmd that cannot be executed (not found, not
executable) is reported here too: exit_code is 127 and stderr
starts with a faber: line saying why.
object
Exit status; 128 + signal number when killed by a signal
object
How the task ended
Signal number that ended the task, if any
Replayed from the step cache; stats are those of the original run
The task did not run to an exit status: its sandbox could not be set
up for it (for example a missing working_dir, outcome
infrastructure_failure), or it never started because an earlier
step failed (stop_on_failure) or the overall deadline had passed
(outcome not_started). A cmd that is not found is a
CompletedTaskResult with exit code 127.
object
object
How the task ended
Signal number that ended the task, if any
The task’s process was created; its exit status and output are
reported. A cmd that cannot be executed (not found, not
executable) is reported here too: exit_code is 127 and stderr
starts with a faber: line saying why.
object
Exit status; 128 + signal number when killed by a signal
object
How the task ended
Signal number that ended the task, if any
Replayed from the step cache; stats are those of the original run
The task did not run to an exit status: its sandbox could not be set
up for it (for example a missing working_dir, outcome
infrastructure_failure), or it never started because an earlier
step failed (stop_on_failure) or the overall deadline had passed
(outcome not_started). A cmd that is not found is a
CompletedTaskResult with exit code 127.
object
object
How the task ended
Signal number that ended the task, if any
Malformed request body or parameters (invalid_request)
object
Human-readable message
Stable machine-readable error code. Clients should treat unknown codes as internal_error.
Example
{ "error": "Failed to deserialize the JSON body into the target type: missing field `cmd`", "code": "invalid_request"}Missing or wrong API key (unauthorized)
object
Human-readable message
Stable machine-readable error code. Clients should treat unknown codes as internal_error.
Example
{ "error": "Missing or invalid API key", "code": "unauthorized"}Headers
Section titled “Headers ”A file_id referenced by a task is not in the file store (code = file_not_found)
object
Human-readable message
Stable machine-readable error code. Clients should treat unknown codes as internal_error.
Example
{ "error": "File not found: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "code": "file_not_found"}The body exceeds the configured size limit (payload_too_large)
object
Human-readable message
Stable machine-readable error code. Clients should treat unknown codes as internal_error.
Example
{ "error": "The request body is larger than the configured limit", "code": "payload_too_large"}The request is well-formed but not allowed: too many steps or
parallel tasks, or uploaded files referenced by its tasks that
together exceed the workspace size (limits_exceeded), or a
sandbox profile the service does not allow (profile_not_allowed).
object
Human-readable message
Stable machine-readable error code. Clients should treat unknown codes as internal_error.
Examples
Too many steps or parallel tasks
{ "error": "Task group exceeds configured execution limits", "code": "limits_exceeded"}Profile not allowed
{ "error": "Requested sandbox profile is not allowed by service policy", "code": "profile_not_allowed"}The API key has used up its requests (rate_limited). Sent only when
the service enables per-key rate limiting (RATE_LIMIT_PER_MINUTE).
Retry after the Retry-After header.
object
Human-readable message
Stable machine-readable error code. Clients should treat unknown codes as internal_error.
Example
{ "error": "Rate limit exceeded for this API key", "code": "rate_limited"}Headers
Section titled “Headers ”Seconds until the key may make another request
Sandbox setup or internal failure (sandbox_setup_failed, internal_error)
object
Human-readable message
Stable machine-readable error code. Clients should treat unknown codes as internal_error.
Examples
Sandbox could not be set up
{ "error": "Sandbox setup failed", "code": "sandbox_setup_failed"}Internal failure
{ "error": "Execution request failed", "code": "internal_error"}No execution slots are free (capacity_exhausted), the service is
shutting down (shutting_down), or the request was cancelled
(cancelled). Retry after the Retry-After header when present.
object
Human-readable message
Stable machine-readable error code. Clients should treat unknown codes as internal_error.
Examples
No free execution slots
{ "error": "Execution capacity is currently exhausted", "code": "capacity_exhausted"}Service is draining
{ "error": "Faber is shutting down", "code": "shutting_down"}Request cancelled
{ "error": "Execution was cancelled", "code": "cancelled"}Headers
Section titled “Headers ”Seconds to wait before retrying
The request overran its overall deadline and was killed (deadline_exceeded)
object
Human-readable message
Stable machine-readable error code. Clients should treat unknown codes as internal_error.
Example
{ "error": "Execution exceeded the overall deadline of 30000 ms and was killed", "code": "deadline_exceeded"}