Skip to content
Kutrion
Browse docs

privacy-first-ai

Connect an AI agent (MCP)

Give an AI assistant access to your infrastructure without giving it your credentials. Kutrion exposes the vault and the SSH broker as MCP tools, so Claude Code, Claude Desktop, Cursor and Copilot act through the broker instead of holding secrets.

Updated 18 नव॰ 2026

Most MCP servers ask you to paste an API key into a JSON config file. That key is long-lived, scoped to everything the key can do, sits in plaintext on disk, and leaves no record of what was done with it. Kutrion takes the opposite approach: the agent gets access, not credentials.

When an AI assistant connects to Kutrion over the Model Context Protocol, it authenticates as an agent principal — a non-human identity that belongs to you, expires on its own, and can be revoked without touching your own sessions. When it uses a credential, the secret is decrypted on the server, used, and discarded. It never crosses the wire to the model.

Connect a client

One command, from a machine where you are signed in to the CLI:

kt mcp install --client claude-code

Supported values for --client:

ClientConfig writtenScope
claude-code.mcp.json in the current directoryProject
claude-desktopclaude_desktop_config.json in your Claude application-support directoryUser
cursor~/.cursor/mcp.jsonUser
copilot.vscode/mcp.json in the current directoryWorkspace

Use --dir to write a project-scoped config somewhere other than the current directory.

The command mints an agent principal, stores its credential in your operating system’s keychain, writes the client config, and verifies the connection before it reports success. Then restart the client — Claude Desktop needs a full quit and reopen; Claude Code will ask you to approve the project-scoped server the first time you run it.

The config file contains no secret

This is the part that matters. The entry we write looks like this:

{
  "mcpServers": {
    "kutrion": {
      "command": "kt",
      "args": ["mcp"],
      "env": { "KT_API_BASE": "https://your-kutrion-host", "KT_MCP_CLIENT": "claude-code" }
    }
  }
}

There is no token in it. kt mcp reads a short-lived credential from your OS keychain at launch, so the file is safe to commit to a repository, safe to screenshot, and safe to share with a teammate who will run kt mcp install themselves. Revoking access never requires editing it.

What the agent can do

The agent sees only the tools its scopes allow, and can only reach what you can reach — an agent is a delegation of your access, never an escalation of it. By default it is granted:

ScopeToolsWhat it can do
vault.listvault_list, vault_searchSee which vaults and credentials exist. Metadata only — never a value. vault_list returns up to 100 credentials per call (limit up to 500); when has_more is true, pass next_cursor for the next page, and narrow with vault_id or name.
vault.usevault_useAuthenticate to an existing connection with the credential bound to it and report whether it worked. The tool takes a connection id, not a host, and returns no secret material.
files.readfiles_list, files_getBrowse and read files over SFTP, FTP/FTPS, WebDAV or object storage.
audit.readaudit_queryRead its own audit trail — not yours, and not another agent’s.

Two discovery tools sit alongside these and are granted by any scope that needs them: ssh_list returns the SSH connections the agent can reach, and files_connections returns the FTP/FTPS/WebDAV and object-storage targets. Both are metadata only. They are how the model learns the connection ids that ssh_run, vault_use and the file tools take. They list what the agent can actually use: a connection whose credential sits in a vault the agent cannot read is left out rather than advertised and then refused, and an SSH host with no credential appears only while it is enrolled for certificate access. Cloud storage connections (Dropbox, OneDrive, Google Drive, Box) have no discovery tool; their ids come from you, through GET /agents/scope-options described below.

More scopes are available but off by default, and minting a principal with any of them requires a fresh step-up so that granting them is a deliberate act by a present human:

  • ssh.exec — ssh_run: run a command on a brokered host and get its output and exit code. Output past 256 KiB per stream is cut and the result carries truncated: true with the original size. This holds on your own device too: kt mcp install --scopes ...,ssh.exec asks for an authenticator code before it mints. Rotating its secret or renewing it asks for one too, so an agent with ssh.exec is not kept alive by kt agent keepalive: it lasts up to 7 days unless you renew it with a step-up, and is then minted again with kt mcp install; --keepalive is refused alongside it. Once minted, the gating described under “Approve a reveal as it happens” below applies when each command runs.

  • vault.reveal — the only tool that returns plaintext secret material. By default an agent uses a credential through vault_use and never sees it; reveal is the explicit exception. It is granted per vault, so you name the vaults it reaches when you create the agent:

    kt mcp install --client claude-code --reveal-vault "Production"
    

    --reveal-vault takes a vault id or name and can be repeated. It adds vault.reveal for the named vaults only; asking for vault.reveal in --scopes is refused. Over the API, the same grant is resource_scope.reveal with vault_ids and, optionally, credential_ids. An agent minted with vault.reveal and no reveal list is refused with reveal_scope_required, and an empty or unreadable list reveals nothing. The vaults must sit inside the agent’s own vault_ids when it has them, and each must be one you can read. See “Reveal is capped, approved and recorded” below. vault_reveal also refuses a credential marked injection-only, for every agent, regardless of scope. Note that the flag constrains the reveal path rather than containing the secret: the broker may use the secret without revealing it, to a destination recorded on the credential — see SSH broker overview for the full statement.

  • files.write — modifying remote files.

  • vault.inject — action_run: run an action an org admin set up, a fixed web request Kutrion makes with a stored credential. The credential is never returned to the agent.

Choose scopes explicitly with --scopes:

kt mcp install --client cursor --scopes vault.list,ssh.exec --days 7

If you are a member

These rules apply to people whose role in the organization is member, not owner or admin. They are organization governance: owners and admins decide whose AI may run commands and spend shared credentials. They are not a control that stops a member from doing by hand what their own access allows, and your own signed-in kt keeps your own access.

What keeps working, with no decision needed:

  • An agent created with kt mcp install on your own computer after kt login, and an AI client you connect through OAuth, keep ordinary host access: opening SSH sessions, reading files, using the credentials bound to your connections, and cloud reads. A kt mcp install agent ends with the device it was created on.

What needs an owner or admin to decide first:

  • Running commands (ssh.exec), writing files on hosts, and running actions that spend a credential bound to an admin (vault.inject).
  • Using shared credentials, meaning injection-only credentials that are locked, sit in no vault, or sit in a vault you cannot write to.
  • Sending a credential to a third-party MCP server through the gateway. The same shared-credential rule applies to the credential the server is bound to. An OAuth client of a member cannot spend shared credentials, because each consent creates a new agent and a decision covers one agent.
  • Any host access from an agent that outlives your sign-in: an agent created from a browser session, a workload, or an agent left behind when its device is signed out. The reason is device loss or token theft: such an agent keeps working after the device or sign-in it came from is gone. The refusal comes back as workload_admin_required, with a hint to create the agent on your own computer with kt mcp install instead, or to request it from the Agents page when your organization has that turned on.

The OAuth consent screen does not offer ssh.exec to a member. It says that running commands needs an owner’s or admin’s decision and the client does not get it.

A member can hold at most 10 live agents that outlive their sign-in. Agents on a signed-in device and OAuth clients do not count. Past 10, creating one answers 429 member_automation_limit; revoke one you no longer use.

When an admin is demoted to member, the rules apply from that person’s next call: what now needs a decision stops at once. Ordinary host access on a signed-in device or through OAuth continues, as it does for any member.

Narrowing further

An agent principal can carry a resource scope, two lists of ids that restrict it to specific vaults and connections, so a coding assistant wired to one project cannot reach the rest of your infrastructure. The scope sits on top of your own access: it can only narrow what you can reach, never widen it, and every use is still checked against you.

How the two lists read:

  • An empty or absent list means no restriction of that kind. {} is “everything I can reach”.
  • vault_ids limits which vaults the agent may use credentials from. A connection whose bound credential sits in another vault is refused.
  • connection_ids limits which connections the agent may name, across SSH, file and cloud connections alike. Left empty, it reaches every connection you can reach, including ones you add after the agent was minted. Once it lists one id it is an allow-list for all three kinds, so naming one cloud connection means naming every other connection the agent should keep.
  • A vault restriction covers only what holds a vault credential. A connection with no credential behind it — an enrolled SSH host that authenticates by certificate, or a cloud storage connection, which holds a provider grant — has no vault to check. While vault_ids is set, such a connection is reachable only if connection_ids names it.

To see which ids you can use, GET /agents/scope-options lists your readable vaults and your SSH, file and cloud connections with their ids. It is the only place cloud connection ids are listed.

Set the scope at mint (resource_scope on POST /agents), or change it later:

