# Confidence

Let Lyna AI create and manage feature flags, variants, targeting rules and metrics in your Confidence account while it builds.

Connect your Confidence account so Lyna AI can add a feature flag while it builds a feature, set its variants and targeting, and use it in your app.

## What it lets you do

- Create and manage flags, variants and targeting rules.
- Create and manage clients, event definitions, assignment tables, metrics and metric calculations.

| Item                         | Detail                                                                      |
| ---------------------------- | --------------------------------------------------------------------------- |
| What it asks for             | A sign-in on Confidence's page.                                             |
| Who pays the provider        | You, through your own Confidence account.                                   |
| Do actions change real data? | Yes. A flag, a variant or a targeting rule changes in your account.         |
| Where it runs                | On Confidence's servers.                                                    |
| Who uses it                  | Lyna AI while it builds, in Build mode. Your published app does not use it. |

## What you need before you start

- A Confidence account. A new account comes with a client, a tutorial flag, and demo metrics and experiments, so you can try it right away.
- A role that allows the task (see below). An admin of your organization assigns it.
- Edit access to your Lyna project.

### Permissions in Confidence

Confidence sets access with roles, and a flag can carry its own list of who may view or edit it, under the **Permissions** button on its page. Sign in with an account whose role covers only what you want Lyna AI to change.

| Task                                 | What you need                   |
| ------------------------------------ | ------------------------------- |
| Read flags and segments              | **Flags Reader**, or **Reader** |
| Create and manage flags and segments | **Flags Editor**, or **Editor** |
| Create and manage clients            | **IAM Editor**, or **Editor**   |
| Read clients                         | **IAM Reader**, or **Reader**   |
| Create events and metrics            | **Editor** or **Creator**       |

