Save and share prompts

This document describes how to save and share prompts in Vertex AI Studio. Sharing prompts lets you collaborate with team members, ensure consistency, and build a library of effective prompts for various tasks.

Sharing works as follows:

  • By default, all Vertex AI users have full access to all saved prompts in the project. There is no need to share saved prompts with other users in the project unless organizational or project restrictions have been placed on them or specific resources like datasets.

  • Vertex AI users can share any prompt in the project, even prompts that were not created or saved by them.

  • Only Vertex AI users can share prompts. If an outside user is invited to collaborate on a prompt, they cannot share the prompt with another user.

  • Prompt sharing is per prompt, not per project. Invited users can access only the prompts that they have been invited to collaborate on. They don't have access to the other prompts in the project.

Before you begin

If the project hasn't enabled the prompt sharing feature yet, ask your administrator to enable it.

To enable prompt sharing, the administrator must have the following permissions:

  • Org level:

    • Permissions to manage deny policies (roles/iam.denyAdmin)
  • Project level:

    • Permissions to manage custom roles (roles/iam.roleAdmin)

    • Permissions to set and remove roles onto principals (roles/resourcemanager.projectIamAdmin)

    • Permissions to manage service accounts (roles/iam.serviceAccountAdmin)

    • Permissions to manage tags (roles/resourcemanager.tagAdmin)

    • Permissions to use tags (roles/resourcemanager.tagUser)

    • Permissions to use Vertex AI resources ( roles/aiplatform.user)

Enable prompt sharing

To enable prompt sharing:

  1. In Vertex AI Studio, go to either Prompt management or Chat playground

    Go to Prompt management

    Go to Chat playground

  2. Open a saved prompt and click the Share button.

    If your account has the permissions to enable sharing, you will see an Enable button.

    Prompt sharing enable button

    If your account doesn't have the permissions to enable sharing, you will see a list of required roles.

    Prompt sharing required roles

  3. Click Enable.

    The system creates a project-level service account, known as the prompt sharing service account, in your project with the permissions required for prompt sharing. For more information, see Security information.

Save a prompt

To save a prompt for later use or sharing:

  1. Go to Vertex AI Studio.

    Go to Vertex AI Studio

  2. Write a new prompt or open an existing prompt.

  3. Click the Save button.

Share a saved prompt

Once prompt sharing is enabled, any Vertex AI user can share a saved prompt.

  1. In Vertex AI Studio, go to either Prompt management or Chat playground

    Go to Prompt management

    Go to Chat playground

  2. Open a saved prompt and click the Share button.

    If prompt sharing was enabled successfully, you will see a window similar to the following:

    Prompt sharing window

    When a prompt is shared, the recipient(s) of the shared prompt receive an email notification similar to the following:

    Prompt sharing email

Stop sharing a prompt

To revoke access to a prompt:

  1. Open a saved prompt and click the Share button.

  2. Next to the principals, select Remove and then click Save.

    Prompt sharing stop sharing

    Note that deleting a saved prompt automatically removes access for anyone it was shared with.

Security information

When you enable prompt sharing, you grant the Vertex AI API service the permissions to invite users to your project on your behalf. Specifically, you create a project-level service account, known as the prompt sharing service account, in your project with the following permissions:

  • iam.roles.create
  • iam.roles.list
  • iam.roles.update
  • iam.roles.delete
  • resourcemanager.projects.setIamPolicy
  • resourcemanager.projects.getIamPolicy
  • cloudasset.assets.searchAllIamPolicies

To ensure that only the Vertex AI API service is authorized to use the prompt sharing service account, the system automatically creates a deny policy when prompt sharing is enabled.

What's Next