Skip to main content
Use AvertaDecisionClient when you need to call Averta directly instead of using a provider wrapper.
import { AvertaDecisionClient } from "@averta-security/sdk-core";

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

Options

OptionRequiredDescription
avertaApiKeyYesRuntime Averta API key.
avertaBaseUrlNoDefaults to https://api.averta.io.
decisionTimeoutMsNoDefaults to 30000. Set 0 to disable the SDK-managed timeout.
fetchNoCustom fetch implementation.
clientMetadataYesAdapter name and version sent as client metadata.

Methods

MethodCheckpoint
preflight(...)Request and tool exposure
checkToolCall(...)Model-requested tool calls
checkToolResult(...)Returned tool content
checkOutput(...)Final model output
If your provider has a first-class wrapper, use the wrapper instead. Hand-rolling the lifecycle is more code and easier to get wrong.