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.
To get the permissions that you need to configure grounding for Gemini Cloud Assist, ask your administrator to grant you the Gemini for Google Cloud Settings Admin (
roles/cloudaicompanion.settingsAdmin) IAM role on your project. This predefined role contains the permissions required to manage all Gemini for Google Cloud administrator settings.Alternatively,update any custom IAM roles with specific Identity and Access Management (IAM) permissions, which are detailed in the following sections.
Configure grounding for Gemini Cloud Assist
Select one of the following options:
Console
Verify that you have the following Identity and Access Management (IAM) permissions on the project that owns the subscription:
instance.queryEffectiveSettinginstance.queryEffectiveSettingBindingsgeminiGcpEnablementSettings.creategeminiGcpEnablementSettings.getgeminiGcpEnablementSettings.updatesettingBindings.geminiGcpEnablementSettingsGetsettingBindings.geminiGcpEnablementSettingsUpdatesettingBindings.geminiGcpEnablementSettingsCreatesettingBindings.geminiGcpEnablementSettingsUse
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 first create a geminiGcpEnablementSettings resource to define
the grounding type. Then, you create a settingBindings resource, which
is a child of the setting you created, to bind the setting to a project.
Verify that you have the following Identity and Access Management (IAM) permissions:
instance.queryEffectiveSettinginstance.queryEffectiveSettingBindingsgeminiGcpEnablementSettings.creategeminiGcpEnablementSettings.getgeminiGcpEnablementSettings.updatesettingBindings.geminiGcpEnablementSettingsGetsettingBindings.geminiGcpEnablementSettingsUpdatesettingBindings.geminiGcpEnablementSettingsCreatesettingBindings.geminiGcpEnablementSettingsUse
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/PROJECT/locations/global/geminiGcpEnablementSettings?geminiGcpEnablementSettingId=GROUNDING_SETTING_ID"Replace the following:
PROJECT: the project ID.GROUNDING_TYPE: the grounding type, which is eitherGROUNDING_WITH_GOOGLE_SEARCHorWEB_GROUNDING_FOR_ENTERPRISE.GROUNDING_SETTING_ID: a unique setting name, such asgt1forGrounding type.
If the command succeeds, it returns a response body that shows the
webGroundingTypeset to your selection:{ "name": "projects/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/PROJECT", "product": "GEMINI_CLOUD_ASSIST" }' \ "https://cloudaicompanion.googleapis.com/v1/projects/PROJECT/locations/global/geminiGcpEnablementSettings/GROUNDING_SETTING_ID/settingBindings?settingBindingId=GROUNDING_BINDING_ID"Replace the following:
PROJECT: the project ID to which the setting should be applied.GROUNDING_SETTING_ID: theGROUNDING_SETTING_IDthat you specified when you created the setting.GROUNDING_BINDING_ID: a unique ID for the setting binding resource, such asb1.
If the command succeeds, it returns the operation metadata in the following format:
{ "name": "projects/<var>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>PROJECT</var>/locations/global/geminiGcpEnablementSettings/<var>GROUNDING_SETTING_ID</var>/settingBindings/<var>GROUNDING_BINDING_ID</var>", "verb": "create", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }