Policy model
A policy document configures a policy type compiled into the gateway. Policy instances are always owned by an API Bundle or Shared Flow Bundle revision; they are never independent deployment artifacts.
kind: Policyname: orders-quotatype: quota/v1enabled: truecondition: request.method == "POST"onError: faultconfig: identifier: "{token.appId}" limit: 1200 window: 1h store: redisPolicy type versus instance
Section titled “Policy type versus instance”quota/v1is a policy type implemented and registered by the gateway.orders-quotais a policy instance whose configuration is frozen into one bundle revision.- A flow step references the policy instance by
name.
Types are explicitly versioned. There is no implicit latest, which prevents a gateway upgrade
from silently changing the meaning of published configuration.
Conditions
Section titled “Conditions”Policies and flow steps may carry conditions. When both exist, both must evaluate to true.
- policy: orders-quota condition: system.environment == "prod" onError: faultConditions support comparisons, &&, ||, !, parentheses, and glob matching with =~.
Missing variables evaluate as null and do not throw.
Error behavior
Section titled “Error behavior”onError is deliberately small:
faultenters the bundle fault pipeline.continuerecords the step failure and advances.
Policy-specific fallback behavior belongs in the policy’s own configuration only when its schema defines it.
Schema source of truth
Section titled “Schema source of truth”Every type has a machine-readable manifest under schemas/policies/. The manifest declares its
display name, supported phases, default configuration, deprecation state, and configuration
schema. The management API exposes the same catalog for the admin editor and other tooling.