Monitoring AI Hub Activity
AI Hub records the activity in each account: each agent run and how it ended, each time a guardrail blocks content, each retrieval from a data source, and each change to an agent definition. Every record is timestamped and names the user who triggered it and the account it belongs to, so you can trace who did what and when.
AI Hub writes these records to Liferay’s audit framework, which stores them alongside the rest of your instance’s audited activity.
AI Hub Audit Events
AI Hub emits these event types into the audit framework:
| Event Type | When It’s Logged |
|---|---|
AI_HUB_AGENT_INSTANCE_COMPLETE | An agent run completes successfully. |
AI_HUB_AGENT_INSTANCE_COMPLETE_EXCEPTIONALLY | An agent run fails. |
AI_HUB_AGENT_INSTANCE_COMPLETE_PARTIALLY | A language-model or AI-decision step returns a response, along with that response’s token counts. |
AI_HUB_AGENT_INSTANCE_START | An agent run starts. |
AI_HUB_GUARDRAIL_VIOLATION | A guardrail blocks input or output content. |
AI_HUB_RAG_CONTENT_RETRIEVE | An agent queries a data source while answering a request. |
AI_HUB_WORKFLOW_DEFINITION_ADD | An agent definition is created. |
AI_HUB_WORKFLOW_DEFINITION_DELETE | An agent definition is deleted. |
AI_HUB_WORKFLOW_DEFINITION_UPDATE | An agent definition is updated. |
A single agent run logs AI_HUB_AGENT_INSTANCE_START once, and exactly one of AI_HUB_AGENT_INSTANCE_COMPLETE or AI_HUB_AGENT_INSTANCE_COMPLETE_EXCEPTIONALLY when it ends. It logs AI_HUB_AGENT_INSTANCE_COMPLETE_PARTIALLY once for each execution step the run performs, so a run with three steps logs three of these events.
Each event record identifies the user who triggered it, when it happened, and the account it belongs to, along with event-specific details. AI Hub stores the account identifier on the record itself, which is what makes per-account access possible.
Accessing Audit Events
Scope of access to audit events depends on the user’s role:
- Instance administrators (users with the Administrator role) and users with the Analytics Administrator role can read events for any account in the instance.
- Users with the Account Administrator role on an account can read that account’s events only. A request naming an account they don’t administer returns an error.
Every request for AI Hub events must name at least one account in the accountIds parameter. Omitting accountIds returns an error for users with the Account Administrator role; for instance administrators it returns only those events that aren’t tied to an account, so no AI Hub events appear in the results.
Querying AI Hub Events via the REST API
Use the Audit REST API (/o/audit/v1.0) to retrieve AI Hub events. Authenticate with your Liferay email address and password:
curl -u [userEmail]:[password] \
"https://[hostname]/o/audit/v1.0/audit-events?accountIds=[accountId]&eventType=[eventType]"
Replace [accountId] with your account’s entry ID and [eventType] with one of the AI Hub event type strings listed above. To filter by multiple account IDs, repeat the accountIds parameter: accountIds=[id1]&accountIds=[id2].
The eventType parameter matches any event type that contains the value you supply, so eventType=AI_HUB returns events of every AI Hub type at once. For the same reason, eventType=AI_HUB_AGENT_INSTANCE_COMPLETE also matches AI_HUB_AGENT_INSTANCE_COMPLETE_EXCEPTIONALLY and AI_HUB_AGENT_INSTANCE_COMPLETE_PARTIALLY.
Obtain your account entry ID from your instance administrator or by looking up the account in Control Panel → Accounts.
Use these query parameters to filter and order results:
| Parameter | Description |
|---|---|
accountIds | Returns events for the specified accounts. Repeat the parameter to name more than one account. |
eventType | Returns events whose type contains this value. The parameter accepts one value. |
startDate | Returns events created after this date. Use ISO 8601 format. |
endDate | Returns events created before this date. Use ISO 8601 format. |
sort | Orders results by accountId, contextName, dateCreated, or eventType. By default, the newest events come first. |
page | Specifies which page of results to return. |
pageSize | Specifies how many events each page contains. |
The endpoint returns a JSON object with an items array. Each item contains eventType, dateCreated, creator, and accountId, plus entityType and entityId identifying the agent run or agent definition involved, and event-specific data in additionalInfo. AI Hub truncates each string value in additionalInfo to 200 characters, so a long value is stored only in part.