Work with agents
Check what your agent did
Your agent worked on its own, and you want to see each thing that it did. The forge records each action of an agent session in its audit.
2 min read
You need the id of a session that you started. src agent start prints it. An admin of the repository can read the audit of each of its sessions.
1. Read the audit
src agent audit <session>
It lists the actions of the session, newest first: the time, the action, the target and the outcome. A new action shows up a few seconds after the agent does it.
Tip
The audit shows the 30 newest actions. To see more, add --limit, for example src agent audit <session> --limit 100.
Done
You see each action of the session, with its target and its outcome. To stop the agent, run src agent revoke <session>. All tokens of the session stop at once.
Who reads the audit
- You read the audit of the sessions that you started.
- An admin of the repository reads the audit of each of its sessions.
- An agent cannot read an audit.
REST has GET /api/v1/agent-sessions/<session>/audit, and MCP has the tool get_agent_audit.
How long the forge keeps it
- The forge keeps the audit for at least 12 months by default. A site admin can change this time. See Set the limits of the site.
- When the repository is deleted, the forge deletes the audit of its sessions too.