PUT /agents/{id}/resource-scope
{"vault_ids": ["<vault id>"], "connection_ids": ["<connection id>", "<cloud connection id>"]}

The body replaces the whole scope. Only the agent’s owner can change it; an org admin can still revoke any agent, but cannot change what another member’s agent reaches. Every id the edit adds must be one you can reach, or the request is refused with the ids it could not accept. Narrowing takes effect at once and needs nothing more. Widening — removing a restriction, or naming a connection under a vault restriction — needs the plan’s agent access and, for an agent holding vault.reveal or files.write, a fresh step-up, as minting it did. Each change is audited with the scope before and after, and any SSH session the agent holds open is closed so its next call runs under the new scope.

To choose between an assistant, a CI pipeline and an unattended server, and for the cron, Python and Node examples, see Integrate Kutrion with AI agents and pipelines.

Where the agent’s model runs

When you connect an agent you declare whether its model is hosted (Claude, Copilot, Cursor’s cloud models — your context leaves your network) or self-hosted on your network.

We ask rather than detect, deliberately. The only signal a connection carries is the client’s own self-reported name, which anything can set to anything; enforcing a security policy on that would look like protection without being it. A declaration is made by a person, recorded, and auditable.

By default any class is allowed — you chose the client, and it is already receiving your context. An organization that needs the restriction can turn on require agents to run on our own network, after which only self-hosted agents can be connected or used. Because an undeclared agent is treated as hosted, turning the policy on refuses anything that has not been explicitly vouched for rather than silently assuming it is safe. Agents already issued are suspended on their next call, not at the end of their lifetime.

kt mcp install --client claude-code --egress lan

What is protected

  • Secrets are stripped from output. Command output and file contents pass through the same redaction step as every other AI feature before they reach the model. Read what that step is worth from AI privacy model: it removes shaped secrets and PII, and it is not a transcript filter — the command text, hostnames and file contents themselves still reach whichever model you pointed the agent at.
  • Private addresses depend on where the agent runs. Public IPv4 addresses are always masked in agent output. Private and reserved addresses, such as 10.0.0.5 or 192.168.1.20, are shown in clear to an agent declared as on your network. A hosted agent sees them only when an organization owner turns on the setting for it, which is off by default and needs a fresh step-up verification to change. An agent that has not declared a network counts as hosted. An address that cannot be told apart from a public one, such as a run of dotted numbers that contains a public-shaped address, stays masked. An agent’s declared network cannot be verified, so treat this as policy, not proof.
  • Fetched content cannot pose as instructions. A file or a command’s output can contain text aimed at the model reading it — “ignore your previous instructions”, a forged role marker. Tool results are returned as fenced, marked-up-as-data spans with those markers stripped, so something the agent read cannot impersonate something you said.
  • Your file policy still applies. A brokered read by an agent is evaluated against the same data-loss policy as any other file access, and refused if the policy refuses it.
  • Arguments are screened. A model that has read a web page, a log line or a ticket can be steered into calling a tool with hostile arguments. Tool arguments cross the prompt-injection guard before any brokered action runs, and attempts to exfiltrate secrets are refused and recorded.
  • Arguments are validated, and tools say what they do. Every tool publishes a JSON Schema for its arguments and for its results, and the server validates arguments against it before anything runs — a malformed call comes back as something the model can correct rather than as a half-done action. Each tool also carries the protocol’s behavior hints, so a client can tell you that ssh_run changes things on a host before it runs, and can decline to treat vault_reveal as safe to approve on your behalf.
  • Tool calls are rate limited. Every agent principal has a floor on how many tool calls it can make per minute, so a model stuck in a retry loop cannot hammer a brokered host. Exceeding it answers 429 with a Retry-After; kt mcp status and GET /mcp/whoami report the limit in force.
  • An agent that misbehaves is suspended automatically. A budget stop (the agent hit its total call or returned-bytes cap), or the third blocked prompt-injection attempt within 15 minutes, suspends the agent: its access tokens are deleted, its open sessions are closed and every call it makes is refused. The agent’s owner gets an email naming the agent and the cause. Scope and tool-policy refusals do not suspend; a run of 20 within 15 minutes raises an alert only. The agent’s owner, or an organization owner or admin, can resume it from the Agents page (agent overflow menu, then Resume), so review what it did first. An agent that was exchanged through an OIDC trust is not suspended this way, because its trust would re-create it; the skip is recorded as an audit event instead.
  • Everything is audited. Every tool call is attributed to the agent principal, its owner, and the client it was minted for. You can answer “what did the AI do in our environment” with evidence.
  • On-LAN by default. If your organization runs a self-hosted model, terminal output never leaves your network — see AI privacy model.

