When every coding agent on a team has its own machine, the machines are meant to be thrown away. A sandbox's disk is deleted when it stops. A build host lease ends and the host goes with it. That is the point: nothing from one run leaks into the next.
It also means the things a reviewer needs (the full test report, the coverage output, the release build, the log from the flaky test) vanish with the machine unless the agent puts them somewhere first. Pasting them into a pull request comment works for ten lines. It does not work for a 40 MB coverage report or a binary.
The usual answer is object storage. This post lays out how a team can organize agent artifacts in S3-compatible storage, with Sandscale object storage as the example. The steps come from the object storage guide and the Sandscale CLI (1.4.1) help.
What counts as an artifact
Keep the definition narrow, or the bucket becomes a second file system:
- Keep: test and coverage reports, build outputs a reviewer or a later job will use, logs from failed runs, screenshots from browser tests.
- Don't keep: dependency caches (they have their own place), the whole working tree (it is in git), and anything with a secret in it, including
.envfiles and dumped environment variables.
A layout that answers "which run made this?"
One bucket per repository or project, and a prefix per run:
s3://acme-web-agent-artifacts/ <branch>/<run-id>/test-report.xml <branch>/<run-id>/coverage/ <branch>/<run-id>/logs/ run-id can be the sandbox ID, the build lease ID, or the agent's task ID: anything that also appears in your audit log, so a file can be traced back to the machine and the person that produced it. Branch first means a reviewer looking at a pull request finds everything for that branch in one place.
Step 1: create the bucket
sandscale storage bucket-create --name acme-web-agent-artifacts The command changes state, so it asks before sending (or takes --yes in a script). It also accepts --versioning Enabled and --object-lock if you want them. Buckets are created through the API, the CLI, MCP or the console, not over S3 itself. sandscale storage buckets-list and sandscale storage bucket-describe --name ... show what you have and its usage.
Step 2: find the S3 endpoint
sandscale objects describe-objects-service --body '{}' --json The answer has the region's S3 Endpoint and the SigningRegion to sign requests with. Object storage runs in the United States. Every S3 tool needs both values, and path-style addressing ($ENDPOINT/bucket/key).
Step 3: an access key for the agents, scoped and stored
S3 tools sign requests with an access key, not your Sandscale API key. Two rules from the guide shape how a team handles this:
- A key is created by a person. You create it in the console, or with
sandscale storage access-key-createfrom your own signed-in session. An API key cannot create one, and Sandscale asks you to confirm it is you. The secret is shown once. - A key can be narrow. It can be limited to some buckets, key prefixes and network addresses, and it expires within 365 days. It never grants more than the person who made it holds.
So make one key for agent artifacts, limited to this bucket (and to a prefix, if different agents should not overwrite each other), with an expiry you will actually rotate before. You can hold two keys at once, which is what makes rotation with overlap possible.
Put the two halves in Vault straight away, from the prompt, so they never land in your shell history:
sandscale vault secret put secret/agents/artifacts-key-id sandscale vault secret put secret/agents/artifacts-key-secret At a terminal, each command prompts for the value without showing what you type. No Sandscale command prints a Vault value back.
Step 4: upload from where the artifact is made
The upload runs on whichever machine has the file and can reach the endpoint. With the key in its environment:
aws configure set default.s3.addressing_style path aws s3 cp ./coverage "s3://acme-web-agent-artifacts/$BRANCH/$RUN_ID/coverage/" --recursive \ --endpoint-url "$ENDPOINT" --region "$SIGNING_REGION" For a sandbox, Vault values go into its environment at start with --vault-env, read as the person starting it, and are never returned or logged:
sandscale sandbox create --template-id builtin:node --vault-env '[ {"name":"AWS_ACCESS_KEY_ID","path":"secret/agents/artifacts-key-id","field":"value"}, {"name":"AWS_SECRET_ACCESS_KEY","path":"secret/agents/artifacts-key-secret","field":"value"}]' A sandbox starts with networking off unless your organization's network policy allows a mode, and an upload needs to reach the endpoint. If the sandbox stays offline, which is often what you want for untrusted code, bring the files back to the agent's workspace first (for example, sandscale sandbox file-read --id ... --path ...) and upload from there.
Objects, listing, multipart uploads and presigned downloads work. Some S3 operations are not served yet, including server-side copy (CopyObject), tagging, and listing object versions, so avoid tools or flags that copy from one S3 location to another.
Step 5: give reviewers a link, not a key
Presigned downloads work, so a reviewer does not need credentials at all:
aws s3 presign "s3://acme-web-agent-artifacts/$BRANCH/$RUN_ID/test-report.xml" \ --expires-in 86400 --endpoint-url "$ENDPOINT" --region "$SIGNING_REGION" The agent puts that link in its pull request description. It expires on its own.
Step 6: let old runs expire
Artifacts are useful for days, not years. Set a lifecycle rule on the bucket with sandscale objects put-bucket-lifecycle (the rule's fields are in the object storage API reference), so old run prefixes are removed without anyone remembering to do it. Storage above your plan's allowance is metered, so expiry is also how you keep the bill predictable.
Turning it off
When a key leaks or a person leaves, UpdateAccessKey with "Status": "Inactive" stops the key at once, and DeleteAccessKey removes it. Every change to buckets, policies and keys is in your audit log.
What to tell the agent
A section in the AGENTS.md your agents already read:
## Artifacts - After a full test run or a build, upload reports and outputs to s3://acme-web-agent-artifacts/<branch>/<run-id>/ with the AWS CLI (endpoint and region are in $ENDPOINT and $SIGNING_REGION). - Never upload .env files, credentials, or the working tree. - Put a presigned link (24 hours) to the test report in the PR description. The full test suite itself is often better on a build host than in the agent's own loop; our post on leasing a build host for the full test suite covers that, and this bucket is where its results can go.
Originally published on the Sandscale blog.