agentsclimarketplace

Gateway config

Skill vhmarquez/argo/skills/gateway-config

Generate (or validate) the LLM Governance on AI Gateway configuration for the project — token quotas, model allowlist, fallback policy, per-agent rate limits. Output is a `.claude/ai-gateway.<env>.json` file the org's gateway service consumes.From its SKILL.md

Install
npx -y skills add vhmarquez/argo --skill gateway-config

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

6.8 KB, as published. Nobody here has run it

You are producing the AI Gateway configuration that controls token usage, model selection, and fallback behavior for agents in this org. The gateway is the org-level chokepoint for LLM traffic — sensible defaults here prevent surprise bills and cap blast-radius for misbehaving agents.

Read Project Config First

source "${CLAUDE_PLUGIN_ROOT}/hooks/lib/config.sh"
PROJECT_NAME="$(sf_config_get '.project.name' "$ENV")"
DEFAULT_ENV="${ENV:-base}"

The output path follows the env-override convention:

  • --env prod → writes .claude/ai-gateway.prod.json
  • (no env) → writes .claude/ai-gateway.json (the base config)

Per-env overrides deep-merge over the base in the same way sf-project.<env>.json does.

Input

$ARGUMENTS:

  • (empty) — interactive walk through the sections below
  • --profile dev|qa|prod — apply a recommended bundle (see below)
  • --validate — verify the existing gateway config; no changes
  • --env <name> — write to env override file
  • --ci — non-interactive, profile or explicit fields required

Configuration sections

Models

FieldPurposeDefault
models.allowlistModels permitted from this org["sf-proprietary","claude-sonnet","gpt-5"]
models.defaultDefault for non-specialized work"sf-proprietary"
models.byAgentPer-agent model override{}

Quotas

FieldPurposeDefault (dev / prod)
quotas.tokensPerHour.orgOrg-wide ceiling1_000_000 / 10_000_000
quotas.tokensPerHour.perAgentPer-agent ceiling100_000 / 1_000_000
quotas.requestsPerMinute.perAgentPer-agent rate limit60 / 600
quotas.maxContextTokensPer-request context cap100_000
quotas.maxOutputTokensPer-response output cap4_096

Fallback

FieldPurposeDefault
fallback.policyWhat to do when primary model fails or quota exceeded"degrade" (use cheaper model)
fallback.chainOrdered fallback list["claude-sonnet","gpt-5","sf-proprietary"]
fallback.refuseAfterStop trying after N attempts3
fallback.userMessageMessage shown when refusing"I'm temporarily unavailable. Please try again in a minute."

Audit

FieldPurposeDefault
audit.logAllRequestsLog every request for compliancetrue
audit.retainDaysLog retention90 (dev) / 365 (prod)
audit.alertWebhookWebhook for quota-exceeded events(project's notifications.webhooks.slack)

Profiles

ProfileToken / hour capModelAudit retention
dev1Msf-proprietary (cheap, fast iteration)30d
qa5Mclaude-sonnet60d
prod10Mclaude-sonnet (with gpt-5 fallback)365d

Each profile is a JSON template under ${CLAUDE_PLUGIN_ROOT}/templates/gateway/<profile>.json (the skill copies + merges).

Steps

--profile prod

  1. Read template ${CLAUDE_PLUGIN_ROOT}/templates/gateway/prod.json
  2. Substitute project-specific fields:
    • audit.alertWebhook ← notifications.webhooks.slack from sf-project.json
    • models.byAgent ← infer from botDefinitions/ (if there are agents in source)
  3. Write to .claude/ai-gateway.prod.json

Interactive (no profile)

Walk through each section, showing defaults from the closest matching profile, asking the user to override or accept.

--validate

  1. Load current .claude/ai-gateway[.<env>].json
  2. Cross-check against constraints:
    • Each agent in botDefinitions/ is either in the allowlist or has a per-agent model override
    • Default model is in the allowlist
    • Fallback chain doesn't include disallowed models
    • Token quotas are positive and per-agent ≤ org-wide
    • notifications.webhooks.slack resolves (if used)
  3. Report findings with rule IDs GATEWAY-AGENT-NO-MODEL, GATEWAY-FALLBACK-DISALLOWED, GATEWAY-QUOTA-INVERTED, etc.

Output

Default Markdown after generate:

# AI Gateway Config: <project.name> (env=prod)

✅ Wrote .claude/ai-gateway.prod.json (merged template + project context)

Models:
- Allowlist:        claude-sonnet, gpt-5, sf-proprietary
- Default:          claude-sonnet
- Per-agent:        order_helper → claude-sonnet, support_triage → claude-sonnet

Quotas:
- Org tokens/hour:  10,000,000
- Per-agent:        1,000,000
- Per-agent rate:   600 req/min
- Max context:      100,000 tokens
- Max output:       4,096 tokens

Fallback:
- Policy:           degrade
- Chain:            claude-sonnet → gpt-5 → sf-proprietary → refuse
- Refuse after:     3 attempts

Audit:
- Log all:          true
- Retain:           365 days
- Alert webhook:    https://hooks.slack.com/... (from notifications.webhooks.slack)

## Next steps
- Apply via the org's AI Gateway admin (Setup → Einstein → AI Gateway → Import)
- Schedule periodic /argo:gateway-config --validate runs to detect drift
- Review /argo:trust-eval reports to tune token quotas based on actual usage

--validate output:

# Gateway Config Validation: <project.name> (env=prod)

✅ Allowlist:    valid
✅ Default model: in allowlist
✅ Fallback chain: in allowlist
⚠️ Per-agent override: support_triage references "claude-haiku" not in allowlist (GATEWAY-FALLBACK-DISALLOWED)
✅ Quotas:       per-agent ≤ org-wide
✅ Webhook:      resolves

Exit codes

  • 0 — config written or validate clean
  • 1 — --validate found issues
  • 2 — invocation error

Rules

  • Don't write secrets. Webhook URLs are sensitive; the file should reference ${SLACK_WEBHOOK_URL} env var indirection rather than the literal URL where possible
  • Per-env scoping is normal. dev caps low; prod caps high. Use override files
  • Don't auto-apply. This skill writes config; an operator imports it into the org's Gateway. Don't try to PUT it via API automatically (gateway changes are operator decisions)
  • Validate before deploy. Recommend running --validate on PR; failed validation blocks the merge in CI
  • Quotas are guardrails, not optimization. Set them generously enough that legitimate users don't hit them, low enough that runaway agents can't drain credits

Consumers

  • Gateway operators (admins) import the JSON via Setup
  • /argo:agent-deploy cross-references the agent against the gateway model allowlist; warns if a deployed agent references a non-allowed model
  • /argo:trust-eval references quota-exceeded events captured in the audit log

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.