Configure prompt and response sharing for Gemini Cloud Assist

This document describes how to configure Gemini Cloud Assist prompt and response sharing for a project by using the Google Cloud console or an API.

When enabled, Google processes the prompts and responses of all Gemini Cloud Assist users in the project for purposes of product improvement, which helps Google to improve Gemini Cloud Assist. Google stores anonymized prompts and responses submitted from the project for a maximum of two years. Your organization's prompts and responses are never used to train or fine tune any LLM model.

You can change this setting at any time.

Before you begin

To configure prompt and response sharing for Gemini Cloud Assist, you should be granted the Gemini Cloud Assist Admin (roles/cloudaicompanion.settingsAdmin) Identity and Access Management (IAM) predefined role, which includes all required permissions needed to modify Gemini Cloud Assist administrator settings.

Alternatively, you can update any custom IAM roles with specific IAM permissions, which are detailed in the following sections.

Enable prompt and response sharing for Gemini Cloud Assist

Select one of the following options:

Console

  1. Verify that you have the following Identity and Access Management (IAM) permissions on the project that owns the subscription:

    • instance.queryEffectiveSetting
    • instance.queryEffectiveSettingBindings
    • dataSharingWithGoogleSettings.create
    • dataSharingWithGoogleSettings.list
    • dataSharingWithGoogleSettings.get
    • dataSharingWithGoogleSettings.update
    • settingBindings.dataSharingWithGoogleSettingsCreate
    • settingBindings.dataSharingWithGoogleSettingsGet
    • settingBindings.dataSharingWithGoogleSettingsUpdate
    • settingBindings.dataSharingWithGoogleSettingsUse
  2. Open the Google Cloud console.

    Go to Google Cloud console

  3. In any page of the Google Cloud console, click spark Open or close Gemini Cloud Assist chat.

    The Cloud Assist panel opens.

  4. Click More actions (), and then click Cloud Assist Settings from the drop-down menu.

    The Manage Gemini Cloud Assist settings panel opens.

  5. In the Data sharing for Gemini Cloud Assist section, ensure that Help Google improve Gemini Cloud Assist by sharing your prompts and response is selected.

  6. Click Save.

API

To enable data sharing for Gemini Cloud Assist, use the CreateDataSharingWithGoogleSetting method.

  1. Verify that you have the following Identity and Access Management (IAM) permissions on the project that owns the subscription:

    • instance.queryEffectiveSetting
    • instance.queryEffectiveSettingBindings
    • dataSharingWithGoogleSettings.create
    • dataSharingWithGoogleSettings.list
    • dataSharingWithGoogleSettings.get
    • dataSharingWithGoogleSettings.update
    • settingBindings.dataSharingWithGoogleSettingsCreate
    • settingBindings.dataSharingWithGoogleSettingsGet
    • settingBindings.dataSharingWithGoogleSettingsUpdate
    • settingBindings.dataSharingWithGoogleSettingsUse
  2. Create the setting and a setting-specific value:

    1. Obtain an authentication token:

      TOKEN=$(gcloud auth print-access-token)
      
    2. 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 parent project ID.
      • SETTING_ID: Enter a unique setting name, such as dswg1 for Data Sharing with Google.

      If the command succeeds, it returns a response body that shows the enablePreviewDataSharing set to true:

      {
        "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, see Authenticate for using REST.

  3. 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 to which the setting should be applied.
    • SETTING_ID: Use the same SETTING_ID when you created the setting, but append it with b1. For example, use dswg1b1 for Data Sharing with Google.

    If the command succeeds, it returns the operation metadata in the following 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

  1. Verify that you have the following Identity and Access Management (IAM) permissions on the project where you want to modify settings:

    • instance.queryEffectiveSetting
    • instance.queryEffectiveSettingBindings
    • dataSharingWithGoogleSettings.list
    • dataSharingWithGoogleSettings.get
    • settingBindings.dataSharingWithGoogleSettingsGet
    • settingBindings.dataSharingWithGoogleSettingsDelete
    • settingBindings.dataSharingWithGoogleSettingsUse
  2. Open the Google Cloud console.

    Go to Google Cloud console

  3. In any page of the Google Cloud console, click spark Open or close Gemini Cloud Assist chat.

    The Cloud Assist panel opens.

  4. Click More actions (), and then click Cloud Assist Settings from the drop-down menu.

    The Manage Gemini Cloud Assist settings panel opens.

  5. In the Data sharing for Gemini Cloud Assist section, ensure that Help Google improve Gemini Cloud Assist by sharing your prompts and response is not selected.

  6. Click Save.

API

To disable data sharing for Gemini Cloud Assist, use the DeleteDataSharingWithGoogleSetting method.

  1. Verify that you have the following Identity and Access Management (IAM) permissions on the project where you want to modify settings:

    • instance.queryEffectiveSetting
    • instance.queryEffectiveSettingBindings
    • dataSharingWithGoogleSettings.list
    • dataSharingWithGoogleSettings.delete
    • dataSharingWithGoogleSettings.get
    • settingBindings.dataSharingWithGoogleSettingsGet
    • settingBindings.dataSharingWithGoogleSettingsUpdate
    • settingBindings.dataSharingWithGoogleSettingsUse
  2. Disable prompt and response sharing for the specified setting:

    1. Obtain the token:

      TOKEN=$(gcloud auth print-access-token)
      
    2. 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 PATCH command only succeeds if the setting resource already exists from when you enabled prompt and response sharing.

      Replace the following:

      • CONTAINER_PROJECT_NAME: Enter the parent project ID.
      • SETTING_ID: Enter the existing setting name, such as dswg1 for Data Sharing with Google.

      If the command succeeds, it returns a response body that shows the enablePreviewDataSharing set to false:

      {
        "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