Approve a reveal as it happens

Reveal is capped, approved and recorded.

  • Hourly cap. Each agent can reveal at most 120 secrets per hour, counted by the number of secrets a call releases, so one credential that holds many keys counts as many. A call over the cap is refused and nothing is revealed; the count is kept server-side, so a restart does not reset it, and if it cannot be read the reveal is refused. The owner can set a lower cap for one agent with resource_scope.reveal.per_hour; a cap above 120 is refused, and raising a lowered cap needs a fresh step-up.
  • Per-call approval. By default an organization requires a person to approve each reveal at the moment the agent asks for it, rather than deciding once when the agent is minted. The call comes back as a question rather than a secret: your MCP client shows an approval prompt naming the credential, and the reveal completes only after you accept. An organization admin can turn this default off in the organization’s agent settings, and an operator can force it on for a whole install with MCP_JIT_APPROVAL. If the setting cannot be read, the call is refused rather than allowed.
  • Audit record. Every reveal writes MCP_SECRET_REVEALED, naming the agent, the client, the credential, how many secrets were released, which reveal grant matched, and whether a person or policy approved it. A reveal the scope refuses is recorded as a blocked call with the reason.

Each approval covers exactly one call. It is bound to that agent, that credential and that request, expires in minutes, and is redeemed server-side so a captured approval cannot be replayed into a second reveal. A client that cannot show an approval prompt is refused rather than allowed through, so the control cannot be sidestepped by connecting a simpler client.

Agents created before the reveal scope

Agents whose scope was written before 2026-11-18 and that have no reveal list are grandfathered: they keep the reveal reach they had, and no wider. GET /agents flags them as reveal_not_narrowed. An agent in that state must name a reveal scope before it can be widened: set one with PUT /agents/{id}/resource-scope. Widening needs a fresh step-up, and a confirm or request path refuses it with reveal_widen_needs_owner. Narrowing needs no step-up, and an edit that omits reveal keeps the stored list, so a narrowed agent cannot fall back to the grandfathered reach. Every agent created from 2026-11-18 on is narrow-only.

An agent with no exec mode gets no session from ssh_session_open; it is refused before the connection is looked up.

Commands an agent sends through ssh_run, one-shot or in a session from ssh_session_open (an allowlist-mode agent gets no session on a host enrolled with a certificate, but does on a host that uses a stored password or key or one enrolled with a server-generated fallback key; see Command allowlist) are rated by the same classifier and risk score as your own kt exec. The score for a warn-level command uses your account’s recent activity: when it looks unusual, or cannot be checked because the check itself failed, the command counts as high risk. An account with too little history to compare against is scored normal, so an owner who works mostly through agents gets the “activity normal” row below. Where your own run would need a passkey step-up, the agent has no presence to prove, so it is refused unless a person approves it.

CommandYour kt execAgent, approval setting offAgent, approval setting on
Block-level, such as formatting a filesystemStep-upRefused, nothing runsWaits for a person
Writes a sensitive path, such as sudoers or authorized_keysStep-upRefused, nothing runsWaits for a person
Warn-level, such as sudo or a reboot, activity unusualStep-upRefused, nothing runsWaits for a person
Warn-level, activity normalRunsRuns, flagged on its audit recordWaits for a person
Any other commandRunsRunsRuns

The approval setting is “Make an AI agent ask a person first” in the organization settings, off by default. Every refusal is recorded. Ungated commands still run, so scope the agent’s hosts to what it needs.

Check and revoke

kt mcp status

Shows, for each client on this machine, whether it is wired up and the state of its own agent: live, expired or revoked, when it expires and which scopes it holds.

A bridge started with KT_MCP_CLIENT uses that client’s own agent, or the single shared agent that installs from before per-client agents stored. A bridge started without it uses a stored agent only when there is exactly one, counting that shared agent: with none it has nothing to use, and with more than one it refuses and asks you to set KT_MCP_CLIENT or re-run kt mcp install --client <id>, rather than acting as whichever client it found first.

