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 TypeWhen It’s Logged
AI_HUB_AGENT_INSTANCE_COMPLETEAn agent run completes successfully.
AI_HUB_AGENT_INSTANCE_COMPLETE_EXCEPTIONALLYAn agent run fails.
AI_HUB_AGENT_INSTANCE_COMPLETE_PARTIALLYA language-model or AI-decision step returns a response, along with that response’s token counts.
AI_HUB_AGENT_INSTANCE_STARTAn agent run starts.
AI_HUB_GUARDRAIL_VIOLATIONA guardrail blocks input or output content.
AI_HUB_RAG_CONTENT_RETRIEVEAn agent queries a data source while answering a request.
AI_HUB_WORKFLOW_DEFINITION_ADDAn agent definition is created.
AI_HUB_WORKFLOW_DEFINITION_DELETEAn agent definition is deleted.
AI_HUB_WORKFLOW_DEFINITION_UPDATEAn agent definition is updated.
Note

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.

Note

Obtain your account entry ID from your instance administrator or by looking up the account in Control PanelAccounts.

Use these query parameters to filter and order results:

ParameterDescription
accountIdsReturns events for the specified accounts. Repeat the parameter to name more than one account.
eventTypeReturns events whose type contains this value. The parameter accepts one value.
startDateReturns events created after this date. Use ISO 8601 format.
endDateReturns events created before this date. Use ISO 8601 format.
sortOrders results by accountId, contextName, dateCreated, or eventType. By default, the newest events come first.
pageSpecifies which page of results to return.
pageSizeSpecifies 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.