Skip to main content

Authentication

SharedMemory uses two authentication methods depending on the context.

Agent API Keys (for programmatic access)​

All SDK, CLI, MCP, and direct API calls authenticate using Bearer tokens.

Authorization: Bearer sm_agent_abc123...

Getting an API key​

  1. Sign in to the dashboard
  2. Go to Settings → Agents
  3. Click Register Agent — provide a name and optional description
  4. Copy the API key (sm_agent_...)
warning

API keys are shown once at creation time. Store it securely. If lost, delete the agent and create a new one.

Key format​

PrefixPurpose
sm_live_User API key (browser extension, session)
sm_agent_Agent API key
sm_proj_rw_Project-scoped read/write key
sm_proj_r_Project-scoped read-only key
sm_org_rw_Org-scoped read/write key
sm_org_r_Org-scoped read-only key

Keys are hashed (SHA-256) before storage. SharedMemory never stores raw API keys.

Agent-volume permissions​

An agent must be connected to a volume before it can read or write:

POST /agent/connect
{
"agent_id": "agent-uuid",
"volume_id": "volume-uuid",
"permissions": ["read", "write"]
}

Session Authentication (for dashboard)​

The web dashboard uses session cookies with Passport.js:

  • Email/Password — Standard local auth with bcrypt hashing
  • Google OAuth — One-click sign-in via Google

Rate Limits​

EndpointLimitWindow
POST /agent/memory/write30 requests1 minute
POST /agent/memory/query60 requests1 minute
POST /agent/documents/upload50 requests1 hour
Auth endpoints (/login, /signup)20 requests15 minutes

Rate limit headers are included in responses: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.

Error Responses​

StatusErrorMeaning
401unauthorizedMissing or invalid API key
403agent_not_authorized_for_volumeAgent not connected to this volume
429rate_limitedToo many requests