# Give chat access to specific gateways

Faustine Chat reaches the operations of the gateways you turn on for it, and nothing else. You choose the gateways for the whole workspace, then narrow single users to some gateways or some operations.

## Before you begin

- Faustine Chat is set up for your workspace. See [Set up Faustine Chat for your team](https://docs.faustine.ai/apps/set-up-faustine-chat/).
- The gateway is published. See [Create a gateway](https://docs.faustine.ai/agent-gateway/create-a-gateway/).

## Turn a gateway on or off

1. In the portal, go to [**Faustine Chat**](https://auth.faustine.ai/go?to=%2Fapps%2Ffaustine-chat) and select **Configuration**.
2. Under **Access**, select [**Gateways**](https://auth.faustine.ai/go?to=%2Fapps%2Ffaustine-chat%2Fconfiguration%3Ftab%3Dgateways).
3. Turn on the switch on the gateway's row.
4. If the gateway has more than one environment, choose the one the chat serves. Without a choice, the chat serves the gateway's default environment.

The change applies to every user immediately. Users whose permissions are **Everything** reach the gateway from their next message. Faustine also installs a skill for the gateway, which you can edit in **Assistant** > **Skills**.

Turning a gateway off removes its operations from the chat for every user.

## Choose how the gateways are served

The **How your gateways are served** card on the same tab sets one mode for every gateway in the chat.

| Mode | What the assistant does | When to choose it |
| --- | --- | --- |
| **Code** | Searches your operations and writes a short script against them, which runs in Faustine's sandbox. | The recommended option. It needs fewer round trips for work that chains or loops, and it works with any number of operations. |
| **One tool per operation** | Calls each operation as a separate tool, one at a time. | For a model that does not write scripts well. Every operation is described in the prompt, so a large gateway makes each message slower. |

To change the mode, select its card. The gateway enforces the same permissions, confirmations and limits in both modes. In **Code**, a script that reaches operations requiring confirmation stops and the user answers for all of them on one card.

For what each mode means on the gateway, see [Serving modes: Code and Tools](https://docs.faustine.ai/agent-gateway/serving-modes/).

## Limit what one user reaches

A new user has **Everything**: every gateway turned on for the chat, including the ones you turn on later, and every operation.

To narrow a user:

1. Under **Access**, select [**Users**](https://auth.faustine.ai/go?to=%2Fapps%2Ffaustine-chat%2Fconfiguration%3Ftab%3Dusers).
2. On the user's row, select **Permissions**.
3. Select **Only some gateways**.
4. Turn on the gateways the user reaches.
5. For each one, keep **Every operation**, or select **Only these** and check the operations. The search box filters the list.
6. Select **Save permissions**.

The user's row now shows how many gateways the user reaches, such as "1 of 2 gateways". To go back, open **Permissions** and select **Everything**.

> **Note:** A user with **Only some gateways** needs at least one gateway. To block a user completely, disable them instead. See [Add and manage chat users](https://docs.faustine.ai/apps/chat-users/).

## Next steps

- [Add and manage chat users](https://docs.faustine.ai/apps/chat-users/): create, disable and delete users.
- [Add knowledge and skills to Faustine Chat](https://docs.faustine.ai/apps/chat-knowledge-and-skills/): edit the skill installed for each gateway.
- [Confirmation](https://docs.faustine.ai/agent-gateway/confirmation/): what the user sees when an operation requires confirmation.
