Explicit security boundary enforcement through operational modes for local development and production deployments.
The proxy supports two distinct access modes that enforce appropriate security boundaries based on your deployment context:
- Single User Mode (default): Designed for local development with a single developer. Allows OAuth-based connectors, optional authentication, and enforces localhost-only binding.
- Multi User Mode: Designed for production and shared deployments. Blocks OAuth-based connectors, requires authentication for non-localhost binding, and rejects desktop-specific features.
Access modes prevent common misconfigurations that could:
- Expose personal OAuth credentials in shared/production environments
- Allow unauthenticated remote access
- Enable desktop features on server deployments
Key Characteristics:
- Access mode is immutable after startup (no runtime switching)
- Mode is selected via CLI flags or configuration file
- Defaults to Single User Mode for backward compatibility
Purpose: Local development by a single developer.
- OAuth Connectors: Full access to OAuth-based connectors (e.g.,
gemini-oauth-auto,anthropic-oauth,qwen-oauth,openai-codex) - Host Binding: Must bind to
127.0.0.1only (localhost) - Authentication: Optional - can be disabled for convenience
- OAuth Debugging Flags: Allowed (e.g.,
--enable-gemini-oauth-auto-backend-debugging-override) - OAuth Auto-Replacement:
--allow-oauth-auto-replacementflag is allowed - Desktop Notifications: Can be enabled or disabled
Install the OAuth connector package extra before using OAuth backends:
pip install llm-interactive-proxy[oauth]The optional package owns extracted OAuth connector implementations and exposes them to core through plugin entry points.
- Host Binding: Cannot bind to any IP address other than
127.0.0.1
- Local development and testing
- Personal AI agent experimentation
- Rapid prototyping with personal credentials
- Debugging OAuth flows
# Minimal startup (defaults to Single User Mode)
./.venv/Scripts/python.exe -m src.core.cli
# Explicit Single User Mode with OAuth connector
./.venv/Scripts/python.exe -m src.core.cli --single-user-mode --default-backend gemini-oauth-auto:gemini-exp-1206
# With authentication disabled for convenience
./.venv/Scripts/python.exe -m src.core.cli --disable-auth
# With desktop notifications enabled
./.venv/Scripts/python.exe -m src.core.cli --enable-notificationsaccess_mode:
mode: single_user
host: 127.0.0.1
port: 8000
auth:
disable_auth: true # Optional for local development
notifications:
enabled: true # Desktop notifications allowedPurpose: Production and shared deployments where multiple users access the proxy.
- Static Credential Connectors: Full access to API key-based connectors (e.g.,
openai,anthropic,gemini) - Host Binding: Can bind to any IP address (e.g.,
0.0.0.0, specific network interfaces) - Localhost Binding: Can bind to
127.0.0.1with or without authentication - Non-Localhost Binding: Requires authentication (API keys or SSO)
- OAuth Connectors: All OAuth-based connectors are blocked and filtered during startup
- OAuth Debugging Flags: All OAuth debugging override flags are rejected
- OAuth Auto-Replacement:
--allow-oauth-auto-replacementflag is rejected - Desktop Notifications: Desktop notifications are rejected (server deployments don't have desktop environments)
- Non-Localhost Without Auth: Cannot bind to non-localhost addresses without authentication enabled
- Team/organization proxy deployments
- Production environments
- Shared development servers
- Cloud/container deployments
- Multi-tenant scenarios
# Multi User Mode with API key authentication
./.venv/Scripts/python.exe -m src.core.cli --multi-user-mode --host=0.0.0.0 --api-keys key1,key2
# Multi User Mode with SSO (requires SSO configuration)
./.venv/Scripts/python.exe -m src.core.cli --multi-user-mode --host=0.0.0.0 --sso-enabled
# Multi User Mode on localhost (auth optional)
./.venv/Scripts/python.exe -m src.core.cli --multi-user-mode --host=127.0.0.1
# Multi User Mode with specific backend
./.venv/Scripts/python.exe -m src.core.cli --multi-user-mode --host=0.0.0.0 --api-keys key1 --default-backend openai:gpt-4oaccess_mode:
mode: multi_user
host: 0.0.0.0
port: 8000
auth:
disable_auth: false
api_keys:
- "production-key-1"
- "production-key-2"
# OR use SSO
sso:
enabled: true
# ... SSO configuration ...
notifications:
enabled: false # Not allowed in Multi User Mode| Flag | Description | Default |
|---|---|---|
--single-user-mode |
Enable Single User Mode | Implied if no flag specified |
--multi-user-mode |
Enable Multi User Mode | Not set |
Mutual Exclusivity: Cannot specify both --single-user-mode and --multi-user-mode simultaneously.
- CLI flags (highest priority)
- Environment variables
- Configuration file (
config.yaml) - Default (Single User Mode)
# Set access mode via environment
export LLM_PROXY_ACCESS_MODE=multi_user
# Then start proxy
./.venv/Scripts/python.exe -m src.core.cli --host=0.0.0.0 --api-keys key1The proxy validates access mode configuration during startup and refuses to start if validation fails.
| Check | Rule | Error Example |
|---|---|---|
| Host Binding | Must be 127.0.0.1 |
"Single User Mode requires binding to 127.0.0.1 only. Current host: 0.0.0.0. Use --multi-user-mode for remote access." |
| Check | Rule | Error Example |
|---|---|---|
| Non-Localhost Authentication | Non-localhost binding requires authentication | "Multi User Mode requires authentication when binding to non-localhost addresses. Current host: 0.0.0.0. Enable authentication via API keys or SSO." |
| OAuth Debugging Flags | OAuth override flags are rejected | "OAuth debugging override flags are not allowed in Multi User Mode: --enable-gemini-oauth-auto-backend-debugging-override. OAuth connectors are blocked in production deployments." |
| OAuth Auto-Replacement | --allow-oauth-auto-replacement is rejected |
"OAuth auto-replacement (--allow-oauth-auto-replacement) is not allowed in Multi User Mode. OAuth connectors are blocked in production deployments." |
| Desktop Notifications | Desktop notifications are rejected | "Desktop notifications are not allowed in Multi User Mode. Multi User Mode is for dedicated servers, not desktop computers. Use --disable-notifications or switch to Single User Mode." |
All validation errors provide:
- What failed: Clear statement of which validation rule was violated
- Current configuration: Shows the conflicting setting
- How to fix: Actionable guidance on resolving the issue
- Alternative options: Suggests valid alternatives (e.g., switching modes)
In Multi User Mode, the following connectors are automatically filtered during startup:
By Naming Pattern:
- Connectors containing
-oauth-(e.g.,gemini-oauth-auto,gemini-oauth-free,gemini-oauth-plan) - Connectors ending with
-oauth(e.g.,anthropic-oauth,qwen-oauth)
By Property:
- Connectors with
has_static_credentials = False
Known OAuth Connectors:
gemini-oauth-autogemini-oauth-freegemini-oauth-plananthropic-oauthqwen-oauthopenai-codex(uses OAuth via auth.json)
# Single User Mode startup logs
INFO: Starting LLM Proxy in Single User Mode (default)
DEBUG: Loaded OAuth connectors: gemini-oauth-auto, anthropic-oauth, qwen-oauth, openai-codex
# Multi User Mode startup logs
INFO: Starting LLM Proxy in Multi User Mode
INFO: Skipped 4 OAuth connectors in Multi User Mode (OAuth not allowed in production)
- Single User Mode: OAuth connectors appear in backend registry and can be selected
- Multi User Mode: OAuth connectors never appear in backend registry, requests to OAuth backends fail with clear error
Query the /internal/health endpoint to verify the current access mode:
curl http://localhost:8000/internal/health | jq .access_modeResponse:
{
"access_mode": "single_user",
"service_provider_present": true,
"IRequestProcessor_resolvable": true,
...
}Possible Values:
"single_user": Running in Single User Mode"multi_user": Running in Multi User Mode
If you're currently running the proxy without explicit access mode configuration and want to deploy to production:
Step 1: Review Your Configuration
# Check if you're using OAuth connectors
grep -r "oauth" config/config.yaml
# Check current backend selection
curl http://localhost:8000/v1/models | jq '.data[] | select(.id | contains("oauth"))'Step 2: Switch to Static Credential Connectors
Replace OAuth backends with API key-based alternatives:
| OAuth Connector | Static Credential Alternative |
|---|---|
gemini-oauth-auto |
gemini (requires GEMINI_API_KEY) |
anthropic-oauth |
anthropic (requires ANTHROPIC_API_KEY) |
qwen-oauth |
qwen (requires API key configuration) |
openai-codex |
openai (requires OPENAI_API_KEY) |
Step 3: Enable Authentication
# config/config.yaml
auth:
disable_auth: false
api_keys:
- "your-production-key-1"
- "your-production-key-2"Or use SSO (see SSO Authentication Guide).
Step 4: Update Startup Command
# Old (Single User Mode, implicit)
./.venv/Scripts/python.exe -m src.core.cli
# New (Multi User Mode, explicit)
./.venv/Scripts/python.exe -m src.core.cli --multi-user-mode --host=0.0.0.0Step 5: Disable Desktop Notifications
# config/config.yaml
notifications:
enabled: falseOr remove --enable-notifications flag if specified.
Step 6: Verify Configuration
# Start the proxy
./.venv/Scripts/python.exe -m src.core.cli --multi-user-mode --host=0.0.0.0
# Check access mode
curl http://localhost:8000/internal/health | jq .access_mode
# Should return: "multi_user"
# Verify OAuth connectors are filtered
curl http://localhost:8000/v1/models | jq '.data[] | select(.id | contains("oauth"))'
# Should return: empty (no OAuth connectors)Cause: Both access mode flags specified simultaneously.
Solution: Remove one of the flags. Choose the appropriate mode for your deployment:
# Wrong
./.venv/Scripts/python.exe -m src.core.cli --single-user-mode --multi-user-mode
# Correct - Single User Mode
./.venv/Scripts/python.exe -m src.core.cli --single-user-mode
# Correct - Multi User Mode
./.venv/Scripts/python.exe -m src.core.cli --multi-user-modeCause: Attempting to bind to a non-localhost address in Single User Mode.
Solution: Either bind to localhost or switch to Multi User Mode:
# Option 1: Bind to localhost
./.venv/Scripts/python.exe -m src.core.cli --host=127.0.0.1
# Option 2: Switch to Multi User Mode
./.venv/Scripts/python.exe -m src.core.cli --multi-user-mode --host=0.0.0.0 --api-keys key1Cause: Attempting to bind to a non-localhost address without authentication in Multi User Mode.
Solution: Enable authentication via API keys or SSO:
# With API keys
./.venv/Scripts/python.exe -m src.core.cli --multi-user-mode --host=0.0.0.0 --api-keys key1,key2
# With SSO (requires SSO configuration)
./.venv/Scripts/python.exe -m src.core.cli --multi-user-mode --host=0.0.0.0 --sso-enabled
# Or bind to localhost without authentication requirement
./.venv/Scripts/python.exe -m src.core.cli --multi-user-mode --host=127.0.0.1Cause: Attempting to use OAuth debugging flags in Multi User Mode.
Solution: Remove the OAuth debugging override flags:
# Wrong
./.venv/Scripts/python.exe -m src.core.cli --multi-user-mode --enable-gemini-oauth-auto-backend-debugging-override
# Correct
./.venv/Scripts/python.exe -m src.core.cli --multi-user-mode --host=0.0.0.0 --api-keys key1Why: OAuth connectors are designed for personal credentials and should not be used in production/shared environments.
Cause: --allow-oauth-auto-replacement flag specified in Multi User Mode.
Solution: Remove the flag:
# Wrong
./.venv/Scripts/python.exe -m src.core.cli --multi-user-mode --allow-oauth-auto-replacement
# Correct
./.venv/Scripts/python.exe -m src.core.cli --multi-user-mode --host=0.0.0.0 --api-keys key1Cause: Desktop notifications enabled in Multi User Mode.
Solution: Disable notifications or switch to Single User Mode:
# Option 1: Disable notifications
./.venv/Scripts/python.exe -m src.core.cli --multi-user-mode --disable-notifications
# Option 2: Remove from config file
# config/config.yaml
notifications:
enabled: false
# Option 3: Switch to Single User Mode (if appropriate)
./.venv/Scripts/python.exe -m src.core.cli --single-user-mode --enable-notificationsWhy: Multi User Mode is designed for server deployments that typically don't have desktop environments.
Symptom: Requests to OAuth backends fail with "Backend not found" error in Multi User Mode.
Cause: OAuth connectors are filtered in Multi User Mode.
Solution: Switch to static credential connectors:
# Instead of gemini-oauth-auto, use gemini with API key
export GEMINI_API_KEY="your-api-key"
./.venv/Scripts/python.exe -m src.core.cli --multi-user-mode --default-backend gemini:gemini-exp-1206In Single User Mode, ensure the optional package is installed when OAuth connectors are not available:
pip install llm-interactive-proxy[oauth]Symptom: /internal/health reports unexpected access mode.
Diagnosis:
# Check health endpoint
curl http://localhost:8000/internal/health | jq .access_mode
# Check startup logs
grep "Starting LLM Proxy" var/logs/llm-proxy.logSolution: Verify configuration precedence (CLI flags override config file).
- Use Single User Mode: Default mode is appropriate for local development
- Keep OAuth Credentials Private: Never commit OAuth credentials to version control
- Disable Authentication: Use
--disable-authfor convenience in local development - Enable Notifications: Desktop notifications can help track agent activity
- Use Multi User Mode: Explicitly specify
--multi-user-modefor clarity - Enable Authentication: Always require API keys or SSO for non-localhost binding
- Use Static Credentials: Only use API key-based connectors
- Disable Notifications: Server environments don't need desktop notifications
- Monitor Access Mode: Regularly check
/internal/healthto verify mode - Document Mode Choice: Add comments to configuration files explaining mode selection
- Never Share OAuth Credentials: OAuth connectors use personal credentials
- Rotate API Keys: Regularly rotate production API keys
- Audit Access Mode: Verify access mode matches deployment context
- Review Logs: Monitor startup logs for OAuth connector filtering messages
- Validate Configuration: Test mode switching in staging before production