This document describes how to configure grounding for Gemini Cloud Assist by using the Google Cloud console or an API. Grounding is provided by Vertex AI.
Available grounding types:
Grounding with Google Search (Recommended): Instructs Gemini Cloud Assist to use Google Search for the most comprehensive and up-to-date responses. Note that certain offerings like Data Residency, Access Transparency, and Customer-Managed Encryption Keys (CMEK) are not supported with this option.
Web Grounding for Enterprise: Leverages a restricted subset of web content. While this might lead to lower quality responses compared to Grounding with Google Search, it's the preferred option for highly-regulated industries that require strict data residency compliance, such as finance, healthcare, and the public sector.
By default, Gemini Cloud Assist uses Grounding with Google Search to improve the quality of its responses to your prompts. The use of Grounding with Google Search involves special data handling for your prompts and responses, as described in the Google Cloud Service terms.
Before you begin
Verify your Google Cloud project is attached to a billing account.
In order to get the required permissions for configuring grounding for Gemini Cloud Assist, ask your administrator to grant you the Gemini for Google Cloud Settings Admin (
roles/cloudaicompanion.settingsAdmin) Identity and Access Management (IAM) role on your project. This predefined role contains the permissions required to manage Gemini Cloud Assist administrator settings.To see the exact permissions that are required, expand the Required permissions section:
Required permissions
cloudaicompanion.geminiGcpEnablementSettings.createcloudaicompanion.geminiGcpEnablementSettings.updatecloudaicompanion.settingBindings.geminiGcpEnablementSettingsCreatecloudaicompanion.settingBindings.geminiGcpEnablementSettingsUse-
If you are using direct API requests, this permission is required
specifically for the
TARGET_PROJECT.
-
If you are using direct API requests, this permission is required
specifically for the
The following are additional permissions that are required if you are using the Google Cloud console:
cloudaicompanion.instance.queryEffectiveSettingcloudaicompanion.instance.queryEffectiveSettingBindingscloudaicompanion.geminiGcpEnablementSettings.getcloudaicompanion.settingBindings.geminiGcpEnablementSettingsGetsettingBindings.geminiGcpEnablementSettingsUpdate
You might be able to get these permissions with other predefined roles or custom roles.
Configure grounding for Gemini Cloud Assist
Select one of the following options:
Console
In the Google Cloud console, go to Gemini Cloud Assist, and then click Settings.
Select the grounding option that you want to use.
Click Save.
API
To configure grounding for Gemini Cloud Assist using the API, you create
a geminiGcpEnablementSettings resource that defines the grounding type,
using the geminiGcpEnablementSettings.create
method. Then, you apply the setting using the associated
settingBindings.create
method to bind the setting to a project.
Create the setting and a setting-specific value:
Obtain an authentication token:
TOKEN=$(gcloud auth print-access-token)For more information on authentication, see Authenticate for using REST.
Run the following command to create the setting:
curl -X POST \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ -d '{ "webGroundingType": GROUNDING_TYPE }' \ "https://cloudaicompanion.googleapis.com/v1/projects/CONTAINER_PROJECT/locations/global/geminiGcpEnablementSettings?geminiGcpEnablementSettingId=GROUNDING_SETTING_ID"Replace the following:
CONTAINER_PROJECT: The project ID of the project that stores the setting data.GROUNDING_TYPE: The grounding type, which is eitherGROUNDING_WITH_GOOGLE_SEARCHorWEB_GROUNDING_FOR_ENTERPRISE.GROUNDING_SETTING_ID: A unique name to identify this particular setting data, such asgt1.
If the command succeeds, it returns a response body that shows the
webGroundingTypeset to your selection:{ "name": "projects/CONTAINER_PROJECT/locations/global/geminiGcpEnablementSettings/GROUNDING_SETTING_ID", "createTime": "2025-01-23T15:22:49.717166932Z", "updateTime": "2025-01-23T15:22:49.717166932Z", "webGroundingType": GROUNDING_TYPE }
Create the setting binding:
curl -X POST \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ -d '{ "target": "projects/TARGET_PROJECT", "product": "GEMINI_CLOUD_ASSIST" }' \ "https://cloudaicompanion.googleapis.com/v1/projects/CONTAINER_PROJECT/locations/global/geminiGcpEnablementSettings/GROUNDING_SETTING_ID/settingBindings?settingBindingId=GROUNDING_BINDING_ID"Replace the following:
TARGET_PROJECT: The project ID of the project to which the setting should be applied. Typically, the target project and the container project are the same.CONTAINER_PROJECT: The project ID of the project that stores the setting data.GROUNDING_SETTING_ID: TheGROUNDING_SETTING_IDthat you specified when you created the setting.GROUNDING_BINDING_ID: A unique ID to identify this particular setting binding resource, such asb1.
If the command succeeds, it returns the operation metadata in the following format:
{ "name": "projects/<var>CONTAINER_PROJECT</var>/locations/global/operations/operation-1737646069712-62c6140bb04bb-49261230-43701daf", "metadata": { "@type": "type.googleapis.com/google.cloud.cloudaicompanion.v1.OperationMetadata", "createTime": "2025-01-23T15:27:50.076075570Z", "target": "projects/<var>TARGET_PROJECT</var>/locations/global/geminiGcpEnablementSettings/<var>GROUNDING_SETTING_ID</var>/settingBindings/<var>GROUNDING_BINDING_ID</var>", "verb": "create", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }