Start with the architectural question, because for a headless browser it decides everything: where does the record live. An agent driving a headless browser controls the machine, the process, and the page. Put the audit trail for headless browser activity anywhere the agent can reach and you have a record the subject of the record can erase. The architecture has to answer that first.
The requirement: record off the machine
An agent that can script a browser can usually script whatever logs it. So the recorder cannot run on the same machine. The audit trail for headless browser sessions has to be captured at the access boundary the browser crosses to reach other systems, on infrastructure the session cannot reconfigure. That single decision, record off the machine, is what separates a trustworthy trail from a convenient fiction.
What the architecture captures
- The identity driving the session, not a shared machine login
- The authenticated actions the session took against real systems
- The data those actions reached, with sensitive values masked
- A record held where the session has no write access
One control surface, not a bolt-on
Recording off the machine only works if access and audit are governed together: a scoped per-session identity, a policy check on sensitive actions, and a tamper-proof record, all at the boundary. Those are one control surface, not separate tools. hoop.dev is built to it. The agent drives the browser, but its access to real systems runs through hoop.dev as an identity-aware proxy, which records each authenticated action as a command-level audit off the machine and masks sensitive output inline. In practice you route the headless-browser workflow's access through hoop.dev. The getting-started guide covers the first connection, and hoop.dev/learn explains the boundary model.
Why the obvious alternatives fail
It helps to see why the convenient options do not satisfy the requirement. An on-box recorder, a logging library running inside the automation, is the most common choice and the weakest: the agent drives that machine, so it can stop, blind, or rewrite the recorder. A screen video feels thorough but is hard to search, easy to dispute, and just as deletable when it lives on the same host. A browser extension or instrumentation layer inside the page sits in exactly the environment the agent and the hostile pages control, so it can be disabled or fed false data. Each of these fails the same test: the subject of the record can reach the record.
