← Vetro Attest · Free Art. 12/14 checker · Free EU AI Act tools

Audit log for DSPy programs

DSPy programs are built from modules that call a shared language model client, often several times per request when a module chains sub-calls or an optimizer has compiled a multi-step prompt. The prompts themselves are generated by DSPy, not written by hand, which makes recording what was actually sent more important, not less.

What to record

Capturing it: wrap the LM client

DSPy has no Vetro integration, and its compilation step means the exact call sequence is decided by the optimizer rather than fixed in your code — so the reliable point to record from is the LM client DSPy calls into, not the module graph. Wrap that client with the Vetro core API before handing it to DSPy:

import { Vetro } from '@vetro/core';
import { wrapOpenAI } from '@vetro/openai';

const vetro = new Vetro();
const run = vetro.startRun({ name: 'dspy-program' });
const client = wrapOpenAI(openaiClient, run);

// configure DSPy's LM to call through `client`

This is a TypeScript example; DSPy itself is Python, so the equivalent is wrapping the underlying model client (or the object your dspy.LM subclass calls into) the same way, at the same boundary — see audit trail for AI agents for the pattern applied consistently across frameworks. If a given DSPy version exposes its own callback or logging hook for LM calls, that is worth checking too, but the client boundary works regardless of version.

Compiled prompts are part of the evidence

An optimizer-compiled DSPy program can produce a materially different prompt after each compilation run. Recording the compiled prompt alongside the model call — not just "module X ran" — is what makes the log useful for Article 11 technical documentation: it shows what the system actually does, not just what it was designed to do.

What a ledger cannot tell you

A signed ledger proves a given prompt was sent and a given response came back; it does not tell you whether the optimizer's choice of few-shot examples was a good one. That judgment still needs your own evaluation harness — the log is evidence for what ran, not a substitute for testing it.

Check your own logs

Paste a Vetro ledger or an OpenTelemetry GenAI trace export into the free checker: it verifies integrity and shows which record-keeping obligations your evidence covers, in your browser. When you need something to hand to an auditor or a customer, Vetro Attest issues a countersigned EU AI Act report for 49 USD, one-off.

See a sample ledger verified in one click, check your own logs free or get the countersigned EU AI Act report.

Pricing