kt mcp uninstall --client claude-code

Revokes the agent principal, removes our entry from the client config — leaving any other MCP servers you have configured untouched — and clears the stored credential. Revocation takes effect on the agent’s next call, not when its TTL expires.

Each client holds its own credential, so uninstalling one leaves the others working. Omit --client to remove every client at once. Re-running install for a client you already set up replaces it: the new principal is minted and the old one revoked, rather than both staying live.

You can also revoke from the web console at any time, including agents belonging to other members of your organization if you are an org admin. An expired or revoked principal stops authenticating immediately; so does one whose owner is deactivated or moved out of the organization.

Unattended workloads and n8n

A workflow engine such as n8n has no human to click through a consent screen. For that case an organization user mints a workload principal that holds a client secret, and the engine exchanges the secret for short-lived access tokens at the token endpoint. A workload that reaches hosts and is minted by a member needs an owner’s or admin’s decision (see “If you are a member”).

Create the workload principal

Workloads are created with kt agent mint --workload client_secret --scope-vault <vault> or through the API. The web console also creates client-secret workloads; static workloads are created from the CLI only. The request needs a signed-in session that has passed a step-up (passkey or authenticator app), whatever scopes you ask for.

POST /agents
{
  "name": "n8n production",
  "purpose": "Nightly credential health workflow",
  "kind": "workload",
  "token_endpoint_auth_method": "client_secret",
  "scopes": ["vault.list", "vault.use"],
  "resource_scope": {
    "vault_ids": ["<vault id>"],
    "connection_ids": ["<connection id>"]
  },
  "ttl_minutes": 129600
}

What the server requires of a workload:

  • resource_scope.vault_ids must name at least one vault. A workload with an ssh.* or files.* scope must also name its connections in resource_scope.connection_ids. Unlike an interactive agent, an empty list does not mean everything.
  • A workload that holds ssh.exec must send exec_mode: unrestricted, a full shell as the connection’s account on every listed host, or allowlist, the exact commands ssh_run may run on each connection (see Command allowlist). Either way, prefer a dedicated, low-privilege target account for the connection, so what the workflow can do on the host is bounded by that account and not by your own.
  • ttl_minutes is the workload’s confirmed lifetime. When omitted it is the 90-day maximum. At the end of that lifetime the principal stops authenticating and must be re-confirmed by its owner.
  • token_endpoint_auth_method is required for a workload. static and client_secret are accepted; private_key_jwt is refused as not available yet.

The response carries client_id (the principal’s id) and client_secret (a vtcs_ value). The secret is shown once, in this response and again only in a rotate response. Kutrion stores a hash, so a lost secret cannot be shown again; rotate it instead.

Command allowlist

In allowlist mode the owner lists, per connection, the exact command strings ssh_run may run:

"exec_mode": "allowlist",
"exec_allowlist": {
  "<connection id>": ["systemctl status nginx", "df -h /var"]
}

What the allowlist does, and what it does not:

  • It bounds which commands ssh_run runs. It is not containment: an allowed command does whatever it does on the host, with the target account’s rights. The target account is what contains the effect.
  • It does not bound the agent’s other tools. files.read and ssh_session_open, where the agent holds them, are governed by their own scopes and the resource scope, except that ssh_session_open is refused on a certificate-enrolled host (below).
  • A command runs only when it is byte-for-byte equal to an entry for that connection. No trimming, case folding or argument matching. Anything else is refused before the host is looked up and before any credential is decrypted, and is audited as MCP_TOOL_BLOCKED with refusal: not_allowlisted. The refusal lists that connection’s entries back to the agent.
  • The policy is read on every call, so a change applies to the next call, open sessions included.

Rules for entries, checked on every write:

  • 1 to 512 characters of letters, digits, space and . _ / : = , @ % + -, with no leading or trailing space. Shell metacharacters, quotes, control characters and non-ASCII characters are refused.
  • At most 64 entries per connection, 256 in all and 16,000 characters in all. No duplicates.
  • Every connection must be named in resource_scope.connection_ids, which must not be empty.
  • An entry that looks like it carries a password or token is refused (exec_allowlist_secret_like). Keep secrets in the vault.
  • files.write cannot be combined with an allowlist, since it could rewrite what an allowed command runs.
  • An entry rated block-level, or one that writes a sensitive path, must also be named in exec_allowlist_acknowledged as {"connection_id": "...", "command": "..."}. Otherwise the write is refused with exec_allowlist_needs_acknowledgement, listing the entries. At call time such an entry is not refused for its rating, but if the organization or the deployment requires a person to approve agent commands, it still waits for that approval.

