Agent Memory
Platform

Authentication

Workspace API keys, the built-in OAuth 2.1 server for MCP clients, and how credentials carry capabilities and agent bindings.

Agent Memory accepts two kinds of bearer credentials on the data plane (/v1) and the MCP endpoints:

CredentialWho uses itScope
Workspace API key (amk_…)Servers, SDKs, CI jobs, header-based MCP clientsExactly one workspace (optionally one application)
OAuth access tokenMCP clients that sign in (Claude Desktop, Claude Code, VS Code), people using their own accountThe workspaces the signed-in user has grants on

Both are sent the same way:

Authorization: Bearer <credential>

Requests without a valid credential get 401. A valid credential without the required capability gets 403; a workspace it doesn't hold gets 404.

API keys

Creating a key

In the web console, open API Keys → Create API Key and choose:

  • the project (workspace) and, optionally, an application — an application-scoped key always targets that application plus the workspace-wide pool, and requests cannot override it;
  • the capabilities (below);
  • the agents the key may act as — the first is the key's default agent;
  • whether the key may act for users (name end users with userId);
  • an optional expiry.

The key is shown once. Only its SHA-256 hash and a short display prefix (amk_ plus 8 characters) are stored, so a database leak never yields usable keys. Programmatic minting is available through the provisioning API, and self-hosted operators can mint the first key from the command line with --bootstrap-key (see Deployment).

Capabilities

CapabilityOAuth scope equivalentDefault
readmemory:readon
writememory:writeon
feedbackmemory:feedbackon
curatememory:curateon
deletememory:deleteoff
sharememory:shareoff
promotememory:promoteoff

Each endpoint's required capability is listed in the API reference. Grant the minimum: a recall-only service needs only read.

Agent binding

Every key is bound to the agent IDs chosen at creation. Requests that omit agentId act as the default agent; naming an unbound agent is refused with 403 policy_denied. A key created with no agent IDs acts only as itself. See Identity and visibility.

Revocation and expiry

Revoking a key (console, or DELETE /api/control/keys/{keyId}) takes effect on the next request on every API replica — key lookups are cached in a shared cache that revocation invalidates. Expired keys stop authenticating automatically.

OAuth for MCP clients

When a deployment enables its built-in OAuth 2.1 authorization server, MCP clients can connect with nothing but a URL:

  1. The client calls the MCP endpoint without a token and receives 401 with a WWW-Authenticate header pointing at the protected-resource metadata (/.well-known/oauth-protected-resource, RFC 9728).
  2. The metadata names the authorization server; the client discovers it (/.well-known/oauth-authorization-server or /.well-known/openid-configuration) and registers itself dynamically (/connect/register).
  3. A browser window opens, the user signs in with their Agent Memory account, and the client receives tokens through the authorization-code flow (/connect/authorize, /connect/token).
DetailValue
FlowsAuthorization code, refresh token
Scopesopenid, email, profile, offline_access, memory
Access token lifetime60 minutes (default)
Refresh token lifetime14 days, rolling — each refresh issues a new refresh token and invalidates the old one
Revocation/connect/revocation (RFC 7009)

Signing in never creates an account: a person without an Agent Memory account is told to finish sign-up in the console first. The token resolves to the person's console account and the workspaces they have grants on. Self-hosted operators configure the server with the OAuth:* keys — see Configuration.

External identity providers

A deployment can instead validate tokens from an external OpenID Connect provider (Auth:Authority). Users and service principals from that provider are mapped to provisioned Agent Memory principals and their workspace grants; a token from an unknown principal is refused. In that mode the MCP metadata advertises the memory:* scopes listed above.

Console sign-in

The web console (/app/) supports sign-in with Google, Microsoft (OpenID Connect) and one-time email codes, depending on what the deployment configures. Organizations can require MFA-verified sign-ins for console access with the tenant setting security.requireMfa. Console sessions are separate from API credentials: agents always use keys or OAuth tokens.

Choosing a credential

SituationUse
A backend service or batch jobAn API key bound to that service's agent ID, with only the capabilities it needs.
A backend serving many end usersAn API key with act for users, passing userId per request.
A developer's MCP clientOAuth sign-in if the deployment supports it, otherwise a personal API key.
Several apps sharing one workspaceOne application-scoped key per app.
Agents that must never see each other's memorySeparate workspaces (and keys), or private visibility.

On this page