cd /news/ai-safety/tracepath-i-built-an-ai-agent-audit-… · home topics ai-safety article
[ARTICLE · art-56546] src=dev.to ↗ pub= topic=ai-safety verified=true sentiment=↑ positive

Tracepath — I Built an AI Agent Audit Middleware in One Weekend

A developer built Tracepath, an open-source middleware that makes AI agents auditable, traceable, and compliant with regulations like the EU AI Act and FINRA. The tool intercepts every tool call, signs it with Ed25519, checks it against OPA policies, stores it in an immutable WORM log, and monitors for anomalies in real-time. It features a dashboard with tabs for Audit, Incidents, Policies, Reports, and Gemini for semantic incident classification.

read5 min views1 publishedJul 12, 2026

This is a submission for Weekend Challenge: Passion Edition

Tracepath is an open-source middleware that makes any AI agent — LangChain, CrewAI, AutoGen, or your own — auditable, traceable, and compliant with regulations like the EU AI Act and FINRA.

It's a full audit stack you can spin up with a single docker compose up

. Every tool call your agent makes gets intercepted, signed with Ed25519, checked against OPA policies, stored in an immutable WORM log, and monitored in real-time for anomalies.

"Can you audit what your agents did yesterday?"— Tracepath answers that.

Five tabs: Audit (event trail), Incidents (real-time detection), Policies (versioned OPA rules with diff & rollback), Reports (FINRA & EU AI Act compliance), and Gemini (semantic incident classification).

I didn't start in AI. I started in security.

When I began working in tech, I specialized in web application security — OWASP Top 10, XSS, CSRF, DoS attacks. I spent years thinking about how to control what applications do, how to prevent them from being abused, how to draw a boundary between "allowed" and "denied."

Then AI happened. And I fell in love with building agents — autonomous systems that can reason, use tools, and make decisions. But the security part of my brain wouldn't shut up:

That's the passion. Marrying the two halves of my career: the security engineer who says "trust nothing, verify everything" and the AI builder who wants agents to be powerful and autonomous.

The EU AI Act was the spark. When I read Article 50 — the requirement for high-risk AI systems to maintain logs and enable human oversight — I realized: this is exactly what I spent years doing for web apps, but nobody's built it for AI agents yet.

So I built it. In one weekend. Because that's what passion does — it makes you forget to sleep.

Quick tour of all five dashboard tabs: Audit, Incidents, Policies, Reports, and Gemini.

git clone https://github.com/nujovich/tracepath.git
cd tracepath/docker
AUDIT_SIGNING_KEY=$(openssl rand -hex 32) docker compose up -d

Then open http://localhost:3000

. You'll see:

Tab What it shows
Audit
Every tool call signed, policy-checked, stored in PostgreSQL + MinIO WORM
Incidents
Real-time detection: denial spikes, budget overruns, suspicious patterns, rate limit breaches
Policies
Git-based OPA versioning with visual diff and one-click rollback
Reports
One-click FINRA and EU AI Act compliance reports
Gemini
Google Gemini 2.5 Flash classifying incidents — "this is a misconfiguration, not an attack"
curl -X POST http://localhost:9001/audit/step \
  -H "Content-Type: application/json" \
  -d '{
    "session_id":"demo","agent_id":"researcher","agent_type":"researcher",
    "step_number":1,"tool_name":"web_search",
    "tool_input":{"q":"EU AI Act Article 50"},
    "tool_output":{"results":3},"cost_cents":5,
    "timestamp":"2026-07-12T12:00:00Z"
  }'

Every event is:

Auditable multi-agent middleware for AI governance. Make any agent framework (LangChain, CrewAI, AutoGen, LangGraph) compliant with EU AI Act, FINRA, and SOC2 — in a single docker compose up

.

"Can you audit what your agents did yesterday?"Tracepath answers that with immutable Ed25519-signed logs, real-time policy enforcement, and a compliance dashboard.

🏆

Submitted to— Best Use of Google AI category[DEV Weekend Challenge: Passion Edition]

git clone https://github.com/nujovich/tracepath.git
cd tracepath/docker
AUDIT_SIGNING_KEY=$(openssl rand -hex 32) docker compose up -d
http://localhost:3000

Five tabs: Audit, Incidents, Policies, Reports, and Gemini.

The stack:

The core pipeline: intercept → sign → check → store. I built the Rust gateway with actix-web, embedded OPA WASM for policy evaluation, and wired Ed25519 signing. PostgreSQL for the queryable audit log, MinIO with S3 Object Lock for immutable WORM storage.

Streamed events from the gateway to NATS JetStream, then built a Python incident detector that watches for four anomaly types: denial spikes, budget overruns, suspicious patterns, and rate limit breaches. All surfaced in a React dashboard with real-time polling.

Implemented git-based policy versioning. Every OPA policy change is a git commit. Built a visual diff viewer and one-click rollback in the dashboard. Added a replay engine that lets you replay historical events against a different policy version to answer: "What would have happened if this policy was active then?"

Generated FINRA and EU AI Act compliance reports as HTML. Integrated Google Gemini 2.5 Flash via OpenRouter as a semantic classifier — it takes threshold-triggered incidents and refines their severity by analyzing the context. A denial spike from a misconfigured policy gets downgraded from CRITICAL to WARNING. A real attack stays CRITICAL.

The Gemini integration caches classifications persistently, so the dashboard shows the reasoning behind every severity decision even between container restarts.

Article 50 of the EU AI Act requires high-risk AI systems to:

Tracepath implements all three. The FINRA report validates data integrity (Ed25519 signatures), record retention (WORM storage), and access controls (API authentication).

I'm submitting to Best Use of Google AI.

Tracepath uses Gemini 2.5 Flash (via Google AI) as a semantic classifier that refines incident severity. Instead of blindly flagging every threshold breach as CRITICAL, Gemini analyzes the context:

Incident Original Severity Gemini Reasoning Final Severity
6 image_generate denials in a session
CRITICAL "All denials were for image generation, suggesting a misconfiguration rather than a malicious attempt"
WARNING
Budget exceeded by 2x in a single session WARNING "The tools used match a legitimate research workflow with no policy bypass attempts"
INFO

This is the difference between a noisy alert system and a useful one — and it's powered by Google AI.

This is a weekend project, but it's not a toy. The roadmap:

@audit

decorator parity→ Star the repo to follow along.

Built with ❤️🔥 by Nadia Ujovich — a security engineer turned AI builder who still believes the best agents are auditable ones.

── more in #ai-safety 4 stories · sorted by recency
── more on @tracepath 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/tracepath-i-built-an…] indexed:0 read:5min 2026-07-12 ·