Gateway Configuration

The gateway is configured entirely through rivano.yaml. This page documents every field in the gateway: section and how they interact.

Full example

gateway:
  port: 8080

  providers:
    openai:
      apiKey: "${OPENAI_API_KEY}"
      isPrimary: true
    anthropic:
      apiKey: "${ANTHROPIC_API_KEY}"
      baseUrl: "https://api.anthropic.com"
      isFallback: true
    ollama:
      baseUrl: "http://localhost:11434"

  middleware:
    pii: true
    injection: true
    audit: stdout
    cache: false
    rateLimit: 60

  cloud:
    apiKey: "${RIVANO_API_KEY}"
    baseUrl: "https://api.rivano.ai"

Environment variable references in the format ${VAR_NAME} are expanded at startup from the process environment.

Top-level fields

FieldTypeDefaultDescription
portnumber8080Port the gateway listens on
providersProviderMapRequiredMap of provider keys to provider config
middlewareMiddlewareConfigSee belowMiddleware toggles and settings
cloudCloudConfigOptionalControl plane sync settings

ProviderConfig

Each key under providers: is a provider name (e.g. openai, anthropic). The value is a ProviderConfig:

FieldTypeRequiredDescription
apiKeystringYes (except Ollama)Provider API key
baseUrlstringNoOverride the default provider URL
isPrimarybooleanNoRoute requests here when no provider hint is given
isFallbackbooleanNoRoute here if the primary provider fails
timeoutMsnumberNoPer-request timeout (default: 30000)

Only one provider should have isPrimary: true. If no provider is marked primary, the gateway uses the first configured provider as the default.

MiddlewareConfig

FieldTypeDefaultDescription
piibooleantrueEnable PII detection
injectionbooleantrueEnable prompt injection scoring. Requests scoring ≥ 0.7 trigger the block-injection policy if enabled
audit'stdout' | 'file' | 'off''stdout'Where to write the audit log
cachebooleanfalseCache identical requests/responses
rateLimitnumber60Maximum requests per minute per IP

Audit modes

ModeBehavior
stdoutWrites JSON audit entries to standard output — suitable for log aggregation
fileWrites to ./rivano-audit.log in the gateway’s working directory
offNo audit log — use only in development

CloudConfig

The cloud: section connects the gateway to the Rivano control plane:

FieldTypeRequiredDescription
apiKeystringYesYour Rivano API key (rv_...)
baseUrlstringNoControl plane URL (default: https://api.rivano.ai)

When cloud: is present, the gateway:

  • Pulls the latest policy set from the control plane on startup and every 60 seconds
  • Forwards trace metadata (not content) to the control plane for dashboard visibility
  • Receives policy updates pushed from the dashboard in near-real-time

Validate configuration

Check your rivano.yaml for errors without starting the gateway:

rivano-gateway validate
# ✔ rivano.yaml is valid

rivano-gateway validate --file ./config/rivano.prod.yaml