Auth Mode (Multi-User)
Deploy Gamut as a multi-user instance for teams. Users sign in with email/password or OIDC, and per-agent roles control who can view, use, or manage each agent.
When to choose this option
- Multiple people share one Gamut instance.
- Per-user accounts and audit trails are required.
- Gamut runs as shared team infrastructure.
For single-user deployments without authentication, see Single-User Docker.
Published image
Auth mode needs a dedicated image: the sign-in screen is built into the app at build time. The -auth images have it built in and set AUTH_MODE=true for you. You only set AUTH_MODE yourself when building from source (AUTH_MODE=true docker compose build).
ghcr.io/skillfulagents/superagent:main-auth
The -auth suffix is the key difference from the single-user image:
| Tag | Description |
|---|---|
main-auth | Latest build from the main branch with auth enabled. |
X.Y.Z-auth (e.g. 0.7.0-auth) | Pinned release version with auth. |
X.Y-auth (e.g. 0.7-auth) | Latest patch in that line with auth. |
Quick start
Create a .env file:
BETTER_AUTH_SECRET=your-random-secret-at-least-32-characters
# Optional: read only on the first start. Otherwise connect a model provider in Settings → Model Providers.
ANTHROPIC_API_KEY=sk-ant-...The same prerequisites apply as for single-user Docker: a Linux server with Docker Engine. Docker Desktop isn't supported.
Create a docker-compose.yml:
services:
superagent:
image: ghcr.io/skillfulagents/superagent:main-auth
restart: unless-stopped
network_mode: host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${HOME}/.superagent:${HOME}/.superagent
environment:
- SUPERAGENT_DATA_DIR=${HOME}/.superagent
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
- PORT=47891
- AUTH_MODE=true
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}
- TRUSTED_ORIGINS=${TRUSTED_ORIGINS:-}Start the container:
docker compose up -dOpen http://localhost:47891 in a browser and sign up. The first account created becomes the admin.
Environment variables
In addition to the standard environment variables, auth mode uses:
| Variable | Required | Default | Description |
|---|---|---|---|
AUTH_MODE | No | true in -auth images | Turns on authentication. Already set by the -auth images. A single-user image can't be switched to auth mode with this variable. |
BETTER_AUTH_SECRET | Recommended | Auto-generated | Secret key for signing session tokens. If unset, a random secret is generated and stored in the database. Set it explicitly for reproducible deployments or multiple replicas. Keep it stable: changing it signs everyone out. |
TRUSTED_ORIGINS | Conditional | None | Comma-separated list of the addresses users reach Gamut at (e.g. https://gamut.example.com). The first one is used as the app's public address for sign-in redirects and OIDC callbacks. Set it behind a reverse proxy or on a custom domain. When unset, Gamut only accepts its own address and uses the address of each request. Admins can also set this in Settings → Auth → Trusted origins; the environment variable wins. |
AUTH_PROVIDERS_JSON | No | None | JSON array configuring OIDC providers. See OIDC / social login. |
Authentication methods
Email and password
Email/password authentication is enabled by default. Users create an account with an email address and a password that meets the password policy.
OIDC / social login
Gamut supports any OpenID Connect (OIDC) identity provider: Google Workspace, Microsoft Entra ID, Okta, Auth0, Keycloak, and others. Providers are configured through the AUTH_PROVIDERS_JSON environment variable.
AUTH_PROVIDERS_JSON='[
{
"id": "google",
"type": "oidc",
"displayName": "Google",
"discoveryUrl": "https://accounts.google.com/.well-known/openid-configuration",
"clientId": "your-client-id.apps.googleusercontent.com",
"clientSecret": "your-client-secret",
"scopes": ["openid", "email", "profile"]
}
]'Each provider entry supports:
| Field | Required | Description |
|---|---|---|
id | Yes | Unique identifier for this provider. |
type | Yes | Must be oidc. |
displayName | No | Label shown on the login button. Defaults to id. |
discoveryUrl | Conditional | OIDC discovery endpoint URL. Required if issuer is not set. |
issuer | Conditional | Token issuer URL. Required if discoveryUrl is not set. |
clientId | Yes | OAuth client ID from your identity provider. |
clientSecret | No | OAuth client secret. Not required for PKCE-only flows. |
scopes | No | OAuth scopes to request. Defaults to the provider's standard scopes. |
icon | No | URL or path to a custom icon for the login button. |
enabled | No | Set to false to disable without removing the configuration. Defaults to true. |
All OIDC flows use PKCE (Proof Key for Code Exchange). Multiple providers can be configured; each appears as a separate button on the login screen.
First user becomes admin
The first person to sign up on a fresh instance becomes an admin, and skips admin approval. No special setup is needed. Because sign-up is invitation-only by default, open http://your-server:47891 and create the admin account before sharing the address.
Role-based access control
Auth mode has two layers of roles: app-level roles for global permissions and agent-level roles for access to individual agents.
App-level roles
| Role | Capabilities |
|---|---|
| Admin | Full access to everything. Can manage users (ban, unban, promote, set passwords). Can access all agents regardless of agent-level roles. Can configure auth settings, signup modes, and password policies. |
| Member | Can access only agents they have been explicitly granted a role on. Cannot manage other users or global settings. |
Agent-level roles
Each agent has its own access control list (ACL). Users are granted one of three roles per agent:
| Role | Capabilities |
|---|---|
| Owner | Full control over the agent. Can modify its configuration, manage its ACL (grant or revoke access for other users), and delete it. |
| User | Can interact with the agent: send messages, view sessions, trigger tasks. Cannot modify settings or manage the ACL. |
| Viewer | Read-only access. Can view sessions and history but cannot send messages or trigger actions. |
Each role includes everything the roles below it can do: an owner can do everything a user can, and a user everything a viewer can.
When a user creates an agent, they are automatically assigned the owner role on it.
Signup and access control
Admins configure how new users join in Settings → Auth:
| Signup mode | Behavior |
|---|---|
| Invitation only (default) | Only admins can create new accounts. The sign-up page is disabled. |
| Open | Anyone can create an account by visiting the sign-up page. |
| Domain restricted | Only email addresses from specified domains (e.g., yourcompany.com) can sign up. |
| Closed | No new signups of any kind. |
Admin approval
Admin approval is on by default. New accounts (other than the first) are held as "Pending admin approval" and can't sign in until an admin approves them in the user list. Combined with open or domain-restricted signup, this gives admins a review step before granting access. Turn it off in Settings → Auth.
Default role for new users
New accounts get the Member role by default. Admins can change this to Admin in Settings → Auth. That makes every new account an admin, so only use it with a closed or tightly restricted signup mode.
Disabling auth methods
In Settings → Auth → Authentication methods, admins can independently enable or disable:
- Email/password authentication: disable to force OIDC-only login.
- Social/OIDC authentication: disable to force email/password-only login.
Password policy
The default policy requires:
- Minimum 12 characters (configurable).
- Maximum 128 characters (configurable).
- At least one uppercase letter, one lowercase letter, one number, and one symbol (complexity requirement, can be disabled).
The policy is enforced on both sign-up and password change. Admins can change it in Settings → Auth.
Session management
| Setting | Default | Description |
|---|---|---|
| Session lifetime | 24 hours | Maximum session duration before forced re-authentication. |
| Idle timeout | 60 minutes | Session expires after this period of inactivity. |
| Max concurrent sessions | 5 | Oldest session is revoked when the limit is exceeded. |
All three are adjustable in Settings → Auth.
Account lockout
After 10 consecutive failed login attempts (configurable), the account locks for 30 minutes (configurable). The lockout is per-email and resets on successful login.
User management
Admins manage users through the admin panel in the UI:
- View all users: email, role, status, and creation date.
- Ban / unban: prevent a user from logging in.
- Promote / demote: change a user's app-level role between admin and user.
- Set password: force a reset; the user must change their password on next login.
- Approve pending users: when admin approval is required, approve or reject new signups.
Data directory considerations
Auth mode can only be enabled on a fresh data directory or one that already has auth tables. Startup validation rejects an existing single-user data directory that contains agents, preventing orphaned agent data that no user owns. When migrating from single-user to auth mode, start with a clean data directory.
Docker Compose example
A complete production-ready docker-compose.yml with auth mode, OIDC, and trusted origins:
services:
superagent:
image: ghcr.io/skillfulagents/superagent:main-auth
restart: unless-stopped
network_mode: host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /data/superagent:/data/superagent
environment:
- SUPERAGENT_DATA_DIR=/data/superagent
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
- PORT=47891
- AUTH_MODE=true
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}
- TRUSTED_ORIGINS=https://superagent.example.com
- AUTH_PROVIDERS_JSON=${AUTH_PROVIDERS_JSON:-}
- SUPERAGENT_VAULT_KEY_FILE=/run/secrets/vault_key
secrets:
- vault_key
secrets:
vault_key:
file: ./vault-key.txtThe vault key encrypts saved website logins. Keeping it outside the data directory means a database backup alone can't unlock them. Create the key file with openssl rand -base64 32 > vault-key.txt. On an existing install, copy .vault-key from the data directory instead, because a different key is rejected at startup. See Back up and restore.
Limitations
- Auth mode does not apply to the desktop app. It runs in web/container deployments (Docker, Kubernetes) only. If
AUTH_MODE=trueis set for the desktop app, it is ignored with a warning. - OIDC providers are configured at deployment time. Provider credentials are passed through environment variables, not the admin UI, keeping secrets out of the application database.
Next steps
- Single-User Docker: Simpler deployment without authentication.
- Desktop App: Run Gamut as a native desktop application.