> ## Documentation Index
> Fetch the complete documentation index at: https://docs.poly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Wren to Gemini Enterprise

> Connect Wren to your Gemini Enterprise app, so your team can work on their PolyAI agents from Gemini.

Wren connects to Gemini Enterprise as a custom A2A agent. Once it's set up, your team can ask Wren about their PolyAI agents, and have it make changes, without leaving Gemini.

<Info>
  Wren for Gemini Enterprise is currently available to US customers only. In the UK or EU, contact your PolyAI representative.
</Info>

<Frame>
  <img src="https://mintcdn.com/polyai/oABPyIFGMxQoefXC/images/wren/gemini-enterprise/wren-chat.png?fit=max&auto=format&n=oABPyIFGMxQoefXC&q=85&s=7074fb7198f0410f36c7a0a9ce565a6a" alt="Wren open in the Gemini Enterprise web app, with its description and an Ask Wren input" style={{ maxWidth: '760px', width: '100%', margin: '0 auto', display: 'block' }} width="1200" height="819" data-path="images/wren/gemini-enterprise/wren-chat.png" />
</Frame>

## Before you start

<CardGroup cols={3}>
  <Card title="Gemini Enterprise admin" icon="user-shield">
    You need the Gemini Enterprise Admin role on the Google Cloud project that holds your app.
  </Card>

  <Card title="Client ID and secret" icon="key">
    Your PolyAI team sends these to you separately. Keep the secret private.
  </Card>

  <Card title="PolyAI logins" icon="right-to-bracket">
    Each person who uses Wren signs in with the login they use for Agent Studio.
  </Card>
</CardGroup>

## Set up Wren

Setup takes about ten minutes, all in the Google Cloud console.

<Steps>
  <Step title="Add a custom A2A agent">
    Go to **Gemini Enterprise**, open your app, then **Agents** › **Add agents** › **Custom agent via A2A**.

    <Frame>
      <img src="https://mintcdn.com/polyai/gq8BZSKJOV5iQ8d-/images/wren/gemini-enterprise/add-agent.png?fit=max&auto=format&n=gq8BZSKJOV5iQ8d-&q=85&s=68aaab683d5d6fa3df655a86d32329fc" alt="Add an agent panel with agent types, including Custom agent via A2A" style={{ maxWidth: '760px', width: '100%', margin: '0 auto', display: 'block' }} width="1200" height="763" data-path="images/wren/gemini-enterprise/add-agent.png" />
    </Frame>
  </Step>

  <Step title="Paste the agent card">
    Open this link in your browser. It shows Wren's agent card, which is a block of JSON text. Copy all of it and paste it into the **Agent Card JSON** field, then select **Preview Agent Details**.

    ```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
    https://wren-gateway-727163355365.us-central1.run.app/.well-known/agent-card.json
    ```

    <Frame>
      <img src="https://mintcdn.com/polyai/gq8BZSKJOV5iQ8d-/images/wren/gemini-enterprise/agent-card.png?fit=max&auto=format&n=gq8BZSKJOV5iQ8d-&q=85&s=eebfce8cc70c62faea9ec633a883652a" alt="Agent card JSON pasted into the Import agent step, with a preview of Wren's details below" style={{ maxWidth: '760px', width: '100%', margin: '0 auto', display: 'block' }} width="1200" height="763" data-path="images/wren/gemini-enterprise/agent-card.png" />
    </Frame>
  </Step>

  <Step title="Set up sign-in">
    Select **Next**, then fill in the authorization fields:

    | Field | Value |
    | - | - |
    | Client ID | From your PolyAI team |
    | Client secret | From your PolyAI team |
    | Authorization URL | `https://login.us.poly.ai/authorize?audience=https%3A%2F%2Fplatform.polyai.app%2Fapi&response_type=code` |
    | Token URL | `https://login.us.poly.ai/oauth/token` |
    | Scopes | `openid email offline_access` |

    The console fills in the Authorization URL, Token URL and Scopes from the agent card. Check they match, and add `&response_type=code` to the end of the Authorization URL if it's missing. Then select **Finish**.

    <Warning>
      Don't select **Skip & Finish**. Without sign-in, Wren can't reach your PolyAI agents.
    </Warning>

    <Frame>
      <img src="https://mintcdn.com/polyai/gq8BZSKJOV5iQ8d-/images/wren/gemini-enterprise/sign-in.png?fit=max&auto=format&n=gq8BZSKJOV5iQ8d-&q=85&s=15985b17e621b75302d3ff50bd5e3d8b" alt="Agent authorization form with client ID, client secret, authorization URL, token URL and scopes" style={{ maxWidth: '760px', width: '100%', margin: '0 auto', display: 'block' }} width="1200" height="763" data-path="images/wren/gemini-enterprise/sign-in.png" />
    </Frame>
  </Step>

  <Step title="Share Wren with your team">
    Go to **Agents** › **Wren** › **User permissions**, then add people, or add **All users** with the **Agent User** role.

    <Note>
      New custom agents are visible to nobody until you share them.
    </Note>

    <Frame>
      <img src="https://mintcdn.com/polyai/gq8BZSKJOV5iQ8d-/images/wren/gemini-enterprise/share.png?fit=max&auto=format&n=gq8BZSKJOV5iQ8d-&q=85&s=05be843a86252d6886681dca71f3c733" alt="Wren's user permissions, shared with all users as Agent User" style={{ maxWidth: '760px', width: '100%', margin: '0 auto', display: 'block' }} width="1200" height="763" data-path="images/wren/gemini-enterprise/share.png" />
    </Frame>
  </Step>

  <Step title="Turn on the web app">
    Open your app's **Integration** page, turn on **Enable the Web App**, then copy the link. Skip this if your team already uses the web app and it's enabled.

    <Frame>
      <img src="https://mintcdn.com/polyai/oABPyIFGMxQoefXC/images/wren/gemini-enterprise/web-app.png?fit=max&auto=format&n=oABPyIFGMxQoefXC&q=85&s=9d59ef00d2aaea294fb5902eac1cf31e" alt="Integration page with Enable the Web App turned on and the web app link" style={{ maxWidth: '760px', width: '100%', margin: '0 auto', display: 'block' }} width="1200" height="763" data-path="images/wren/gemini-enterprise/web-app.png" />
    </Frame>
  </Step>

  <Step title="Try it">
    Open the web app, go to **Agents**, choose **Wren** and send a message. The first time, you're asked to authorize PolyAI: sign in with your Agent Studio login. Wren then asks which workspace and agent to work on.

    <Frame>
      <img src="https://mintcdn.com/polyai/gq8BZSKJOV5iQ8d-/images/wren/gemini-enterprise/agent-gallery.png?fit=max&auto=format&n=gq8BZSKJOV5iQ8d-&q=85&s=792d7002be92a7bc5a3f0374511d03ce" alt="Wren listed under From your organization in the Gemini Enterprise agent gallery" style={{ maxWidth: '760px', width: '100%', margin: '0 auto', display: 'block' }} width="1200" height="610" data-path="images/wren/gemini-enterprise/agent-gallery.png" />
    </Frame>
  </Step>
</Steps>

## Good to know

* **One agent per chat.** Wren asks for a workspace and agent at the start of each chat. To switch agents, start a new chat.
* **Some changes stay in Agent Studio.** Entering secrets or API credentials, and confirming configuration changes, still happen in Agent Studio. Wren tells you when that's needed.
* **Sign in again daily.** Expect to reauthorize PolyAI about once a day.
