# Raw Claude (no framework) (/docs/typescript/cookbook/raw-claude)



If you're calling the Anthropic client directly — no Vercel AI SDK — screen
the prompt yourself before the call. If Tawa blocks or leans toward
blocking, the request is rejected without ever reaching Claude.

```ts
import Anthropic from "@anthropic-ai/sdk";
import { TawaGuard } from "@tawaguard/sdk";

const anthropic = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });
const tawa = await TawaGuard.create(process.env.TAWA_API_KEY!);

const BLOCKED_ACTIONS = new Set(["block", "hard_block", "soft_block"]);

async function chat(userMessage: string) {
  const scan = await tawa.analyze(userMessage);

  if (BLOCKED_ACTIONS.has(scan.action) || scan.suggestion === "block") {
    throw new Error("Message blocked by content policy.");
  }

  return anthropic.messages.create({
    model: "claude-opus-5",
    max_tokens: 1024,
    messages: [{ role: "user", content: userMessage }],
  });
}
```

<Callout type="info">
  On Next.js with the Vercel AI SDK? The [Vercel AI SDK
  integration](/docs/typescript/integrations/vercel-ai-sdk) wraps this
  pattern for you — no manual check needed at every call site. It works with
  any AI SDK provider, including `@ai-sdk/anthropic`, not just OpenAI.
</Callout>
