Skip to main content
The Anthropic wrapper intentionally fails closed for unsupported inputs. That is not a nice-to-have; silently skipping a checkpoint would be a security bug.

Supported

CapabilityStatus
client.messages.create(...)Supported for non-streaming calls.
Request preflightSupported for latest user text and supported base64 images.
User-defined client toolsSupported when tools have a stable name.
Tool exposure filteringSupported through request decisions and restrict_tools.
Tool-call checksSupported for returned tool_use blocks.
Tool-result checksSupported for pure tool-result continuation turns.
Output checks and rewritesSupported for non-streaming final text.

Not Supported Yet

Input or APIBehavior
messages.create({ stream: true })Fails closed before Anthropic is called.
messages.stream(...)Fails closed before Anthropic is called.
URL image sourcesFails closed.
GIF imagesFails closed.
Document blocksFails closed.
Non-text tool-result blocksFails closed.
Mixed tool-result continuation turnsFails closed.
Server-hosted Anthropic toolsFails closed in the current wrapper.
Bedrock or Vertex Anthropic clientsNot covered by the current JavaScript wrapper docs.

Rich Media Rules

Supported image blocks must use:
{
  type: "image",
  source: {
    type: "base64",
    media_type: "image/jpeg", // or image/png, image/webp
    data: imageBase64,
  },
}
Any other media shape is rejected before request preflight.

Error Handling

Unsupported inputs and blocked checkpoints throw AvertaSdkError from @averta-security/sdk-core.
import { AvertaSdkError } from "@averta-security/sdk-core";

try {
  await client.messages.create({
    model: process.env.ANTHROPIC_MODEL ?? "claude-sonnet-4-5",
    max_tokens: 512,
    stream: true,
    messages: [{ role: "user", content: "Hello" }],
  });
} catch (error) {
  if (error instanceof AvertaSdkError) {
    console.error(error.code);
  }
}
Use non-streaming messages.create(...) when you need Averta request, tool, tool-result, and output checks around Anthropic today.