# Cookbook (/docs/typescript/cookbook)



Task-oriented walkthroughs, adapted from the example files shipped in the
SDK's repository — copy-pasteable further than the snippets on the
reference pages.

<Cards>
  <Card title="RAG protection" href="/docs/typescript/cookbook/rag-protection" description="Scan retrieved documents before they're stitched into a prompt." />

  <Card title="Agent protection" href="/docs/typescript/cookbook/agent-protection" description="Scan a tool call before executing it, and its output before it re-enters the loop." />

  <Card title="Raw OpenAI" href="/docs/typescript/cookbook/raw-openai" description="Screen a prompt before an OpenAI call, no framework." />

  <Card title="Raw Claude" href="/docs/typescript/cookbook/raw-claude" description="Screen a prompt before a Claude call, no framework." />

  <Card title="Next.js Route Handler" href="/docs/typescript/cookbook/nextjs-route-handler" description="Wire a scan into an App Router API route." />
</Cards>

<Callout type="info">
  Building with the Vercel AI SDK? That has its own dedicated page under
  [Integrations](/docs/typescript/integrations) — you generally won't need
  the raw patterns here for that stack.
</Callout>
