> ## Documentation Index
> Fetch the complete documentation index at: https://attesta.kyberon.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Vercel AI Ops Gate

> Apply Attesta middleware to operations-oriented tool calls

## 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

```typescript theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
import { createAttestaMiddleware } from "@kyberon/attesta/integrations";

const middleware = createAttestaMiddleware({
  failMode: "escalate",
  approvalTimeoutSeconds: 45,
  riskHints: { production: true, external_side_effect: true },
});
```

## 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