Read access to a client is enough to reveal its secret, so a reader role still deserves care. See [Confidence roles](https://confidence.spotify.com/docs/platform/iam/roles).

## Ways to connect

**On the connector's page.** A sign-in on Confidence's own page. Lyna stores it encrypted. Only the owner can sign in again.

**Who owns the account?** The person who signed in. Every call goes out as that person's Confidence account, whoever typed the request.

**Who can use it?** Only you, in the projects you link it to, until you change it. On the connector's page, **Who can use it** also offers **Only this project** and **The whole workspace**. See [Who can use a connection](/integrations/connectors#who-can-use-a-connection).

**The Experiments server.** This connector is the Flags server. To also list A/B tests and rollouts and read their results: In **Connectors**, choose **Add custom**, then **Custom server**. Give it a name, paste `https://mcp.confidence.dev/mcp/experiments` in **Server address**, keep **Sign in** under **How it signs in**, and choose **Add and test**.

## Set it up

1. ### Open the connector

   Open the **+** menu of the chat and choose **Connectors**. Find **Confidence** with the search field or under **Analytics**, then open its page.
2. ### Connect

   Choose **Connect**. The **New connection** page opens and reads "Sign in with your Confidence account to connect." Choose **Connect** at the bottom of the page. **Sharing**, just above, sets who can use it.
3. ### Sign in

   A new window opens on Confidence's own page. If your browser blocks the window, the page goes to the sign-in in the same tab and brings you back after. Sign in and approve the access.
4. ### Read the result

   The page tests the connection and shows the result. **Connected** means Lyna can use it.

This connector shows no field to fill in: everything you give, you give on Confidence's own page.

> [!WARNING]
>
> **What never to share**
>
> Lyna never asks for your Confidence password. Type it only on Confidence's own page, and never paste a password, a token or a key in the chat.

### Check it works

After you choose **Connect**, the page tests the connection and shows the result. Run it again at any time with **Test connection**. **Connected** proves that Confidence's server answered, accepted your sign-in and listed its tools. A pass does not prove access to every piece of data. It reaches what your Confidence account allows.

To check for real, ask for something you know exists:

- "List my Confidence clients."

## What to ask Lyna AI

Type these in the chat, in Build mode, and adjust the names to yours. Once it is connected, **Use Confidence** on its page starts a message for you.

| What you build or do      | What to type                                                                                                       | What happens                                                      |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------- |
| Ship behind a flag        | "Create a flag named new-checkout with on and off variants, target 10% of users, and use it on the checkout page." | After your approval, the flag exists and your code reads it.      |
| See what is set up        | "List my Confidence clients and the flags attached to each."                                                       | It lists them in the chat.                                        |
| Add a client for your app | "Create a client named web-app and tell me how to use it in this project."                                         | After your approval, the client exists in your account.           |
| Target a segment          | "Add a rule to new-checkout that turns it on for users in France."                                                 | After your approval, the rule joins the list. Rules run in order. |
| Roll a flag forward       | "Raise new-checkout to 50% of users."                                                                              | After your approval, more users get the new variant.              |
| Measure what you ship     | "Create an event definition for checkout\_completed and a metric that counts it."                                  | After your approval, both exist in your account.                  |

### Approvals and tool switches

Before a call, Lyna AI shows the tool and what it asks. You choose **Deny**, **Allow once**, **Always allow this tool** or **Always allow this connector**. A tool its server marks as read-only does not ask. A changed or new tool asks again, and **Ask again** on the connector's page takes a choice back.

Under **What Lyna AI can use**, each tool has a switch. Lyna AI stops using a tool you turn off, in your chats in this project.

### Stay safe

What a connector answers reaches the AI as data, never as instructions. Read each approval before you accept it.

- Rules run in order, and the first one that matches a user wins. Read a new rule in its place in the list before you approve it.
- For read-only use, connect only the Experiments server (see Ways to connect), which cannot change anything.

## Limits

- The Experiments server cannot create or change experiments.
- No Confidence server can create entities, fact tables or dimension tables. Use the Confidence app or API for those.
- See [Use MCP](https://confidence.spotify.com/docs/quickstarts/use-mcp).
- Connector tools run in Build mode. Plan and Ask do not run them.

## Troubleshooting

| What you see                                                           | What it means and what to do                                                                                                                                                                 |
| ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Needs sign-in**                                                      | Your sign-in ended, or you revoked it at Confidence. Choose **Connect** and sign in again.                                                                                                   |
| The sign-in window does not open                                       | Your browser blocked it, so the page goes to the sign-in in the same tab. If nothing happens, allow pop-ups for Lyna and choose **Connect** again.                                           |
| No answer from the sign-in window yet                                  | If the window is still open, finish there. If you closed it, choose **Connect** again.                                                                                                       |
| **The sign-in was cancelled.**                                         | You closed or declined Confidence's page. Choose **Connect** and approve the access.                                                                                                         |
| **The service refused the sign-in.**                                   | Check that you used the right account and that your organization allows this access, then choose **Connect**.                                                                                |
| **The sign-in took too long. Start it again.**                         | Choose **Connect** and sign in again.                                                                                                                                                        |
| **The sign-in worked, but the server did not answer.**                 | Choose **Test connection**.                                                                                                                                                                  |
| **Not tested yet**                                                     | No test has answered. Choose **Test connection**.                                                                                                                                            |
| **Connection failed**                                                  | The page says why next to it. If the server did not answer, choose **Test connection**.                                                                                                      |
| A call fails with a permission error                                   | **Connected** does not prove access to every piece of data. Confidence refused the call with the rights of the account you connected. Check Permissions in Confidence above, then try again. |
| **New tools to review**                                                | The server changed its list of tools, so Lyna stops using it until you decide. Read the list, then choose **Approve new tools**.                                                             |
| **Turned off**                                                         | Lyna AI does not use it. Choose **Turn on**.                                                                                                                                                 |
| It needs a new sign-in. Only the person who connected it can give one. | Someone else connected it, and that sign-in ended. Ask that person to choose **Connect**.                                                                                                    |
| The person who connected it left the workspace                         | The connection holds no key or sign-in. Choose **Connect** to use it again.                                                                                                                  |
| The connector stops answering                                          | Confidence says to authenticate again. Choose **Connect** on the connector page.                                                                                                             |

### Disconnect

**Turn off** stops Lyna from using the connector and keeps your settings. **Remove from this project**, under **More options**, takes it out of this project only, and shows when another project uses it. **Delete connection**, in the same menu, removes it from every project, with what it stored, and says first how many projects lose it. Your flags and rules stay in your Confidence account.

## Related

- [Connectors](/integrations/connectors): What connectors are and how the chat uses them.
- [PostHog](/integrations/connectors/posthog): Query your analytics and manage flags.
- [Amplitude](/integrations/connectors/amplitude): Read experiments and product data.
- [Chat modes](/features/ai/chat-modes): Build, Plan and Ask.
