This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Sandboxes and results
Edit page
Learn where agent work runs, and how to save and retrieve the evidence that an agent produces.
Where the work runs
These resources are separate from each other. That separation does not make repository content, tool output, or generated files trustworthy. See Permissions and security.
Choose a result format
- Sandbox artifact: A file that the agent uploads from a sandbox with
sandbox_artifact_create. It has an artifact ID, and you can retrieve it after the sandbox stops. - Workflow document: Markdown that a
type: docjob shows in the workflow logs. Use it to summarize results. It does not replace the evidence. - Patch file: A diff that the agent saves with
git diffand uploads as an artifact. The agent cannot push to your repository, so a person applies the patch to a branch.
A file in a running sandbox is none of these until the agent uploads it.
Save a file before stopping the sandbox
- Call
sandbox_artifact_createwith the sandbox ID, the path, and a name that is unique within the agent run. - Check the upload
status:uploaded: Expo stored the file.uploading: The upload is still in progress.failed: Diagnose the error, then retry with a different name.
- For an upload in progress, call
sandbox_artifact_getuntilsizeanddownloadUrlare not null. - Stop the sandbox only after the upload is complete.
A sandbox can have up to 20 artifacts, and each one can be up to 4.995 GiB. To export a directory, make an archive in the sandbox and upload that file. Include only the files that the result needs.
Retrieve results
Call sandbox_artifact_list with the sandbox ID to find its artifacts. Then call sandbox_artifact_get with the artifact ID to request a download URL. Both calls work after the sandbox stops.
A download URL expires after 15 minutes, and each call returns a new one. Expo deletes artifact files 90 days after the upload. Put the artifact ID in your report, because a signed URL is not a permanent reference. Assume that anyone who has a valid signed URL can use it until it expires.
Review files before you share them. Treat downloaded artifacts as untrusted input, especially when the project code or the prompt came from an untrusted source.
Download an artifact in a later job
Use the eas/download_sandbox_artifact function to download an artifact in a later job. The function finds the artifact in one of two ways:
- By the
agent_run_idoutput of the agent job and the name that the agent gave to the artifact. Use this when the prompt sets the name, so that you know it before the workflow runs. - By the artifact ID. Use this when you already have the ID, for example from a report or from
sandbox_artifact_list.
jobs: my_job: steps: - uses: eas/download_sandbox_artifact with: agent_run_id: string # Required if artifact_id is not provided. The agent_run_id output of an agent job. name: string # Required if artifact_id is not provided. The name of the artifact in the agent run. artifact_id: string # Required if agent_run_id and name are not provided. The ID of the artifact.
The function has these inputs:
The function has these outputs:
In this example, the agent reviews a pull request and uploads a report with the name report. The next job downloads the report and prints it:
The step fails if the agent run has no artifact with that name, or if the upload did not finish. The downloaded file is untrusted input, and the later job can have access to your project's secrets. Check the file before a step runs or publishes it.
Turn evidence into a report
Add a job that validates the expected evidence and sets the workflow outputs. Then add a type: doc job that shows those outputs. Keep the final pass or fail gate in a separate job, so that a failed test still produces a readable report. For a type: doc job that runs after an agent job, see Test pull request changes on Android and iOS.