This page describes how to set up and access usage audit logs for Gemini Enterprise.
Key concepts
This section introduces key concepts related to observability in Gemini Enterprise.
| Concept | Description |
|---|---|
| Usage audit logs | Usage audit logs are records of administrative activities and accesses within your Google Cloud resources. They provide detailed information about who performed what action, when, and from where. These logs are essential for security auditing, compliance, and understanding how your resources are being used. |
Before you begin
Before configuring audit logs, ensure that you have the following:
- Turn on the observability settings. For more information, see Turn on observability settings.
- To turn on the audit logging, you must have the
Discovery Engine Admin
IAM role (
roles/discoveryengine.admin). - To access Cloud Logging, you must have the
Logs Viewer
IAM role (
roles/logging.viewer). - Ensure you have created a Gemini Enterprise app. To create one, see Create an app.
Logged information
The following table summarizes the usage data logged by Gemini Enterprise:
| Service path | Logged data |
|---|---|
SearchService.Search |
Logs the data on the sources used for grounding or as LLM input. Request:
Response:
|
AssistantService.Assist |
Logs the request and response from the Gemini Enterprise assistant. Request:
Response:
|
AssistantService.StreamAssist |
Request:
Response:
|
ConversationSearchService.AnswerQuery |
Request:
Response:
|
EngineService.CreateEngine |
Request:
Response:
|
EngineService.UpdateEngine |
Request:
Response:
|
AgentService.SetIamPolicy |
Request:
Response:
|
AgentService.CreateAgent |
Request:
Response:
|
AgentService.UpdateAgent |
Request:
Response:
|
AgentService.CreateAgentRequest |
Request:
Response:
|
GroundedGenerationService.GenerateGroundedContent |
Request:
Response:
|
DataConnectorService.UpdateDataConnector |
Request:
Response:
|
AssistantService.AddContextFile |
Request:
Response:
|
AssistantService.UploadSessionFile |
Request:
Response:
|
Access usage audit logs
To access and view all Gemini Enterprise usage audit logs, follow these steps:
In the Google Cloud console, go to the Logs Explorer page.
Select the Google Cloud project for which you enabled audit logging.
To show only Gemini Enterprise logs, enter the following query in the query editor field, and click Run Query:
logName="projects/PROJECT_ID/logs/discoveryengine.googleapis.com%2Fgemini_enterprise_user_activity" OR logName=~"projects/PROJECT_ID/logs/discoveryengine.googleapis.com%2Fgen_ai.*"Replace the following:
PROJECT_ID: the ID of your project.
Control access to logs
You can control access to the logs in Cloud Logging. For detailed guidance on access control methods, including using IAM conditions for fine-grained access, see Access control with IAM.
Default access control
By default, Gemini Enterprise sends Cloud Logging data to the _Default
bucket. The following IAM roles control access to this bucket:
Logs Viewer role (
roles/logging.viewer)Private Logs Viewer role (
roles/logging.privateLogViewer)Logs View Accessor role (
roles/logging.viewAccessor)
Fine-grained access control
If your project contains logs with varying sensitivity levels, you can use several Google Cloud and Cloud Logging tools to configure more fine-grained access control.
You can configure fine-grained access control using the following options:
| Option | Description |
|---|---|
| IAM conditions | Set up fine-grained access control using IAM conditions. For more information, see Logging roles. |
| Log views | Use log views to limit user access to a subset of logs within a log bucket. For more information, see Configure log views on a log bucket. |
| Log sinks | Use log sinks to route sensitive logs to a separate project with more restrictive IAM access. For more information, see Route logs to supported destinations. |
| Tags | Use tags to manage IAM access to individual log buckets within a project. For more information, see Use tags to manage access to log buckets. |
| Field-level access control | Use field-level access control to hide or restrict access to specific fields within log entries. For more information, see Configure field-level access. |
What's next
- To turn off logging of prompt inputs and response outputs, see Turn off observability settings.