How the audit trail works
The question “what did the agent do?” usually comes after something went wrong, from someone who was not watching: a customer, a security reviewer, you the next morning. The agent’s own account is not evidence. It can be wrong, it can be steered, and it can leave things out. The audit trail is a record written by the platform, from outside the sandbox, as each action happens.
It records every API command, file transfer, exposed port and outbound connection, and every SSH or terminal session as a start and an end event with its duration. For the event list and the API, see the Audit trail and exports guide.
Who writes each event
Section titled “Who writes each event”No event comes from inside the sandbox. Each one is written by the component that carried out the action:
| Component | Writes |
|---|---|
| The API | sandbox.created, file transfers, exposed ports, policy, key and snapshot requests, exports |
| The sandbox’s session in the control plane | sandbox.ready and the other status changes, exec.started and exec.finished for API commands, snapshot results |
| The SSH gateway on the host | SSH sessions, forwards, SFTP transfers, and commands run as ssh host command |
| The host’s network layer | egress.connection, from the kernel’s log of the sandbox’s packets |
| The host’s abuse detector | abuse.detected |
Because the writers sit outside the sandbox, code in the sandbox cannot skip an event or rewrite one. There is no API call that changes or deletes an event.
Each event names its actor: the API key or dashboard user that made the call, the SSH session, the host, or the
system (for timeouts and status changes). When several agents share an organization, give each its own key and the
actor tells them apart.
Metadata, not data
Section titled “Metadata, not data”Events describe an action, never its content:
- A command is recorded with its argument list, working directory, exit code, duration and output sizes. Output over 10 MiB is cut, and the event says so. The output itself is not recorded.
- A file transfer is recorded with its path, size, SHA-256 and mode. The contents are not.
- A connection is recorded with its destination, port, protocol and the decision. The payload is not.
This is deliberate. A trail that copied command output and file contents would become a second store of everything the agent touched, secrets included, and would need the same protection as the data itself. Hashes still let you check which file was moved: compute the SHA-256 of your copy and compare.
Command lines are recorded as they are sent. Pass secrets as environment variables with env, which are never
recorded, not as arguments.
What is not recorded
Section titled “What is not recorded”State these limits to anyone who relies on the trail:
- What is typed in an interactive SSH or dashboard terminal session. The session’s start, end, duration and
authentication method are recorded; the keystrokes are not. Commands run as
ssh host commandare recorded. - The SSH client’s IP address. SSH reaches the gateway through Cloudflare Spectrum, which on the current plan does
not pass it on, so
client_ipis the literalunavailable. - Byte counts per connection.
- DNS lookups to the sandbox’s own resolvers.
- More than 100 egress events a second per sandbox. The next event carries
suppressed, the number dropped. - A connection from one sandbox to another, which is refused but not recorded today.
- Requests to exposed ports. The catalogue defines a sampled
port.requestevent, but the edge does not emit it.
Reading it
Section titled “Reading it”- Per sandbox or across the organization, filtered by event type or prefix (
exec.) and time range. The API returns events newest first. - As a JSONL export, oldest first, one event per line, in the same shape the API returns. Exports are written to object storage and downloaded through a signed link. Use them to keep a task’s record next to its result, or to load events into your own log system.
- In the dashboard, with the same filters and an export button.
Reading needs the audit:read scope. Keep it off the key your agent uses: the agent does not need to read its own
record, and a separate reviewer key keeps the two roles apart.
Using it after an incident
Section titled “Using it after an incident”- Stop the sandbox with
killif it is still running, and revoke the key if you suspect it leaked. - Export the trail for the sandbox, so the record is fixed in a file.
- Read the commands:
exec.startedgives each argument list and its source (api,sshorterminal),exec.finishedits exit code. - Read the connections: every
egress.connectionwithactionblockis something the agent tried and the policy stopped; everyallowis something that left. - Read the files:
file.putandfile.getgive what moved in and out, with hashes.