Changing an allowlist:

  • Narrowing (removing entries or connections, or moving an unrestricted agent to an allowlist of commands that are all rated ok): PUT /agents/{id}/exec-policy, or PUT /agents/oidc/trusts/{id}/exec-policy for a trust, with exec_mode and the full new exec_allowlist. The owner or any organization admin may narrow, with no step-up. Anything wider is refused with 403 exec_policy_widening, naming the entries.
  • Widening (adding an entry or a connection, or moving to unrestricted): the owner sends the new allowlist to POST /agents/{id}/reattest (or the trust’s reattest) with a fresh step-up. This re-confirms the agent, so its confirmation clock restarts and a workload’s lifetime runs again from now.
  • Removing a connection from the resource scope also removes its allowlist entries.
  • PATCH /agents/{id} refuses exec_mode and exec_allowlist.

The allowlist is enforced by the Kutrion server, in code, for one-shot ssh_run calls, and in sessions from ssh_session_open on hosts that use a stored password or key and on hosts enrolled with a server-generated fallback key. A host enrolled with a certificate takes one-shot calls only: ssh_session_open is refused and audited as MCP_TOOL_BLOCKED with refusal: session_not_forceable_in_allowlist_mode, each allowed command runs as its own connection with the command pinned in its certificate, and a session opened before the agent moved to allowlist mode is closed on its next ssh_run. The shell and exec purposes of an enrolled host are also kept apart in code, not by the host: both log in as the same account, so an exec login that runs a shell program gets a shell without a terminal.

A least-privilege connection for agents

ssh_run runs commands as the account the connection logs in as, and the command checks refuse common destructive forms, not every way to write them. What an agent can do on a host is therefore bounded by that account. When the agent’s connection logs in as root, kt agent mint, kt mcp install and kt trust add warn that the agent has root on that host. A non-root account with sudo is still privileged; use an account with no sudo for agent access. The host does not enforce the shell and exec split either; see Known limitations.

A host has one live enrollment per connection, so a separate account for agents is a separate connection:

  1. On the host, create an account with only the rights the agent needs: not root, no passwordless sudo, and write access only where the agent’s commands must write.
  2. Put that account’s key or password in the vault.
  3. Add a second connection to the same host with that account: kt conn add --name <name> --host <host> --username <account> --cred <credId>.
  4. If the first connection is enrolled, enroll the new one too: kt enroll <new connection id> --purposes exec.
  5. Mint the agent, or register the trust, with only the new connection in its resource scope (--scope-conn for kt agent mint, --connection for kt mcp install and kt trust add).

People keep using the first connection; the agent never reaches it.

Configure n8n

Create an OAuth2 API credential in n8n with these values:

n8n fieldValue
Grant TypeClient Credentials
Access Token URLhttps://your-kutrion-host/mcp/oauth/token (the token_endpoint in the authorization-server metadata)
Client IDThe client_id from the mint response
Client SecretThe client_secret from the mint response
ScopeLeave empty. A scope value is accepted and ignored; the token carries the principal’s scopes
AuthenticationSend as Basic Auth header (client_secret_basic) or in the request body (client_secret_post)

Use your own host in place of your-kutrion-host. Present the secret one way per request: sending Basic credentials and a client_secret in the body together is refused. A resource parameter, if the client sends one, must name the /mcp endpoint of the same host. Requests may be JSON or form encoded.

The token endpoint answers with access_token, token_type: "Bearer", expires_in and scope. There is no refresh token. n8n calls POST /mcp with Authorization: Bearer <access_token>.

Token lifetime

An access token lasts 15 minutes, or less if the principal’s lifetime ends sooner. When it lapses the /mcp endpoint answers 401 with a WWW-Authenticate challenge and the client requests a new one with the same client id and secret. A principal keeps at most its four newest live access tokens. Each issue is audited as AGENT_TOKEN_ISSUED, and tool calls made with a token carry that token’s id in the audit trail.

Rotate the secret

POST /agents/{id}/rotate

