@xcert-eu/ai-sdk
v0.1.1
Published
Instrument AI/LLM interactions for tamper-evident, non-repudiable certification via xcert.eu's self-hosted Sigstore trust stack.
Readme
@xcert-eu/ai-sdk
Instrument AI/LLM interactions — prompts, responses, tool calls, RAG context,
token usage — for tamper-evident, non-repudiable certification via
xcert.eu's self-hosted Sigstore trust stack. Same
infrastructure already used to sign code artifacts (Fulcio-free custodial
xcerteu:// org keys, DSSE, self-hosted Rekor) — see
xcert-cli and
xcert-js. Manage API keys and browse
certified sessions at ai.xcert.eu (enable the "AI" product first under
Settings → Products).
Built on real @opentelemetry/api/@opentelemetry/sdk-trace-node — this is
not a fork, and not coupled to any editor or IDE. capture() starts a real
OTel span and exports through a standard SpanExporter, so it works
anywhere Node.js runs: backends, agents, chatbots, MCP servers, CI.
Usage
import { TrustAI } from "@xcert-eu/ai-sdk";
const trust = new TrustAI({
ref: "xcerteu://<org-slug>/<key-id>", // Trust → CLI in your org settings
apiKey: process.env.XCERT_AI_KEY, // Settings → API Keys (xai_...)
});
const response = await trust.capture(
() => llm.invoke(prompt),
{ model: "gpt-4o", prompt, tokenUsage: { promptTokens, completionTokens } }
);
// before process exit
await trust.shutdown();No signing/certificate concerns leak into the call site. Only the SHA-256
hash of each captured event is ever signed and logged to Rekor — raw
prompt/response content never reaches xcert's servers durably (see
xcert/src/lib/ai-attestation.ts in the main xcert repo for the
canonicalize→hash→Merkle→DSSE→Rekor pipeline this SDK feeds).
Status
This is the SDK half of a larger pipeline. XcertSpanExporter posts
directly to xcert's /api/ai/ingest REST endpoint (account.xcert.eu by
default). For non-Node.js clients, or setups that already speak OTLP, see
xcert-otel-collector —
a real OpenTelemetry Collector distribution that any language's native
OTel setup can point at directly, no SDK required.
