Skip to content
Wardcase Docs

Audit trail and exports

Every sandbox has an audit trail. 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. Interactive keystrokes are not logged. Reading it needs a key with the audit:read scope.

Events carry metadata about an action, never its data:

  • Commands run through the API are recorded with their argument list, working directory, exit code, duration and the size of their output. Output over 10 MiB is cut, and the event says so with truncated.
  • Files are recorded with path, size, SHA-256 and mode, for transfers through the API and SFTP.
  • SSH sessions are recorded with the authentication method, key fingerprint, kind of session and duration. Their client_ip is the literal unavailable: SSH reaches the gateway through Cloudflare Spectrum, which on the current plan does not pass the client address on.
  • Requests to exposed ports are not recorded. The catalogue defines a sampled port.request event, but the edge does not emit it.
  • Outbound connections are recorded with destination, port, protocol, TLS server name when known, and whether the policy allowed them. Byte counts are not included, and the TLS server name is read on port 443 only. Egress events are limited to 100 per second per sandbox, and an event can carry suppressed, the number of events that limit dropped. A connection from one sandbox to another is refused but not recorded today. See How the audit trail works for why the trail is built this way.

Never recorded: file contents, command output, what you type in an SSH or terminal session, and the values of environment variables passed with env. Command lines are recorded as you send them, so pass secrets as environment variables, not as arguments.

{
"id": 1042,
"org_id": "org_...",
"sandbox_id": "sbx_...",
"type": "exec.finished",
"actor": { "kind": "system" },
"payload": { "exec_id": "exec_...", "exit_code": 0, "duration_ms": 41, "stdout_bytes": 3, "stderr_bytes": 0, "truncated": false, "timed_out": false },
"occurred_at": "2026-10-01T12:00:00Z"
}

actor says who acted: an API key, a dashboard session, an SSH session, a host, or the system.

One sandbox’s events:

Terminal window
curl "https://api.wardcase.com/v1/sandboxes/sbx_4f9k2m8q1z7x3c5v/audit?type=exec." \
-H "Authorization: Bearer $VIVARIUM_API_KEY"

The whole organization’s events, with filters:

Terminal window
curl "https://api.wardcase.com/v1/audit?sandbox_id=sbx_4f9k2m8q1z7x3c5v&since=2026-10-01T00:00:00Z&limit=100" \
-H "Authorization: Bearer $VIVARIUM_API_KEY"
ParameterMeaning
sandbox_idOnly this sandbox (on /v1/audit)
typeAn exact type, such as exec.finished, or a prefix, such as exec.
since, untilA time range, as RFC 3339 timestamps
limitEvents per page, default 50, at most 200
cursorThe next_cursor from the previous page

Keep calling with cursor set to next_cursor until it is null.

From the SDKs:

const page = await sbx.audit.list({ type: "exec." });
for (const event of page.data) console.log(event.type, event.payload);
// Resolves once the export is ready.
const exported = await vv.audit.export({ sandboxId: sbx.id });
console.log(exported.url); // signed JSONL download, valid for one hour

An export writes the matching events to a file with one JSON object per line, in the same shape as the API returns.

Terminal window
curl https://api.wardcase.com/v1/audit/exports \
-H "Authorization: Bearer $VIVARIUM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sandbox_id":"sbx_4f9k2m8q1z7x3c5v","types":["exec.started","exec.finished","file.put"]}'

The response is 202 with the export’s id and status: pending. Poll GET /v1/audit/exports/{id} until status is ready, then download url. The link is signed and works for one hour; request a new export after that. If status is failed, failure_reason says why. Each export is itself recorded, as audit.export.requested and audit.export.ready.

Every filter is optional: sandbox_id, since, until, and types, a list of event types or prefixes such as exec..

Every event type Wardcase records, from the contract the services are built against.

Actors: { "kind": "api_key", "id": "key_..." }, { "kind": "session", "id": "usr_..." },.

TypeEmitted byPayload
sandbox.created API image, size, region, idle_timeout_s, hard_timeout_s, egress_policy_id, snapshot_id
sandbox.ready SandboxSession DO host_id, internal_ip, boot_ms
sandbox.unreachable SandboxSession DO host_id
sandbox.recovered SandboxSession DO host_id
sandbox.lost SandboxSession DO host_id, last_seen_at
sandbox.failed SandboxSession DO reason, detail
sandbox.destroyed SandboxSession DO reason (api, idle_timeout, hard_timeout, abuse, host_lost, failed), vcpu_seconds, gb_hours, egress_bytes
sandbox.restored API snapshot_id
exec.started API or SSH gateway exec_id, cmd (argv array), cwd, pty, source (api, ssh, terminal)
exec.finished SandboxSession DO or SSH gateway exec_id, exit_code, duration_ms, stdout_bytes, stderr_bytes, truncated, timed_out
file.put API or SFTP path, size, sha256, mode, source (api, sftp)
file.get API or SFTP path, size, sha256, source
file.list API or SFTP path, entries (count)
port.exposed API exposure_id, port, access, url
port.unexposed API exposure_id, port
port.request edge-proxy (sampled, 1 in 100 per exposure) exposure_id, port, method, status, client_ip
ssh.session.started SSH gateway session_id, client_ip (the literal unavailable when Spectrum runs without proxy protocol, which is every plan below Enterprise), auth (publickey, token), kind (shell, exec, sftp, forward), fingerprint
ssh.session.ended SSH gateway session_id, duration_ms, exit_code
ssh.forward.opened SSH gateway session_id, port
ssh.forward.refused SSH gateway session_id, kind (remote, agent)
egress.connection host netpol dst_ip, dst_port, proto (tcp, udp), sni or host when known, action (allow, block), rule (builtin, policy, default; builtin includes the mining-pool block), optional bytes_out and bytes_in (absent in the MVP, which only sees the first packets), optional suppressed (events dropped by the 100 per second per sandbox rate limit)
policy.updated API egress_policy_id, mode, rule_count
snapshot.requested API snapshot_id, name
snapshot.created SandboxSession DO snapshot_id, size_bytes, sha256
snapshot.failed SandboxSession DO snapshot_id, reason
snapshot.deleted API snapshot_id
abuse.detected host abuse detector kind (mining), evidence (cpu_pct, minutes, connections, processes), action (killed)
org.blocked API reason
org.unblocked API by, note
api_key.created API api_key_id, name, scopes
api_key.revoked API api_key_id
ssh_key.added API ssh_key_id, fingerprint
ssh_key.removed API ssh_key_id
audit.export.requested API export_id, params
audit.export.ready audit-export queue consumer export_id, event_count, size_bytes