Latten

What is @latten/sdk?

@latten/sdk is observe-only TypeScript instrumentation for AI apps. It tracks LLM calls, data touches, external APIs, cost, reach, actor attribution, and PII exposure while returning the wrapped function's result unchanged.

See it on a live graph — no signup →

One line around each crossing

Use track around calls where your app reaches a model, database, external API, or another service.

Actor attribution

Use withActor to build the authority chain: who is acting and on whose behalf.

Provider usage normalization

The SDK reads model, input tokens, cached input tokens, output tokens, and reasoning tokens from common OpenAI, Anthropic, and Gemini response shapes.

How it works

  1. 1. Install npm install @latten/sdk.
  2. 2. Initialize Call init with LATTEN_TOKEN or use the hosted defaults.
  3. 3. Seed actors Wrap requests or jobs with withActor.
  4. 4. Track crossings Wrap LLM and data calls with track.

Common questions

Does @latten/sdk block requests?

No. It is observe-only and designed not to throw into the host app.

Does it send PII values?

No. PII is counted locally and sent as types and counts, never values.

Can Codex install it?

Yes. @latten/installer can place @latten/sdk calls in a reviewable PR.