The most common way session recording for an AI coding agent goes wrong is subtle: the recording lives in the same process as the agent. The agent in Cursor logs its own actions, the team treats that log as the record, and the day something goes wrong the log is incomplete, edited by a retry, or simply missing the one command that mattered.
Lead with that failure, because it dictates the architecture. A recording the agent can influence is not a recording you can rely on. Everything else in this post follows from moving the record off the agent's path and onto the connection.
The pitfalls of in-agent session recording
Self-reported logs miss what the agent never chose to log. A crashed or retried run can leave gaps right where you most need detail. A log written to a path the agent controls can be truncated or overwritten. And a log that captures intent ("I will read the orders table") instead of the actual wire-level command tells you what the agent meant, not what it did. None of these survive an incident review, and an incident review is the only time anyone reads the recording closely.
The pattern underneath all four is the same: the record depends on the cooperation of the process you are trying to audit. The fix is to remove that dependency by moving the recording to the point the connection passes through, where the agent has no say.
How session recording works through hoop.dev
hoop.dev is an open-source Layer 7 access gateway. The Cursor agent reaches a database or service through it, and the gateway records the session as it happens:
- Recording is at the command level: the actual queries and commands that crossed the connection, not a summary.
- It runs at the gateway, outside the agent process, so the agent cannot edit or skip it.
- Each session is tied to the identity that authenticated, so the record answers who, not just what.
hoop.dev records the infrastructure actions the agent takes. It does not record the model's prompt or output, because that is not where the auditable action is. The action is the command that hit the database, and that is what crosses the gateway. You can read more about the gateway on the hoop.dev site.
