Skip to main content

Module audit

Module audit 

Source
Expand description

Append-only JSONL audit log.

The file is ${XDG_STATE_HOME:-~/.local/state}/computer-use/audit.jsonl, or %LOCALAPPDATA%\computer-use\audit.jsonl on Windows when XDG_STATE_HOME is unset. Typed text, element values, clipboard bytes, and blocked URLs are not fields on the line, so they are never written. A write failure is returned to the caller and does not by itself fail the desktop action.

Structs§

AuditRecord
One audit record. Fields that would carry typed text are intentionally absent.
StateDirGuard
Restores the previous test state directory when dropped.

Functions§

push_state_dir
Point audit and pause files at dir until the guard drops.
record
Append one JSON line. Does nothing when no state directory is available in tests.
state_dir
Directory that holds audit.jsonl and the paused marker.
utc_timestamp
Format a Unix timestamp as YYYY-MM-DDTHH:MM:SSZ.