Declarative rules that intercept every AI request at the gateway — before cost is incurred, before models respond, before policy is violated.
Every rule shares the same structure — readable, version-controllable, auditable.
{
"id": "budget-guard-monthly",
"scope": "org",
"condition": {
"type": "budget",
"threshold": 500
},
"action": {
"type": "hard_stop",
"message": "Monthly budget exceeded"
},
"enabled": true
}idUnique, human-readable rule namescopeorg · team · individualcondition.typebudget · model · time · usagecondition.thresholdNumeric or enum valueaction.typealert · soft_cap · hard_stop · redirectenabledToggle without deleting the ruleEach type maps to a condition category evaluated at request time.
Triggers on cumulative spend. Stops runaway costs before they compound.
monthly_cost > 500Evaluates rolling cost totals against a dollar threshold. Resets on your billing cycle.
Allowlist or blocklist specific model IDs. Enforces model governance at the gateway.
model NOT IN ["gpt-4o", "claude-3-opus"]Exact string match against the model field of every request. Case-sensitive.
Restrict AI usage to business hours or approved windows.
hour NOT IN [9..17] AND weekdayEvaluates server-side UTC or tenant-configured timezone. Supports cron-like ranges.
Rate-limit token throughput per user, team, or org over a rolling window.
tokens_per_hour > 100000Tracks rolling token counts in-memory. Configurable windows: 1m, 1h, 24h, 30d.
Every field the rule engine can evaluate at request time.
What happens when a rule condition evaluates to true.
alertFires a Slack message or email to configured recipients. The request proceeds normally — visibility without friction.
soft_capSurfaces an in-IDE warning to the developer, logs the violation, and lets the request through. Teachable moments.
hard_stopCancels the request at the gateway layer before it reaches the model. Zero tokens consumed, zero cost incurred.
redirectTransparently substitutes the requested model with a cheaper or approved alternative. Developer sees no difference.
Copy, paste, and customize. Ship your first policy in minutes.
$2K monthly org cap — hard stop before costs spiral
{
"id": "startup-budget-guard",
"scope": "org",
"condition": { "type": "budget", "threshold": 2000, "window": "monthly" },
"action": {
"type": "hard_stop",
"message": "Monthly AI budget exhausted. Resets on the 1st."
},
"enabled": true
}Only security-reviewed models may run in your environment
{
"id": "enterprise-model-allowlist",
"scope": "org",
"condition": {
"type": "model",
"operator": "not_in",
"allowlist": ["claude-3-5-sonnet-20241022", "claude-3-haiku-20240307"]
},
"action": {
"type": "hard_stop",
"message": "Model not on approved list. See infosec/approved-models.md"
},
"enabled": true
}Restrict weekend and after-hours usage to avoid unmonitored spend
{
"id": "off-hours-protection",
"scope": "team",
"condition": {
"type": "time",
"operator": "outside",
"window": { "days": [1,2,3,4,5], "hours": [8, 18] }
},
"action": {
"type": "alert",
"notify": ["eng-leads@company.com"],
"message": "Off-hours AI usage detected"
},
"enabled": true
}More specific scopes override parent rules. Individuals beat teams, teams beat org.
An individual can have a model allowlist that supersedes the team policy — useful for ML engineers who need broader access without relaxing rules for the whole team.
Install FORG, drop a JSON rule file, and have policy enforcement running before your next coffee.