Security
Condrix uses a layered security model covering authentication, authorization, and transport encryption.
OAuth Authentication
Section titled “OAuth Authentication”Condrix’s primary authentication method is OAuth, using the same flow as the Claude Code CLI.
Flow Overview
Section titled “Flow Overview”┌────────┐ 1. Sign In ┌────────────┐│ Client │ ──────────────────► │ Core │└────────┘ └─────┬──────┘ │ 2. Open browser ▼ ┌────────────┐ │ claude.ai │ │ /oauth/ │ │ authorize │ └─────┬──────┘ │ 3. User approves ▼ ┌────────────┐ │ Callback │ │ localhost │ │ :PORT/ │ │ callback │ └─────┬──────┘ │ 4. Exchange code for tokens ▼ ┌────────────────────┐ │ platform.claude.com │ │ /v1/oauth/token │ └────────────────────┘- The client sends a sign-in request to the Core
- The Core starts a temporary HTTP server and opens the Claude authorization page in a browser
- The user approves the request; Claude redirects to
http://localhost:PORT/callbackwith an authorization code - The Core exchanges the code for access and refresh tokens using PKCE
Bearer Tokens
Section titled “Bearer Tokens”All API requests include:
Authorization: Bearer sk-ant-oat01-...— The OAuth access tokenanthropic-beta: oauth-2025-04-20— Required beta header for OAuth support
Without the beta header, the API returns 401 OAuth authentication is currently not supported.
Token Storage
Section titled “Token Storage”Credentials are stored in ~/.claude/.credentials.json on the Core’s host:
{ "claudeAiOauth": { "accessToken": "sk-ant-oat01-...", "refreshToken": "sk-ant-ort01-...", "expiresAt": 1735689600000 }}The expiresAt field is a Unix timestamp in milliseconds. The Core monitors token expiry and refreshes automatically before it lapses.
TOTP Two-Factor Authentication
Section titled “TOTP Two-Factor Authentication”For additional client-to-Core security, Condrix supports Time-based One-Time Password (TOTP) authentication.
How It Works
Section titled “How It Works”- Enable 2FA in the Core’s settings
- The Core generates a TOTP secret and displays a QR code
- Scan the QR code with any authenticator app (Google Authenticator, Authy, etc.)
- Clients must provide a valid TOTP code when connecting to the Core
This protects against unauthorized access if someone discovers your Core’s address, especially when using Cloudflare Tunnel or binding to 0.0.0.0.
Multi-Provider Authentication
Section titled “Multi-Provider Authentication”Condrix supports multiple AI providers, each with its own authentication pattern.
Provider Credentials
Section titled “Provider Credentials”| Provider | Credential Type | Storage |
|---|---|---|
| Claude (OAuth) | Access + refresh tokens | ~/.claude/.credentials.json |
| Claude (API Key) | Anthropic API key | Core SQLite database |
| OpenAI | OpenAI API key | Core SQLite database |
| Local (Ollama) | None | N/A |
| Custom | Optional API key | Core SQLite database |
All credentials are stored on the Core and never sent to clients. The Core proxies all AI requests, so clients never interact with provider APIs directly.
Connection Isolation
Section titled “Connection Isolation”Each AI Connection is isolated — credentials for one connection cannot be accessed by another. When a fallback chain triggers, the Core authenticates with the next provider using that connection’s own credentials.
Registration Tokens
Section titled “Registration Tokens”Condrix uses registration tokens (invite codes) for secure Core-to-Maestro authentication. This replaces the previous shared-secret approach.
┌───────────────┐ 1. Generate token ┌──────────────┐│ Maestro Admin │ ─────────────────────► │ Maestro │└───────────────┘ └──────┬───────┘ │ 2. Token: "inv_abc123" │┌───────────────┐ 3. Set env var ┌──────▼───────┐│ Core Admin │ ─────────────────────► │ Core ││ │ CONDRIX_MAESTRO_TOKEN │ │└───────────────┘ =inv_abc123 └──────┬───────┘ │ 4. Register with token ▼ ┌──────────────┐ │ Maestro │ │ validates & │ │ issues perm │ │ token │ └──────────────┘- A Maestro admin generates a registration token in the Maestro UI
- The Core admin sets it as
CONDRIX_MAESTRO_TOKENin the Core’s environment - The Core presents the token when connecting to Maestro
- Maestro validates the token and issues a permanent access token
- The Core stores the permanent token and uses it for all future connections
Registration tokens are single-use. Once a Core receives its permanent token, the registration token is consumed and cannot be reused.
CONDRIX_CORE_TOKEN
Section titled “CONDRIX_CORE_TOKEN”The CONDRIX_CORE_TOKEN environment variable pre-seeds an authentication token on Core startup. This is used for:
- Maestro outbound connections — When a Maestro needs to initiate a connection to a Core
- Automated deployments — Where browser-based authentication is not available
- CI/CD environments — Headless Core instances that need a pre-configured identity
export CONDRIX_CORE_TOKEN=your-pre-seeded-tokennpm run dev:coreThe token is stored in the Core’s database on first startup and used for subsequent authentication handshakes.
Token Rotation
Section titled “Token Rotation”Maestro admins can rotate a Core’s permanent access token from the Maestro UI. Use token rotation when:
- A Core’s token may have been compromised
- You want to enforce periodic credential rotation as a security policy
- A Core is being decommissioned and its token should be invalidated
After rotation, the affected Core automatically receives its new token on the next connection to Maestro. No manual intervention is required on the Core side.
Maestro Authentication
Section titled “Maestro Authentication”Maestro uses separate authentication for its two communication channels.
Core to Maestro
Section titled “Core to Maestro”When a Core registers with Maestro, it authenticates using a registration token (see above). For legacy deployments, shared secrets are still supported:
# CoreCONDRIX_MAESTRO_URL=ws://maestro:9200CONDRIX_MAESTRO_TOKEN=your-registration-token
# MaestroCONDRIX_MAESTRO_CORE_SECRET=your-shared-secretThe Core includes this token in its registration message. Maestro rejects connections with invalid or missing tokens.
Client to Maestro
Section titled “Client to Maestro”Clients authenticate with Maestro using user credentials:
# MaestroCONDRIX_MAESTRO_CLIENT_AUTH=enabledWhen enabled, clients must provide valid credentials to:
- List available Cores
- Request relay connections
- Access the messaging bridge
Rate Limiting
Section titled “Rate Limiting”Both Core and Maestro implement rate limiting to prevent abuse:
| Endpoint | Limit | Window |
|---|---|---|
| WebSocket connections | 10 per IP | 1 minute |
| Authentication attempts | 5 per IP | 5 minutes |
| Message throughput | 100 messages | 1 second |
Failed authentication attempts trigger exponential backoff. After 5 failures, the IP is blocked for 5 minutes.
Transport Security
Section titled “Transport Security”Local Development
Section titled “Local Development”In local development, WebSocket connections use unencrypted ws://. This is acceptable because:
- The Core binds to
127.0.0.1by default — only local connections are accepted - No data leaves the machine
Remote Access
Section titled “Remote Access”For remote access, Condrix provides two encrypted transport options:
Cloudflare Tunnel (Recommended)
Cloudflare Tunnel automatically provides TLS encryption:
- Client connects via
wss://your-tunnel.trycloudflare.com - Traffic is encrypted end-to-end between the client and Cloudflare’s edge
- The tunnel connects to the Core over a secure channel
- No certificate management required
Direct TLS
For environments where Cloudflare Tunnel is not available:
CONDRIX_CORE_TLS_CERT=/path/to/cert.pemCONDRIX_CORE_TLS_KEY=/path/to/key.pemThe Core will serve wss:// instead of ws:// when TLS certificates are configured.
Security Best Practices
Section titled “Security Best Practices”- Never expose a Core to the internet without authentication — Always use TOTP or Cloudflare Tunnel
- Use OAuth over API keys when possible — OAuth tokens are short-lived and automatically refreshed
- Use registration tokens for Core-to-Maestro auth — Single-use invite codes are more secure than shared secrets
- Rotate Core tokens periodically — Use the Maestro UI to rotate access tokens on a regular schedule
- Keep Node.js updated — Condrix requires Node.js 22+ which receives active security patches
- Review connected clients — The Core tracks all active WebSocket connections; disconnect unknown clients
- Use Cloudflare Tunnel for remote access — Avoid port forwarding, which bypasses firewall protections
- Store API keys securely — AI provider API keys are stored in the Core’s database; protect the data directory