Rotating needs a fresh step-up, returns a new client_id and client_secret, and replaces the old secret at once. Every access token the principal holds is deleted in the same operation, so a workflow using one gets 401 on its next call and must fetch a new token with the new secret. The request’s ttl_minutes is ignored for a client-secret workload and its confirmed lifetime is not extended. Revoking the principal also deletes its access tokens. Update the secret in n8n before the next run.

Common refusals

ResponseMeaning
401 invalid_client with error_description: "client authentication failed"One answer for several causes, kept uniform on purpose: no credentials, a malformed Basic header, unknown client id, wrong secret, a principal that is not a client-secret workload, a revoked or expired principal, or an organization-state check that now fails (Private vault mode, the plan no longer includes agent access, the owner is deactivated or expired, or the organization’s agent network policy). The audit trail records which one.
400 invalid_requestThe secret was presented twice (header and body), the body client_id differs from the Basic one, or the request was malformed.
400 invalid_targetresource names something other than this host’s /mcp endpoint.
429 temporarily_unavailableMore than 30 client-credentials requests per minute from one source network. Honour Retry-After. Cache the token for its 15 minutes rather than requesting one per call.
503 temporarily_unavailableThe organization’s agent policy could not be read. Retry shortly.
403 step_up_required on mint or rotateVerify a passkey or authenticator app, then repeat the request.
400 workload_vault_scope_required, workload_connection_scope_requiredThe mint named no vault, or an ssh.* or files.* scope with no connections.
400 exec_mode_requiredssh.exec was requested without a mode.
400 exec_allowlist_*The allowlist was refused; the error names the rule. See Command allowlist.
400 auth_method_unavailableprivate_key_jwt was requested.

A refused token request is recorded once per client, source network and cause in each 15-minute window as AGENT_TOKEN_REFUSED, so a retry loop does not flood the audit trail. If the cause is not obvious from the response, ask an organization admin to read that record.

Plan limits

Agent access is available on every plan, with a limit on how many agents can be live at once. The count is of live principals, so revoking one or letting it expire frees the slot immediately. See Billing and plans.

Protocol notes

Kutrion implements MCP revision 2026-07-28 and also answers the older handshake-based revisions, so clients that have not yet updated keep working. The server is reachable two ways:

  • stdio — kt mcp, which is what kt mcp install configures. The CLI bridges your local client to the server; the broker itself always runs server-side.
  • Streamable HTTP — POST /mcp on your Kutrion host, for a client that can hold a bearer credential directly.

Both authenticate with an agent principal. A normal user session token is refused on both.

Ways a caller authenticates

Every way in ends as an agent principal presenting a bearer credential to /mcp. They differ in who obtains the credential and how long it lives. The table runs from the path to prefer to the path to use last: a CI pipeline should hold no long-lived Kutrion credential at all, an unattended server should hold a client secret that only buys short-lived tokens, and a static token, which is a long-lived bearer credential, comes last. The web console labels it “Static token (weaker)”.

PathWho it is forWhat the caller holdsWhere the credential comes from
OIDC trust exchangeA CI pipeline, for example GitLab CIA short-lived vta_ agent tokenkt ci-login trades the pipeline’s OIDC token; see CI pipelines without secrets
Client-credentials workloadAn unattended server that fetches its own tokens, such as n8nA vtcs_ client secret, exchanged for a 15-minute vta_ access tokenPOST /agents with token_endpoint_auth_method: "client_secret", then grant_type=client_credentials
kt mcp installA person’s desktop AI clientA vta_ agent token in the OS keychainMinted for you by the CLI
OAuth 2.1 authorization code with PKCEA person authorizing an MCP clientA vta_ agent token/mcp/oauth/token, after a signed-in owner approves
Static workload (weaker)An unattended server that cannot use the paths aboveA long-lived vta_ agent tokenPOST /agents with kind: "workload" and token_endpoint_auth_method: "static"

The authorization-server metadata lists authorization_code and client_credentials under grant_types_supported, and none, client_secret_basic and client_secret_post under token_endpoint_auth_methods_supported. Clients registered through the registration endpoint or a Client ID Metadata Document still get authorization_code only; client_credentials is for workload principals minted as above.

Authorization discovery

