# Hex

Let Lyna AI search your Hex projects, ask questions of your data, and edit and run notebooks while it builds.

Connect your Hex workspace so Lyna AI can ask questions of your data and read your notebooks, then build screens from real results.

## What it lets you do

- Search projects, and start or continue a thread that answers a question from your data.
- Create projects, and read, create, update and delete cells.
- Run a cell or a whole notebook, read the run and its outputs, and get a cell as an image.
- List your data connections.

| Item                         | Detail                                                                                                   |
| ---------------------------- | -------------------------------------------------------------------------------------------------------- |
| What it asks for             | A sign-in on Hex's page, where you choose a workspace if you have several.                               |
| Who pays the provider        | You, through your Hex plan. The server is on the Team and Enterprise plans, in beta.                     |
| Do actions change real data? | Yes, on the Editor role and above. A cell you change is changed on the live draft, with no staging step. |
| Where it runs                | On Hex'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 Hex account on the **Team** or **Enterprise** plan. The server is in beta.
- The Explorer role to search and ask, or Editor and above to edit. Editing also needs **Can Edit** or **Full Access** on that project.
- Edit access to your Lyna project.

### Permissions in Hex

Hex enforces both your workspace role and your rights on each project. The **Admin** role gives no automatic edit rights on every project. The workspace's API access setting does not govern this connection: to cut someone off, Hex says to deactivate the user.

| Task                                | What you need                                                                  |
| ----------------------------------- | ------------------------------------------------------------------------------ |
| Search projects and run threads     | **Explorer** or above                                                          |
| Read a project and its cells        | View access on that project                                                    |
| Use the project editing tools       | **Editor** or above                                                            |
| Create, update or delete a cell     | **Can Edit** or **Full Access** on that project, else a "Not authorized" error |
| Query a connection marked sensitive | An admin who allows it                                                         |

See [the Hex MCP server](https://learn.hex.tech/docs/api-integrations/mcp-server).

## Ways to connect

**On the connector's page.** A sign-in on Hex'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 Hex 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).

**A single-tenant, EU or HIPAA instance.** In **Connectors**, choose **Add custom**, then **Custom server**. Give it a name, paste your address, such as `https://eu.hex.tech/mcp`, 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 **Hex** 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 Hex 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 Hex'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. If you belong to several Hex workspaces, you pick one when you sign in.
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 Hex's own page.

> [!WARNING]
>
> **What never to share**
>
> Lyna never asks for your Hex password. Type it only on Hex'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 Hex's server answered, accepted your sign-in and listed its tools. A pass does not prove access to every piece of data. Hex applies your workspace role and your rights on each project, and an Admin role gives no automatic edit rights.

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

- "Search my Hex workspace for one project and tell me its title."

## What to ask Lyna AI

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

| What you build or do            | What to type                                                                                | What happens                                                                |
| ------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| Reuse an analysis               | "Search Hex for our monthly revenue project and tell me what it shows."                     | Lyna AI finds the project and reads it.                                     |
| Ask a data question, then build | "Ask Hex which plan has the most active accounts, then build a chart page from the answer." | It starts a thread, waits for the answer and builds the page.               |
| Change a notebook               | "Add a SQL cell to the churn notebook that groups by plan, run it, and show me a preview."  | After your approval, the cell is on the live draft and runs.                |
| Check a run                     | "Run the weekly metrics notebook and tell me whether any cell failed."                      | It runs the notebook and reads the outputs.                                 |
| Find what you can query         | "List my Hex data connections."                                                             | It lists them. Connections marked sensitive stay out of queries by default. |
| Follow up on an answer          | "Continue that thread and split the result by country."                                     | Once the thread has finished, it continues it.                              |

### 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.

- For read-only use, sign in with the Explorer role: Explorers can search and run threads, but cannot create or edit projects.
- Hex does not query connections marked sensitive by default, and an admin decides whether that changes.
- Edits do not change published apps, but they do change the live draft.

## Limits

- A thread usually takes several minutes, and you can only continue it once it has finished.
- Threads started this way are always new ones. They cannot start from an existing project or continue a thread from the Hex app.
- Only code, SQL and Markdown cells can be edited. Changing a cell label means deleting and recreating the cell.
- SQL outputs come back as a row-limited preview.
- You cannot pass files to Hex through the chat.
- See [Hex MCP server](https://learn.hex.tech/docs/administration/mcp-server).
- 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 Hex. 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 Hex'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. Hex refused the call with the rights of the account you connected. Check Permissions in Hex 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.                                                                                                    |
| A request seems stuck                                                  | A thread can take several minutes. Ask for its status instead of starting another.                                                                                             |
| Changing a cell is refused                                             | You need **Can Edit** or **Full Access** on that project, even as an Admin.                                                                                                    |
| A connection returns nothing                                           | It may be marked sensitive. An admin can allow it with **Allow sensitive data connections in MCP, API, and CLI**.                                                              |

### 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. At Hex, turning off API access does not stop this connection: it only affects personal access tokens. Hex states that deactivating the user removes all of that user's access.

## Related

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