# Where coding agents should put their artifacts: S3-compatible storage that outlives the machine

> Test reports, build outputs and logs from an agent's run disappear with the sandbox or build host that made them, unless they go somewhere first. A layout for a team's agent artifacts in S3-compatible object storage, scoped access keys, links for reviewers, expiry, and the Sandscale CLI (1.4.1) commands to set it up.

Test reports, build outputs and logs from an agent's run disappear with the sandbox or build host that made them, unless they go somewhere first. A layout for a team's agent artifacts in S3-compatible object storage, scoped access keys, links for reviewers, expiry, and the Sandscale CLI (1.4.1) commands to set it up.

December 2, 2026 · 5 min read · The Sandscale team

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](https://sandscale.dev/object-storage) as the example. The steps come from the [object storage guide](https://sandscale.dev/docs/guides/object-storage) 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 `.env` files and dumped environment variables.

## A layout that answers “which run made this?”

One bucket per repository or project, and a prefix per run:

```text
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

```sh
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

```sh
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-create` from 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:

```sh
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:

```sh
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:

```sh
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:

```sh
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](https://sandscale.dev/docs/reference/api/object-storage)), 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:

```markdown
## 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](https://sandscale.dev/blog/build-host-lease-for-a-full-test-suite) covers that, and this bucket is where its results can go.

**On this page**

1. What counts as an artifact
2. A layout that answers “which run made this?”
3. Step 1: create the bucket
4. Step 2: find the S3 endpoint
5. Step 3: an access key for the agents, scoped and stored
6. Step 4: upload from where the artifact is made
7. Step 5: give reviewers a link, not a key
8. Step 6: let old runs expire
9. Turning it off
10. What to tell the agent

**Run your agents in a box of their own**

Each sandbox is a Firecracker microVM. Free includes 100 awake vCPU-hours a month.

[Start free](https://cloud.sandscale.dev/auth/signup)

## Keep reading

- [December 2, 2026 · **Auditing the MCP tool calls your team's coding agents make** · When Claude Code, Codex, Cursor or Gemini CLI call MCP tools, the record of what happened can live in three places: the client, the MCP server, and the system behind it. What each layer can see, which one to trust as the record, whether to keep arguments, and how to read Sandscale's audit log for agent calls from the CLI.](https://sandscale.dev/blog/auditing-mcp-tool-calls)
- [December 2, 2026 · **Device flow login on headless machines: signing a coding agent's machine in as a person** · An agent's cloud machine has no browser, so a CLI there cannot open a sign-in page. The OAuth device authorization grant (RFC 8628) solves that: a short code you approve on your phone or laptop. How it works, the one phishing risk to teach your team, and how to use sandscale login --device on each agent's machine.](https://sandscale.dev/blog/device-flow-login-on-headless-machines)

---
Source: https://sandscale.dev/blog/object-storage-for-agent-artifacts
