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

# Request checkpoint

> Use the low-level SDK to evaluate provider input before the upstream call.

## Create a decision client

```typescript theme={null}
import { AvertaDecisionClient } from "@averta-security/sdk-core";

const client = new AvertaDecisionClient({
  avertaApiKey: process.env.AVERTA_API_KEY!,
  clientMetadata: {
    name: "my-custom-adapter",
    version: "0.1.0",
  },
});
```

## Send a request checkpoint

```typescript theme={null}
const decision = await client.preflight({
  provider: {
    name: "anthropic",
    operation: "messages.create",
    model: "claude-sonnet-4-5",
  },
  payload: {
    text: "Summarize this document.",
  },
  requestContext: {
    conversationId: "conversation_123",
    requestId: "request_456",
    traceId: "trace_789",
  },
});
```

## Handle the decision

```typescript theme={null}
if (decision.decision === "block") {
  throw new Error(decision.reasons[0]?.message ?? "Request blocked");
}

const blockedTools = decision.blockedTools ?? [];
```

For request checkpoints, valid decisions are `allow`, `block`, and `restrict_tools`.
