Guide/governance3 min read

Delegated, Revocable Access with Per-User MCP Sessions

Per-user MCP sessions give AI agents delegated, revocable access — short-lived, kit-scoped credentials instead of your workspace key. Here's the pattern.

Read the docs →

/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
Guide/governance
TL;DR
  • Delegated access for AI agents means handing a short-lived scoped credential not your long-lived workspace key.
  • Naïve MCP sessions are scoped to one tenant user, filtered by their Account Kit, TTL-limited, and instantly revocable.
  • Default TTL is 15 minutes; maximum 24 hours (per published docs).
  • The token travels in the Authorization header never in the URL.
  • Revoke a session and the MCP connection is rejected immediately.
  • Use sessions for untrusted runtimes; keep the workspace key on your server.

Delegated access for an AI agent means the runtime gets a scoped, time-limited credential — not your workspace API key. Naïve mints this as an MCP session: a bearer token and URL bound to one tenant user, filtered by their Account Kit, with a TTL you control and instant revoke. Every call still routes through the governance gateway — caps, approvals, audit unchanged.

This is the pattern MCP clients (Claude Desktop, Cursor, custom agents) need when you can't trust the runtime with long-lived secrets.

Why long-lived keys fail for agents

Your workspace key (nv_sk_…) is root access. Hand it to an agent loop, an MCP client, or a customer's hosted runtime and you inherit every failure mode at once: prompt injection exfiltration, log leakage, a bug that scopes the wrong tenant, no way to cut off one customer without rotating for everyone.

Sessions invert the model: mint the minimum credential for the minimum time, for one user, revocable without collateral damage.

How a session is created

const session = await naive.forUser(alice.id).sessions.create({
  ttlMs: 15 * 60 * 1000,
});
 
// Hand to your MCP client:
// session.mcp.url + session.mcp.headers

The response includes an MCP SSE URL and an Authorization: Bearer nv_sess_… header. The token never appears in the URL — only in headers — so proxies and access logs don't capture it.

A Naïve MCP session (sessions.create) has a default TTL of 15 minutes and a maximum of 24 hours, is scoped to one tenant user, and is instantly revocable (per published docs).

What the session can do

The session's tool list is the fused native + third-party toolset for that user, filtered by their Account Kit. If the kit disables cards, the session can't reach cards — regardless of what the model asks for. AI agent permissions explains kit enforcement.

Multi-tenant primitives (connections, vault, logs) default to the session's tenant user, so a session minted for Alice cannot list Bob's vault entries.

How revoke works

await naive.forUser(alice.id).sessions.revoke(session.id);

Revoke is immediate — the MCP connection is rejected on the next request. Use this when:

  • A customer's contract ends mid-session.
  • You detect anomalous tool-call patterns.
  • A runtime you don't control should lose access now, not in 14 minutes when TTL expires.

For revoking the entire agent profile (not just one session), see how to revoke an AI agent's access instantly.

Sessions vs agent profiles

MCP sessionAgent profile
ScopeOne tenant user's tools for MCPFull bundle: identity, money, comms, runtime
CredentialShort-lived nv_sess_…Per-profile scoped key + tools
Revokesessions.revoke — one sessionagentProfile.revoke — entire profile
Typical useHand to MCP client / BYO runtimeProvision once, use tools anywhere

In multi-tenant SaaS, you mint a session per customer runtime, not one session for the whole app.

BYO runtime + sessions

The lead adoption path: keep your LangGraph / Eve / custom loop, inject governed tools from the agent profile, authenticate the MCP connection with a session instead of the workspace key:

const op = await naive.forUser(tenant.id).provision("support", { idempotencyKey: `op:${tenant.id}` });
const session = await naive.forUser(tenant.id).sessions.create({ ttlMs: 900000 });
// Point MCP client at session.mcp — tools are governed; key is not exposed

Hosted vs bring-your-own runtime compares where the loop runs; governance is identical either way.

Where to start

Pick one untrusted runtime — a local MCP client, a customer's cloud worker — and replace the workspace key with a session. Set a 15-minute TTL, wire revoke into your offboarding flow, and confirm the Account Kit filters the tool list. The sessions docs are the source of truth.

Frequently Asked Questions
What is delegated access for AI agents?+
It's giving an agent or runtime a credential scoped to what it needs — one tenant user, specific tools, a time limit — instead of your master API key. On Naïve, sessions.create mints an MCP URL plus a bearer token (nv_sess_…) that expires and can be revoked at any time, with tools filtered by the user's Account Kit.
How long do Naïve MCP sessions last?+
Default TTL is 15 minutes; maximum 24 hours (per published docs). Set ttl_ms when creating the session. When it expires, the connection is rejected — no cleanup job required.
Can I revoke an MCP session instantly?+
Yes. sessions.revoke invalidates the session immediately — the MCP client receives rejected connections on the next call. This is faster than rotating your workspace key and doesn't affect other tenants or sessions.
Why not give the agent my workspace API key?+
A workspace key grants access across your account. Leaked into a prompt, log, or compromised runtime, it exposes every tenant and primitive. A session is scoped to one user, limited in time, revocable in one call, and filtered by Account Kit policy.
How do MCP sessions relate to the governance gateway?+
Every tool call over an MCP session still routes through the governance gateway — spend caps, approvals, audit, and revoke on the agent profile apply identically. The session is how the runtime authenticates; the gateway is how actions are governed.
What tools does a session expose?+
The fused native + third-party toolset for that tenant user, filtered by their Account Kit. Multi-tenant tools (connections, vault, logs) default to that user; execution stays gated by kit policy.
NT
Naïve Team

Building the agent-native backend.

Keep reading