Trail every Claude call
One wrapper on your Anthropic client, and every messages.create call your agents make becomes a signed, append-only loop event — recorded in the request path, automatically, which is exactly what the EU AI Act's "automatic logging" language asks for.
pip install looptail # anthropic SDK stays yours, any versionimport anthropic
import looptail
from looptail import instrument
looptail.init(app="support-agent")
client = instrument.anthropic(anthropic.Anthropic())
# call sites don't change — every call is now recorded
response = client.messages.create(
model="claude-opus-4-8",
max_tokens=1024,
messages=[{"role": "user", "content": "How do I get a refund?"}],
)What gets recorded
Each call appends one observe event to .looptail/support-agent.jsonl: provider and API, the model id, a truncated input preview, a truncated output preview,input_tokens / output_tokens from the response's usage block, the stop reason, and the call duration. Failures are recorded too — the exception is captured as an event and re-raised, so instrumentation never changes your control flow. Every event is hash-chained to the one before it and Ed25519-signed at write time; any later edit, deletion, or reorder of past records is detectable by anyone:
npx @looptail/cli verify --app support-agent
✔ 1,204 loop events
✔ chain intact · signatures valid- 14:03:12observesupport-agent · ticket #4211 answered · outcome pendingsig 9f3a…c2 ✓
- 14:03:14evaluaterubric refund-policy-v3 scored 0.94 · passsig 41bc…88 ✓
- 14:07:02issuecluster #18 "partial refunds mis-quoted" +1 casesig 77e0…4d ✓
- 14:21:40improvepatch #91 proposed · prompt diff +12 −4 · replay 132/132 passsig b8d1…09 ✓
- 14:29:05approvepatch #91 approved → canary 5%sig e42f…7a ✓
Why not just log it yourself
You could — every team does, and every team's logs end up mutable, partial, and scattered. The point of instrumentation is that the record is complete by construction (an engineer can't forget to log a decision) and evidence-grade by default (signed, append-only, exportable as aself-verifying pack). Score the recorded calls against your own policies with rubric evaluators — judge models included, on models you choose. Local-first: no account needed until you wanthosted sync and signed receipts.