TypeScript SDK
Captures LLM agent trajectories from @anthropic-ai/sdk, openai, and the Vercel AI SDK, and ships them to the Verdict ingest API.
Pre-release. The SDK is not published yet.
The package below is not on a public registry yet, so the install command will not work today. The API shown here is a preview of the shipping interface. Want early access? Sign in to request it.
Install
Once the package is published, install with your package manager:
pnpm add @verdict-trace/sdk
npm install @verdict-trace/sdk
bun add @verdict-trace/sdkQuickstart
import { configure, settingsFromEnv, trace, instrument } from "@verdict-trace/sdk";
configure(settingsFromEnv());
await instrument();
await trace("my-agent", { userQuery: "hello" }, async (t) => {
t.addStep({ type: "decision", payload: { choice: "greet" } });
// Any anthropic/openai call inside here is auto-captured
});Environment
VERDICT_API_KEY(required)VERDICT_BASE_URL(ingest API,https://verdict-api.jaitly.cloud)VERDICT_BATCH_SIZE(default50)VERDICT_FLUSH_MS(default200)VERDICT_BUFFER_DIR(default$HOME/.verdict/buffer)
Dead-letter files
Dead-letter files contain sensitive, unredacted data.
When a request to the ingest API cannot be delivered after retries are exhausted, the SDK writes the full request body to a JSON file in VERDICT_BUFFER_DIR. That body includes raw trajectory and step payloads as captured, which may contain full prompts, model responses, and any other data your application passed into addStep(). This can include PII or credentials. These files are written in plain text and are not encrypted or redacted by the SDK.
- Point
VERDICT_BUFFER_DIRat a private, non-shared directory with restrictive permissions, not a world-readable temp directory. - Do not sync, back up, or ship this directory anywhere you would not ship raw production prompts and responses.
- Clear it out after
recoverDeadletter()successfully re-delivers records, or on a regular schedule.
Runtime support
Node 18+, Bun 1.0+, Deno 1.40+.