← Vetro Attest · Free Art. 12/14 checker · Free EU AI Act tools
Audit log for LangChain agents
LangChain exposes a callback system that fires on every LLM call, tool call and chain step. That is the right place for an audit log: it sees everything, and it needs no changes to your chains.
What to record
handleLLMStart/handleLLMEnd: the model, the request, the response, token usage.handleToolStart/handleToolEnd/handleToolError: the tool name, arguments and result.- Chain and agent boundaries, so each run has a clear start and end.
LangChain's own tracing sends these to an observability backend. That is useful for debugging, but the records live in a system your team can edit, which is not what an auditor wants (see audit trail for AI agents).
The Vetro handler
Vetro ships a duck-typed callback handler (no dependency on langchain itself) that mirrors a run into a signed ledger:
import { Vetro } from '@vetro/core';
import { createVetroCallbackHandler } from './langchain-callback.mjs';
const run = vetro.startRun({ name: 'support-agent' });
const handler = createVetroCallbackHandler(run);
await agent.invoke(input, { callbacks: [handler] });
run.end();
Every event is hash-chained to the previous one and the run is signed with ed25519. Policies are checked in handleLLMStart and handleToolStart, before the call runs.
One caveat worth knowing
LangChain's callback manager may swallow exceptions thrown by handlers, depending on version and configuration. The policy check still runs before the action and the decision is recorded, but a block only stops the chain if your setup propagates callback errors. Test it on your version before relying on it for hard blocking.
If you already use OpenTelemetry
If your LangChain app is instrumented with an OpenTelemetry GenAI instrumentation, you can start from the traces you already export (see OpenTelemetry GenAI traces as evidence).
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, the countersigned EU AI Act report costs 29 USD, one-off: an ed25519 counter-signature over your evidence plus a mapping to the articles, including an explicit list of what the log cannot show.
See a sample ledger verified in one click, check your own logs free or get the countersigned EU AI Act report.