Shannon supports API key authentication to secure access to the orchestration platform. Authentication is disabled by default for easy local development and can be enabled for production deployments.
# Create a test API key (run from repo root)make seed-api-key# Output✅ Test API key created. Use 'sk_test_123456' for testing.Note: Authentication is disabled by default (GATEWAY_SKIP_AUTH=1)
HTTP/1.1 429 Too Many RequestsRetry-After: 30{ "error": "Rate limit exceeded", "message": "Too many requests. Please retry after the rate limit window resets."}
package shannon.authimport future.keywords.if# Default denydefault allow = false# Allow if user has valid API key and appropriate permissionsallow if { input.api_key_valid input.user.team in ["engineering", "data-science"] input.task.mode in allowed_modes[input.user.team]}# Team-specific allowed modesallowed_modes := { "engineering": ["simple", "standard", "complex"], "data-science": ["standard", "complex"]}# Token budget limits by teammax_tokens[team] := 50000 if team == "data-science"max_tokens[team] := 10000 if team == "engineering"
package shannon.models# Only allow specific models per teamallowed_models[user.team] contains model if { user.team == "cost-sensitive" model in ["gpt-5-mini", "claude-haiku"]}allowed_models[user.team] contains model if { user.team == "premium" model in ["gpt-5-thinking", "claude-opus", "gpt-5", "claude-sonnet"]}
# Requests per API keysum by (api_key_id) (rate(shannon_gateway_requests_total[5m]))# Errors by API keysum by (api_key_id) (rate(shannon_gateway_errors_total[5m]))
# Verify auth is enabledgrep GATEWAY_SKIP_AUTH .env# If enabled, check your API keycurl -H "X-API-Key: sk_test_123456" \ http://localhost:8080/api/v1/tasks
403 Forbidden
Cause: Valid API key but insufficient permissions (OPA policy)Solution: Check OPA policy logs:
Copy
docker compose logs orchestrator | grep "policy"
429 Rate Limited
Cause: Exceeded rate limitsSolution: Implement retry logic with exponential backoff: