Skip to content

Connect an agent

You already have a credential that works, but do not hand it to an agent. Your key carries all of your permissions, it is the key your own terminal uses, and once it is in a model’s context you cannot take it back out.

Give the agent a key of its own instead. That key decides how far the agent reaches, and it is the only thing you have to revoke when you change your mind.

One address, and nothing held open

Flui speaks MCP at a single address: your installation’s API base with /mcp on the end. Every call is a POST to that address with the key in an Authorization: Bearer header.

There is no session to open, keep alive or re-establish after a network drop. Each request is answered on its own, and the server built to answer it is then thrown away.

This follows protocol revision 2026-07-28, which removes sessions and the opening handshake from MCP. Clients built against the 2025 revisions are served too, with the same tools, so an older agent does not need upgrading before it can connect.

The endpoint answers POST only. A GET for an event stream is refused, because there is no stream: nothing is ever published outside the reply to a call.

The key is shown once

Flui stores a hash of the key, never the key itself. After minting, the value does not exist anywhere on the installation, so nobody can show it to you again, including whoever runs the installation.

If you lose it, revoke it and mint another. There is no recovery step.

What the key may touch: two lists

Two separate questions decide what an agent can do.

What kind of work is set by the key’s scopes: deploying, reading logs, touching access and so on. Scopes have their own page: Choose what your agent may do.

Which applications is what this page covers. A key can name specific applications, specific projects, or both.

The two lists are alternatives. An application is reachable as soon as either list covers it. Naming an app individually and naming its project are two ways to reach the same app, and a key holding both reaches the union of the two.

This has three consequences:

  • A project grant keeps working as the project grows. An app added to a granted project later is covered on its next request. The project is checked against the application as it stands, every time, so there is nothing to refresh or reissue.
  • An app named individually stays reachable even if it leaves a granted project. That follows from the lists being a union rather than an intersection.
  • Naming neither list means every application you can already reach. That is the default.

You can change both lists on a live key. The agent holding it keeps working against the new lists, with nothing reissued and nothing to reconnect.

The refusal tells the agent this too. When an agent asks about an application outside the key’s reach, it is told that the credential is intentionally limited, where a person can extend it, and that a new key is not needed because the same key can be widened. The agent then asks you to widen the key instead of demanding a fresh credential or giving up.

These lists only narrow; they never grant. An application id on the list that you cannot access yourself opens nothing.

The first call is get_started

Once the agent is connected, get_started comes before every other tool.

It returns the instructions for operating this installation: how deployment works here, how secrets are handled, and what happens when an action needs a person’s approval. It also records which version of those instructions this credential is working from.

That second part matters to you as well as to the agent. Until a key calls it, the agent keys screen says the key has never reported which instructions it is working from. Once it has, you know the agent actually connected.

Every key can call get_started from the moment it exists, whatever you switched on when you minted it.

A properly-scoped agent can deploy

A key that carries write access can take an application from a repository to running on its own, through any of the three ways Flui supports. It can write and deploy a flui.yaml manifest, read a connected repository and deploy the map Flui renders from it, or ship an application straight from a container image with no repository at all. The agent’s own tools state that none of the three is the preferred path.

The deploy still does not happen silently. A deploy an agent asks for stops and becomes a question addressed to you (see When your agent stops to ask you). Which of these an agent may attempt at all depends on the permission group you switch on, in Choose what your agent may do.

Minting the key

Minting a key needs a different credential from logging in: a session token from the installation’s identity provider, passed with --token or in FLUI_SESSION_TOKEN. The command works only where Flui is running in OIDC mode.

Terminal window
flui auth generate-api-key \
--name "claude-code-on-my-laptop" \
--scope mcp:app:read \
--scope mcp:obs:read \
--expires 30 \
--token "$FLUI_SESSION_TOKEN"

You must say what the key is for. If you pass neither --scope nor --unscoped, the command fails before it touches the network, and the error explains why: a key with no scope is the widest credential the installation can issue, so you have to ask for it by name.

--scope is repeatable. --unscoped is its opposite, a key with no ceiling that carries all of your permissions, and the two cannot be combined. --expires is a number of days; leave it out for a key that never expires.

A scope you do not hold yourself is refused. You cannot mint a key stronger than you are, and the command does not silently give you a weaker one instead.

Watch out for one thing: the command saves the key into a profile (the active one, unless you name another with --profile), replacing the key that profile was using. Your own terminal then runs as the agent, with the agent’s narrower reach.

Point --profile at another profile you already have if you want to keep working in this one. If you forget, flui auth login mints you a fresh key and puts it back.

The key lives in your own encrypted profile, and the CLI uses it from there. The platform cannot show it to you again.

To see what exists:

Terminal window
flui auth api-keys

Each row shows a name, a state (active, expired or revoked), the scopes the key carries, and its id. An unscoped key says so instead of showing an empty list.

To take one back:

Terminal window
flui auth revoke-api-key <id>

The key stops working immediately.

Two things are not available on the CLI. There is no --groups flag: from the terminal you mint by raw scope or with --unscoped. There is also no flag for the application or project lists. Keys that use either are minted where the person giving consent can read what they are agreeing to: the dashboard, and the API underneath it.

Where this goes next