DEV Community

RK
RK

Posted on

I built an open-source audit trail for AI agents (after mine silently failed for hours)

The problem

I was running a multi-agent pipeline and one of my agents silently failed. The only alert I got said "daily loss limit reached" — completely misleading. The real cause was a missing file the agent never reported.

I had zero visibility into what any agent had actually done.

What I built

AgentLens — a Python SDK for AI agent governance. Three modules:

  • Audit trail — every LLM call and tool use logged to SQLite automatically
  • Authorization — policy-based gates so agents can only call what you've approved
  • Anomaly detection — baseline + threshold config, alerts when behavior drifts

One-line integration

Drop-in for Anthropic:


python
from agentlens.integrations.anthropic import TracedAnthropic

client = TracedAnthropic(agent_id="my-agent")
response = client.messages.create(...)  # auto-traced
Enter fullscreen mode Exit fullscreen mode

Top comments (0)