Skip to content
Wardcase Docs

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.

No event comes from inside the sandbox. Each one is written by the component that carried out the action:

ComponentWrites
The APIsandbox.created, file transfers, exposed ports, policy, key and snapshot requests, exports
The sandbox’s session in the control planesandbox.ready and the other status changes, exec.started and exec.finished for API commands, snapshot results
The SSH gateway on the hostSSH sessions, forwards, SFTP transfers, and commands run as ssh host command
The host’s network layeregress.connection, from the kernel’s log of the sandbox’s packets
The host’s abuse detectorabuse.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.

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.

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 command are 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_ip is the literal unavailable.
  • 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.request event, but the edge does not emit 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.

  1. Stop the sandbox with kill if it is still running, and revoke the key if you suspect it leaked.
  2. Export the trail for the sandbox, so the record is fixed in a file.
  3. Read the commands: exec.started gives each argument list and its source (api, ssh or terminal), exec.finished its exit code.
  4. Read the connections: every egress.connection with action block is something the agent tried and the policy stopped; every allow is something that left.
  5. Read the files: file.put and file.get give what moved in and out, with hashes.