Skip to main content

Scenario

A Vercel AI route can invoke tools that change infrastructure state. Middleware should enforce policy before execution.

Example App

Reference implementation: examples/vercel-ai-ops-gate/
  • uses createAttestaMiddleware
  • sets timeout + failMode: escalate
  • treats denied/escalated outcomes as non-executable paths

Core Pattern

Production Notes

  • fail closed for unknown tool categories
  • map escalation events into your incident/change-control channel
  • keep policy defaults in one config path and reuse across routes