POST /mcp publishes OAuth 2.0 Protected Resource Metadata (RFC 9728) at /.well-known/oauth-protected-resource and /.well-known/oauth-protected-resource/mcp, so a standards-compliant MCP client can discover what this resource is and which scopes an operation needs instead of being wired to a credential by hand. Unauthenticated calls answer 401 with a WWW-Authenticate challenge carrying resource_metadata and a baseline scope; a call the agent’s scopes do not cover answers 403 with error="insufficient_scope" and every scope that would satisfy it, in one challenge.

Kutrion names itself as the authorization server in that document — it mints the credential and owns the consent surface.

Authorizing a client over OAuth 2.1

The endpoints behind that name are live. Authorization-server metadata (RFC 8414) is published at /.well-known/oauth-authorization-server and /.well-known/oauth-authorization-server/mcp, naming:

  • authorization_endpoint — /mcp/oauth/authorize
  • token_endpoint — /mcp/oauth/token

The flow is authorization code with PKCE, which OAuth 2.1 makes mandatory. S256 is the only challenge method; plain is not accepted. Your client must also send the RFC 8707 resource parameter naming the MCP endpoint it wants a token for — a token issued here is audience-bound to that resource and will not be accepted anywhere else. Authorization responses carry iss (RFC 9207) so your client can detect a response injected by a different server.

Registration is by Client ID Metadata Document, and that is the preferred path. Your client_id is an https URL that serves a JSON document declaring that same client_id and your redirect_uris; Kutrion fetches it and that is the registration. There is no client secret. Redirect URIs are matched as exact strings — a trailing slash or an added query parameter is a different URI — with one exception: a native client may register a loopback redirect (127.0.0.1, [::1] or the name localhost) and the port it actually listens on is allowed to float, since an ephemeral callback port cannot be known when the document is written.

Dynamic Client Registration is offered too, but it is not open. POST /mcp/oauth/register requires an existing authenticated Kutrion session, which is what registration_endpoint_auth_methods_supported: ["bearer"] in the authorization-server document tells you. Present your Kutrion access token on the x-kutrion-registration-token header:

POST /mcp/oauth/register
x-kutrion-registration-token: <your Kutrion access token>
Content-Type: application/json

{"client_name": "my agent", "redirect_uris": ["http://127.0.0.1:6191/oauth/callback"]}

Authorization: Bearer is accepted for the same purpose and is what RFC 7591 §3.1 names, but the dedicated header exists because several clients merge their configured Authorization value into every request they make — including the calls to /mcp itself, where an agent principal is required and a user token is refused. x-kutrion-registration-token is inert everywhere else, so it cannot have that effect.

Posting there without one returns 401 with error: "invalid_token", a description naming the header, and a WWW-Authenticate challenge. A client built on the MCP SDK’s defaults registers anonymously and will stop there — the SDK takes the metadata-document route only when the application sets clientMetadataUrl, and few do — so the Client ID Metadata Document path above, which needs no registration call at all, is the one to reach for. What registration mints is scoped to the principal that registered it and ends when that session’s token is signed out. Anonymous RFC 7591 registration is deliberately not offered — it would leave an attacker-writable table behind an unauthenticated endpoint on a credential broker.

Any request to /mcp without a credential answers 401 with a WWW-Authenticate challenge naming the protected-resource document and the baseline scopes, whatever method you used. GET and DELETE answer 405 once you are authenticated — there is no standalone SSE stream and no protocol-level session — but an unauthenticated probe is told how to authorize instead.

What a client receives is an agent principal — the same vta_ credential kt mcp install provisions, with the same TTL, the same revocation and the same per-call enforcement. OAuth is a second way for a human to consent to one, not a second kind of identity.

The elevated scopes are not available over OAuth. vault.reveal, files.write and vault.inject are absent from scopes_supported and are refused at the authorization endpoint. ssh.exec is offered to owners and admins, and approving it on the consent screen asks for a passkey or authenticator code first. Members are not offered it (see “If you are a member” above). Granting an agent the ability to read plaintext or write files requires a fresh step-up by the owner on the agent page, which a browser redirect cannot carry. An org that requires its agents to run on its own network also cannot authorize an external OAuth client, since we cannot attest where that client’s model runs.

Approving a client needs a signed-in owner. /mcp/oauth/authorize validates the request and redirects to the approval screen in the web app, which asks a human to confirm the client, the scopes and the redirect URI before any credential is minted. That screen only mints a code for someone already signed in to Kutrion, so a flow driven from a machine with no browser and no session stops there by design rather than by omission.