Provider Connectors
Sigilum gateway acts as a local reverse proxy that enforces signed authentication and claim-based authorization before forwarding requests to third-party APIs. Connectors inject provider credentials and support both traditional HTTP APIs and MCP (Model Context Protocol) tools.Protocol Support
The gateway supports two protocol types:HTTP Connectors
Traditional REST/GraphQL APIs accessed via reverse proxy. Request path:/proxy/{connection_id}/...
Use cases:
- REST APIs (Slack, GitHub, Linear)
- GraphQL endpoints
- Any HTTP-based service
MCP Connectors
Model Context Protocol servers with structured tool discovery and filtering. Runtime paths:GET /mcp/{connection_id}/tools- List available toolsGET /mcp/{connection_id}/tools/{tool}/explain- Get tool schemaPOST /mcp/{connection_id}/tools/{tool}/call- Execute tool
- Automatic tool discovery with caching
- Subject-level tool policies (allow/deny by user)
- Connection-level tool filtering
- Structured JSON-RPC transport
Connection Configuration
HTTP Connection
Basic HTTP provider with Bearer token authentication:MCP Connection
MCP provider with tool filtering:Connection Fields
Core fields:id(string) - Unique connection identifiername(string) - Human-readable nameprotocol(string) -httpormcpstatus(string) -active,inactive, orrotation_required
base_url(string) - Upstream API base URLauth_mode(string) -bearer,header,query_param, ornoneauth_header_name(string) - Header name for credentials (e.g.,Authorization)auth_header_prefix(string) - Prefix for auth header value (e.g.,Bearer)auth_secret_key(string) - Key in secrets map to use
mcp_base_url(string) - MCP server base URLmcp_transport(string) - Transport type (e.g.,streamableHttp)mcp_endpoint(string) - MCP endpoint path (e.g.,/mcp)mcp_tool_allowlist([]string) - Explicitly allowed tools (empty = allow all)mcp_tool_denylist([]string) - Explicitly denied toolsmcp_max_tools_exposed(int) - Maximum tools to expose (0 = unlimited)mcp_subject_tool_policies([]object) - Per-subject tool access rules
secrets(map[string]string) - Credential key-value pairs
Shared Credential Variables
Define credentials once and reference them across multiple connections.Creating Shared Variables
Via HTTP API:Referencing Variables
Use{{VARIABLE_NAME}} syntax in connection secrets:
- Define credential once, use in multiple connections
- Rotate credential in one place
- Audit trail via
created_by_subjecttracking
Variable Metadata
Variables store attribution for audit purposes:Authentication Modes
Bearer Token
StandardAuthorization: Bearer <token> header:
Custom Header
Custom header name and value:Query Parameter
Credential in URL query string:mcp_endpoint:
No Authentication
Public APIs with no authentication:MCP Discovery
Discover available tools from an MCP server:Via HTTP API
force(default) - Bypass cache, always fetch freshauto- Use cached discovery if within TTL
Via CLI
Discovery Cache
Discovery results are cached with configurable TTL: Environment variables:GATEWAY_MCP_DISCOVERY_CACHE_TTL_SECONDS(default:300) - Cache freshness windowGATEWAY_MCP_DISCOVERY_STALE_IF_ERROR_SECONDS(default:3600) - Fallback to stale cache if refresh fails
- Fresh: Within TTL → Use cache
- Stale but valid: Past TTL, refresh failed → Use stale cache
- Expired: Past stale window → Return error
Subject-Level Tool Policies
Control which tools specific subjects can access.Policy Structure
Policy Evaluation
Order of precedence:- Connection-level
mcp_tool_denylist(applies to all subjects) - Subject-level
deny_tools(specific to subject) - Subject-level
allow_tools(allowlist mode for subject) - Connection-level
mcp_tool_allowlist(applies to all subjects)
- If tool in connection denylist → Deny
- If subject has policy with
deny_toolsand tool in list → Deny - If subject has policy with
allow_toolsand tool not in list → Deny - If connection has allowlist and tool not in list → Deny
- Otherwise → Allow
Use Cases
Read-only access for contractors:Provider Examples
OpenAI
Slack
Linear (MCP)
Typefully (MCP with Query Auth)
CLI Management
Manage connections via the gateway CLI:List Connections
Add HTTP Connection
Add MCP Connection
Update Connection
Rotate Credentials
Test Connection
Delete Connection
Service Catalog
The gateway uses a service catalog to template common provider configurations.Catalog Structure
env_var Hint
The env_var field is a dashboard hint for detecting existing shared variables:
- Not automatic environment variable lookup by gateway
- Used by dashboard to suggest reusing existing
{{LINEAR_API_KEY}}variable - Reduces duplicate credential entry
Managing Catalog
Get current catalog:MCP Runtime Features
Circuit Breaker
Prevent cascading failures from unhealthy MCP servers: Environment variables:GATEWAY_MCP_CIRCUIT_BREAKER_FAILURES(default:3) - Failures before opening circuitGATEWAY_MCP_CIRCUIT_BREAKER_COOLDOWN_SECONDS(default:10) - Fail-fast duration
- Closed - Normal operation, requests forwarded
- Open - After N consecutive failures, fail fast without upstream call
- Half-Open - After cooldown, try one request to test recovery
GATEWAY_MCP_CIRCUIT_BREAKER_FAILURES=0
Retry Logic
Automatic retry for transient failures: Retryable conditions:- Network timeout/connection errors
- HTTP
429(rate limit) - HTTP
502,503,504(temporary server issues)
400(bad request)401,403(auth required)404(not found)500(server error)
- Exponential backoff with jitter
- Bounded attempts per request
Rate Limiting
Per-connection, per-namespace burst limits: Environment variables:GATEWAY_CLAIM_REGISTRATION_RATE_LIMIT_PER_MINUTE(default:30) - Claim submit attemptsGATEWAY_MCP_TOOL_CALL_RATE_LIMIT_PER_MINUTE(default:120) - MCP tool calls
(connection_id, namespace) pair
Disable: Set limit to 0
Timeouts
Route-class timeout configuration:Credential Rotation
Manage credential lifecycle with rotation policies.Rotation Metadata
Connections track rotation status:Enforcement Modes
off- No enforcement, status indicator onlywarn- Log warnings for overdue rotationsblock- Reject requests withROTATION_REQUIREDerror
Rotation Workflow
Request Flow
HTTP Proxy Flow
- Client sends signed request to
/proxy/{connection_id}/... - Gateway verifies RFC 9421 signature
- Gateway checks nonce replay (in-memory)
- Gateway validates approved claim for
<namespace, agent_key, connection_id> - Gateway resolves connection config and secrets
- Gateway injects auth header (Bearer, custom, or query param)
- Gateway forwards to upstream API
- Gateway streams response back to client
MCP Runtime Flow
- Client sends signed request to
/mcp/{connection_id}/tools - Gateway verifies signature and claim (same as HTTP)
- Gateway checks discovery cache:
- Hit + Fresh → Return cached tools
- Miss → Fetch from MCP server, cache result
- Stale → Attempt refresh, fallback to stale on error
- Gateway applies tool filtering:
- Connection-level allowlist/denylist
- Subject-level policies
- Gateway returns filtered tool list
Tool Call Flow
- Client sends signed request to
/mcp/{connection_id}/tools/{tool}/call - Gateway verifies signature and claim
- Gateway checks circuit breaker state:
- Open → Return error immediately
- Closed/Half-Open → Proceed
- Gateway validates tool is allowed for subject
- Gateway constructs MCP JSON-RPC request
- Gateway forwards to MCP server with auth
- Gateway handles retries for transient failures
- Gateway streams response back to client
Error Codes
Gateway returns structured error envelopes:Common Codes
AUTH_CLAIM_REQUIRED- No approved claim for this agent+serviceAUTH_SIGNATURE_INVALID- RFC 9421 signature verification failedAUTH_NONCE_INVALID- Nonce missing or malformedAUTH_REPLAY_DETECTED- Nonce already usedCONNECTION_NOT_FOUND- Connection ID doesn’t existROTATION_REQUIRED- Credential rotation overdue (block mode)RATE_LIMITED- Too many requestsMCP_DISCOVERY_FAILED- Tool discovery failedMCP_TOOL_NOT_ALLOWED- Tool denied by policyCIRCUIT_BREAKER_OPEN- MCP server unhealthy
Security Considerations
Admin API Access
Control admin endpoint access:hybrid(default) - Allow loopback OR valid admin tokenloopback- Loopback only (127.0.0.1, ::1)token- Token required from all clients
Signed Admin Checks
Test and discover routes require signed auth by default:POST /api/admin/connections/{id}/testPOST /api/admin/connections/{id}/discover
CORS Configuration
Explicit origin allowlist for browser access:Proxy Trust
Trust forwarded headers only from known proxies:X-Forwarded-ForX-Forwarded-ProtoX-Forwarded-Host
Monitoring
Health Checks
Metrics
Prometheus metrics endpoint:sigilum_gateway_auth_reject_total{reason}- Auth rejection reasonssigilum_gateway_upstream_requests_total{protocol,outcome}- Request outcomessigilum_gateway_mcp_discovery_total{result}- Discovery attemptssigilum_gateway_mcp_tool_call_total{result}- Tool call resultssigilum_gateway_requests_in_flight- Concurrent requests
Decision Logs
Structured JSON logs for all auth/claim/proxy decisions:- Secret fields →
[redacted] - Identity fields → Hashed fingerprints
- Client IPs → Masked (/24 for IPv4, /64 for IPv6)
Next Steps
OpenClaw Integration
Install Sigilum hooks and skills for OpenClaw agents
Claims Management
Approve and manage agent access claims