Configure prompt and response sharing for Gemini Cloud Assist Stay organized with collections Save and categorize content based on your preferences.
This document describes how to configure Gemini Cloud Assistprompt and response sharing for a project by using the Google Cloud console or anAPI.
Before you begin
- Verify your Google Cloud project is attached to a billing account.
Verify IAM permissions
To configure prompt and response sharing for Gemini Cloud Assist,you cangrant theGemini for Google Cloud Settings Admin (roles/cloudaicompanion.settingsAdmin)Identity and Access Management (IAM) predefined role, which includes all requiredpermissions needed for all Gemini for Google Cloud administratorsettings.
Alternatively, you can update anycustom IAM roles with specificIAM permissions, which are detailed in the followingsections.
Configure Gemini Cloud Assist prompt and response sharing
Note: Use of this preview offering of Gemini Cloud Assist is subject tothe Google Cloud Agreement, including the Pre-GA Offering Terms of theGoogle Cloud Specific Service Terms,as supplemented by the terms for theGemini for Google Cloud Trusted Tester Program.The following sections provide steps required to configureGemini Cloud Assist to share your organization's prompts andresponses with Google for product improvement. This setting instructs Google toprocess the prompts and responses of all Gemini Cloud Assistusers in the project for purposes of product improvement, which helps Google toimprove Gemini Cloud Assist.
By default, Google does not examine either the promptsthat your users type and send to Gemini Cloud Assist or theresponses that are sent back. This limits the ability of Google to improveGemini Cloud Assist by better understanding what topics areimportant to your organization and how good our responses are. If you enableprompt and response sharing for a project, Google stores anonymized prompts andresponses submitted from the project for a maximum of two years. Yourorganization's prompts and responses are never used to train or fine tune anyLLM model.
If youenable prompt and response sharing with Google,you candisable it at any time byvisiting theAdmin for Gemini page in the Google Cloud console.
Enable prompt and response sharing 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.queryEffectiveSettingBindingsdataSharingWithGoogleSettings.createdataSharingWithGoogleSettings.listdataSharingWithGoogleSettings.getdataSharingWithGoogleSettings.updatesettingBindings.dataSharingWithGoogleSettingsCreatesettingBindings.dataSharingWithGoogleSettingsGetsettingBindings.dataSharingWithGoogleSettingsUpdatesettingBindings.dataSharingWithGoogleSettingsUse
In the Google Cloud console, go to theAdmin for Gemini page.
TheGemini for Google Cloud page loads.
ClickSettings in the left navigation menu.
TheSettings page loads.
ClickTurn on data sharing to share prompts and responses with Googlefor all Gemini Cloud Assist users in the project.
API
To enable data sharing for Gemini Cloud Assist, use theCreateDataSharingWithGoogleSetting method.
Verify that you have the following Identity and Access Management (IAM)permissions on the project that owns the subscription:
instance.queryEffectiveSettinginstance.queryEffectiveSettingBindingsdataSharingWithGoogleSettings.createdataSharingWithGoogleSettings.listdataSharingWithGoogleSettings.getdataSharingWithGoogleSettings.updatesettingBindings.dataSharingWithGoogleSettingsCreatesettingBindings.dataSharingWithGoogleSettingsGetsettingBindings.dataSharingWithGoogleSettingsUpdatesettingBindings.dataSharingWithGoogleSettingsUse
Create the setting and a setting-specific value:
Obtain anauthentication token:
TOKEN=$(gcloud auth print-access-token)Run the following command to create the setting:
curl -X POST \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ -d '{ "enablePreviewDataSharing": true }' \ "https://cloudaicompanion.googleapis.com/v1/projects/CONTAINER_PROJECT_NAME/locations/global/dataSharingWithGoogleSettings?dataSharingWithGoogleSettingId=SETTING_ID"Replace the following:
CONTAINER_PROJECT_NAME: Enter the parentproject ID.SETTING_ID: Enter a unique setting name,such asdswg1forData Sharing with Google.
If the command succeeds, it returns a response body that shows the
enablePreviewDataSharingset totrue:{ "name": "projects/CONTAINER_PROJECT_NAME/locations/global/dataSharingWithGoogleSettings/SETTING_ID", "createTime": "2025-01-23T15:22:49.717166932Z", "updateTime": "2025-01-23T15:22:49.717166932Z", "enablePreviewDataSharing": true}For more information on authentication, seeAuthenticate for using REST.
Create the setting binding:
curl -X POST \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ -d '{ "target": "projects/TARGET_PROJECT_NAME", "product": "GEMINI_CLOUD_ASSIST" }' \ "https://cloudaicompanion.googleapis.com/v1/projects/CONTAINER_PROJECT_NAME/locations/global/dataSharingWithGoogleSettings/SETTING_ID/settingBindings?settingBindingId=BINDING_ID"Replace the following:
TARGET_PROJECT_NAME: Enter the target project towhich the setting should be applied.SETTING_ID: Use the same SETTING_ID when youcreated the setting, but append it withb1. For example, usedswg1b1forData Sharing with Google.
If the command succeeds, it returns the operation metadata in thefollowing format:
{ "name": "projects/<var>CONTAINER_PROJECT_NAME</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_NAME</var>/locations/global/dataSharingWithGoogleSettings/<var>SETTING_ID</var>/settingBindings/<var>BINDING_ID</var>", "verb": "create", "requestedCancellation": false, "apiVersion": "v1" }, "done": false}
Disable prompt and response sharing 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 where you want to modify settings:
instance.queryEffectiveSettinginstance.queryEffectiveSettingBindingsdataSharingWithGoogleSettings.listdataSharingWithGoogleSettings.getsettingBindings.dataSharingWithGoogleSettingsGetsettingBindings.dataSharingWithGoogleSettingsDeletesettingBindings.dataSharingWithGoogleSettingsUse
In the Google Cloud console, go to theAdmin for Gemini page.
TheGemini for Google Cloud page loads.
ClickSettings in the left navigation menu.
TheSettings page loads.
ClickTurn off data sharing to stop sharing prompts and responseswith Google for all Gemini Cloud Assist users in theproject.
API
To disable data sharing for Gemini Cloud Assist, use theDeleteDataSharingWithGoogleSetting method.
Verify that you have the following Identity and Access Management (IAM)permissions on the project where you want to modify settings:
instance.queryEffectiveSettinginstance.queryEffectiveSettingBindingsdataSharingWithGoogleSettings.listdataSharingWithGoogleSettings.deletedataSharingWithGoogleSettings.getsettingBindings.dataSharingWithGoogleSettingsGetsettingBindings.dataSharingWithGoogleSettingsUpdatesettingBindings.dataSharingWithGoogleSettingsUse
Disable prompt and response sharing for the specified setting:
Obtain the token:
TOKEN=$(gcloud auth print-access-token)Run the following command to disable the setting:
curl -X PATCH \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ -d '{ "enablePreviewDataSharing": false } ' \ "https://cloudaicompanion.googleapis.com/v1/projects/CONTAINER_PROJECT_NAME/locations/global/dataSharingWithGoogleSettings?dataSharingWithGoogleSettingId=SETTING_ID"This
PATCHcommand only succeeds if the setting resource alreadyexists from when youenabled prompt and response sharing.Replace the following:
CONTAINER_PROJECT_NAME: Enter the parentproject ID.SETTING_ID: Enter the existing setting name,such asdswg1forData Sharing with Google.
If the command succeeds, it returns a response body that shows the
enablePreviewDataSharingset tofalse:{ "name": "projects/CONTAINER_PROJECT_NAME/locations/global/dataSharingWithGoogleSettings/SETTING_ID", "createTime": "2025-01-23T15:22:49.717166932Z", "updateTime": "2025-01-23T15:22:49.717166932Z", "enablePreviewDataSharing": false}
What's next
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.