Documentation Index
Fetch the complete documentation index at: https://docs.golf.dev/llms.txt
Use this file to discover all available pages before exploring further.
YAML Configuration Schema
Golf Gateway supports YAML configuration for Distributed mode deployments, where server configurations are defined locally in a YAML file while organization policies and monitoring are managed through the Control Plane. This reference documents the complete YAML schema with all fields, types, and validation rules.When to Use YAML Configuration
Use YAML configuration when you want to:- Version control your MCP server configurations alongside your infrastructure code
- GitOps workflows where server definitions are managed through pull requests
- Local server definitions while still benefiting from Control Plane’s centralized policy management and monitoring
YAML configuration works in Distributed mode only. The mode is auto-detected: when a
control_plane section is present in the YAML, the gateway runs in Distributed mode. For fully managed deployments without local configuration files, use Centralized mode where all settings are managed through the Golf Control Plane.Quick Start Example
Here’s a complete, annotated configuration showing the most common settings:golf-gateway.yaml
Use
${VAR} for required environment variables or ${VAR:default} for optional ones with defaults.File Location
The gateway searches for configuration files in this order:GOLF_CONFIG_FILEenvironment variable (explicit path)/etc/golf-gateway/config.yaml/etc/golf-gateway/config.yml./golf-gateway.yaml(current directory)./golf-gateway.yml(current directory)
Environment Variable Interpolation
YAML configuration supports environment variable substitution:| Syntax | Behavior |
|---|---|
${VAR} | Required - fails if VAR is not set |
${VAR:default} | Optional - uses default if VAR is not set |
Root Configuration
Root Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
version | string | Yes | - | Schema version, must be "1.0" |
control_plane | object | No | - | Control Plane connection settings. Presence activates Distributed mode; absence means Standalone mode. |
identity_providers | array | No | [] | Identity provider configurations |
servers | array | No | [] | MCP server configurations |
gateway_policy | object | No | {} | Gateway-level policy defaults |
security | object | No | {} | Security engine settings (LLM threat detection, replay protection, rate limiting) |
oauth_server | object | No | {} | Gateway’s MCP OAuth authorization server configuration |
exporters | object | No | {} | Log export destinations |
The deployment mode is auto-detected: if
control_plane is present, the gateway runs in Distributed mode. If absent, it runs in Standalone mode. No explicit mode field is needed.Identity Providers
Configure OAuth/OIDC identity providers for authentication.Identity Provider Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique provider name (1-255 chars) |
type | enum | Yes | auth0, microsoft-entra-id, descope |
issuer | string | Conditional | OIDC issuer URL (auto-generated for Descope) |
jwks_uri | string | Conditional | JWKS endpoint URL (auto-generated for Descope) |
userinfo_endpoint | string | No | Userinfo endpoint URL |
api_identifiers | array | No | API audience identifiers |
timeout | int | No | Request timeout in seconds (default: 10, range: 1-60) |
client_id | string | No | Management API client ID (for group sync) |
client_secret | string | No | Management API client secret |
tenant_id | string | Conditional | Tenant ID. Required for Entra ID (Azure AD tenant). Optional for Descope (tenant-scoped operations). |
Descope-Specific Fields
| Field | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes (Descope) | Descope Project ID |
management_key | string | No | Descope Management Key for group sync |
Servers
Configure MCP upstream servers with RBAC and security settings.Server Schema
List of upstream MCP server configurations.
Gateway Policy
Gateway-level policy defaults that apply to all servers unless overridden. In distributed mode, these are merged with organization policies from the Control Plane.Scrubbing Policy
The scrubbing configuration uses the same schema at both gateway and server levels. All fields are merged using union — if any layer adds a field or rule, it applies.| Field | Type | Default | Description |
|---|---|---|---|
enabled | bool | false | Enable PII scrubbing |
sensitive_fields | array | [] | Field names to always mask as [MASKED] |
whitelist_fields | array | [] | Field names that should never be scrubbed (protects operational data) |
custom_rules | array | [] | Custom regex-based scrubbing rules (see server security for schema) |
recognizers | array | [] | Toggle and configure built-in PII recognizers |
When recognizer configs are merged across layers (org → gateway → server),
enabled: true wins over enabled: false (most-restrictive doctrine). Server-specific replacement text overrides gateway defaults.Server RBAC Policy
| Field | Type | Default | Description |
|---|---|---|---|
rbac_enabled | bool | false | Default RBAC enabled for new servers |
rbac_mode | enum | allow | Default RBAC mode |
allowed_groups | array | [] | Default allowed groups |
denied_groups | array | [] | Default denied groups |
capability_rbac_enabled | bool | false | Default capability RBAC enabled |
Capability RBAC Policy
| Field | Type | Description |
|---|---|---|
read_only.default_groups | array | Default groups for read-only tools |
destructive.default_groups | array | Default groups for destructive tools |
unspecified.default_groups | array | Default groups for unclassified tools |
Local Servers Policy
Controls the gateway-level blocking policy for locally-defined servers.| Field | Type | Default | Description |
|---|---|---|---|
enabled | bool | false | Enable local server blocking policy |
mode | enum | allow | Blocking mode: allow or deny |
groups | array | null | Groups affected by this policy |
Threat Whitelist Patterns
| Field | Type | Default | Description |
|---|---|---|---|
threat_whitelist_patterns | array | [] | Regex patterns for content that should bypass LLM threat detection at the gateway policy level |
Security
The security section controls how the security subsystem operates: LLM backend, threat detection model, replay protection, and rate limiting. This is operational configuration, not policy — it does not participate in the org → gateway → server policy merge cascade.LLM Threat Detection
| Field | Type | Default | Description |
|---|---|---|---|
backend | string | v1 | LLM backend: v1, v2, or remote (HTTP endpoint) |
whitelist_patterns | array | [] | Regex patterns for content that should bypass threat detection |
remote | object | - | Remote inference config (required when backend: remote) |
Remote Inference Config
Required whensecurity.llm.backend is remote.
| Field | Type | Default | Description |
|---|---|---|---|
endpoint | string | Required | URL of the remote inference endpoint |
api_key_env | string | GOLF_SECURITY_REMOTE_API_KEY | Environment variable name containing the API key |
tenant_id_env | string | GOLF_SECURITY_REMOTE_TENANT_ID | Env var for Azure AD tenant ID |
client_id_env | string | GOLF_SECURITY_REMOTE_CLIENT_ID | Env var for Azure AD client ID |
client_secret_env | string | GOLF_SECURITY_REMOTE_CLIENT_SECRET | Env var for Azure AD client secret |
Protocol is auto-detected from the endpoint URL:
azure_ml for *.inference.ml.azure.com URLs, generic otherwise. Set all three Azure AD fields to enable Azure AD authentication; otherwise key-based auth is used.Replay Protection
| Field | Type | Default | Description |
|---|---|---|---|
enabled | bool | true | Enable replay attack protection |
Rate Limiting
| Field | Type | Default | Range | Description |
|---|---|---|---|---|
enabled | bool | true | - | Enable rate limiting |
requests_per_minute | int | 20 | 1-1000 | Requests per minute per user |
window_seconds | int | 60 | 10-300 | Rate limit window |
OAuth Server
Configure the gateway’s MCP OAuth authorization server for third-party server authentication flows.| Field | Type | Default | Range | Description |
|---|---|---|---|---|
issuer | string | gateway URL | - | OAuth issuer URL |
token_ttl | int | 3600 | 300-86400 | Access token TTL in seconds |
refresh_token_ttl | int | 604800 | 3600-2592000 | Refresh token TTL in seconds |
authorization_code_ttl | int | 60 | 30-600 | Authorization code TTL in seconds |
idp_client_id | string | - | - | IdP client ID for the OAuth server |
idp_client_secret | string | - | - | IdP client secret (supports ${ENV_VAR}) |
Exporters
Configure multiple export destinations for audit logs. You can configure multiple exporters of each type.Exporter Schema
Configure audit log export destinations.
For Elasticsearch, use either
url (self-hosted) or cloud_id (Elastic Cloud), not both.Control Plane Connection
Connects the gateway to the Control Plane for centralized policy management and monitoring. The presence of this section activates Distributed mode.| Field | Type | Required | Default | Description |
|---|---|---|---|---|
url | string | Yes | https://api.golf.dev | Control Plane URL |
api_key | string | Yes | - | API key for authentication (supports ${ENV_VAR}) |
gateway_id | UUID | Yes | - | Gateway UUID |
timeout | int | No | 30 | Request timeout (5-120 seconds) |
cache_ttl | int | No | 300 | Policy cache TTL in seconds (60-3600) |
Complete Example
A complete Distributed mode configuration with Control Plane connection, identity providers, servers, security, and exporters:Validation Rules
Version
- Must be exactly
"1.0" - Required field
Identity Providers
- Names must be unique across all providers
- For non-Descope providers:
issuerandjwks_uriare required - For Descope:
project_idis required;issuerandjwks_uriare auto-generated - For Entra ID:
tenant_idis required
Servers
- Names must be unique across all servers
idpreferences must match an existing identity provider nameurlmust be a valid URL- When gateway and server both enable RBAC, their
rbac_modemust be consistent (cannot mixallowanddenyacross policy levels)
Exporters
- Names must be unique within each exporter type
- Elasticsearch: use
urlORcloud_id, not both - OTEL:
endpointrequired when enabled - Sentinel: all DCR and auth fields required when enabled
Security
- When
security.llm.backendisremote, thesecurity.llm.remoteblock is required
Control Plane
- When present,
url,api_key, andgateway_idare required organization_idis optional — resolved from Control Plane during activation if not set- Mode is auto-detected:
control_planepresent = Distributed mode
Configuration Validation CLI
Validate configuration files before deployment:Related Documentation
Environment Variables
Configure Golf Gateway using environment variables
Audit Log Schema
Complete audit log entry structure reference
RBAC Configuration
Set up role-based access control
Deployment Guide
Deploy Golf Gateway to production