Inspect the audit worklog
The worklog is the primary source of evidence for what an agent did and why. This guide shows how to query it and what to look for when investigating a specific interaction.
What you can query by
Section titled “What you can query by”The worklog is indexed by the same dimensions used across observability signals:
task_id— a single inference run.session_id— a full conversation.assistant_id— the agent.agentspace_id— the organizational boundary.user_id— the caller or channel sender.- Time range.
Start with the task_id when you need the complete story of one request.
List and filter runs
Section titled “List and filter runs”GET /worklog/ returns a paginated list of inference runs. Use query parameters to narrow results:
| Parameter | Use |
|---|---|
assistant_id | Filter to one agent |
session_id | Filter to one conversation |
user_id | Filter to one caller |
final_status | success, error, or running (matches final_status IS NULL) |
include_content | Include truncated query, result, and error previews |
limit / offset | Paginate through results |
curl "http://localhost:8080/worklog/?assistant_id=support-bot&final_status=error&include_content=true&limit=20" \ -H "Authorization: Bearer $API_TOKEN"Conversation sessions
Section titled “Conversation sessions”GET /worklog/sessions returns conversation-level aggregates. It is useful for dashboards and for grouping related tasks by session_id.
curl "http://localhost:8080/worklog/sessions?user_id=user-42&limit=10" \ -H "Authorization: Bearer $API_TOKEN"Activity metrics
Section titled “Activity metrics”GET /worklog/activity returns run counts aggregated per hour or day. Use it for usage dashboards and capacity planning.
curl "http://localhost:8080/worklog/activity?assistant_id=support-bot&bucket=hour" \ -H "Authorization: Bearer $API_TOKEN"Read a task’s worklog
Section titled “Read a task’s worklog”-
Find the task identifier. It is returned to the caller when an inference starts and appears in traces and logs.
-
Query the worklog by
task_idusing the runtime API, database query, or your observability platform. -
Walk through events in order. Each command and response shows one step of the execution loop.
-
Look for key events: shield verdicts, tool calls, LLM outputs, approval requests, and memory flushes.
-
Correlate with traces and logs using the same identifiers when you need timing or infrastructure context.
What to look for
Section titled “What to look for”| Question | Where in the worklog |
|---|---|
| What did the user ask? | The incoming request event. |
| Did a shield block or flag the request? | Shield inference response events. |
| Which tools were called and with what inputs? | Tool execution commands and responses. |
| What did the LLM return at each step? | Response inference responses. |
| Was an approval requested? | Human approval required and response events. |
| How did memory affect the answer? | Context flush and persistence events. |
Agentspace registry binding
Section titled “Agentspace registry binding”Worklog events carry a snapshot of the agentspace registry. This lets runtime stages that build or resolve models outside the original dispatched event — such as deferred shield evaluation or background skill activation — resolve model_ref references against the same agentspace catalogue the task started with, instead of whatever registry state happens to be current.
When investigating a task, correlate model_ref resolution events with the registry snapshot recorded in the worklog to confirm the correct model registration and version were used.
Export and archive
Section titled “Export and archive”For compliance, you may need to export worklog data periodically. Options include:
- Database backups and point-in-time recovery.
- Scheduled exports to object storage.
- Streaming changes to a SIEM or data warehouse.
Set retention and encryption policies that match your regulatory requirements.