DEV Community

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

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

nujovich on July 12, 2026

This is a submission for Weekend Challenge: Passion Edition What I Built Tracepath is an open-source middleware that makes any AI agent...
Collapse
 
alexshev profile image
Alex Shev

Audit middleware is a strong place to put effort because it sits outside the agent's self-story. The most important thing is that traces are produced as the work happens, not reconstructed afterward. If the agent can write both the action and the explanation after the fact, the audit layer becomes another narrative surface.

Collapse
 
nujovich profile image
nujovich

This is exactly why Tracepath is a gateway — external to the agent, not a library inside it. The agent can't touch its own audit trail. Every event is signed at the boundary before the agent even knows it was recorded. No self-narration, no retroactive explanations. Thanks for this — you nailed the core architectural decision in two sentences!

Collapse
 
alexshev profile image
Alex Shev

That boundary placement is the key design choice. If Tracepath is a gateway, not an agent library, the agent can be observed without being trusted to narrate itself. The signed-at-the-boundary part is what makes the trace useful later, when nobody remembers which explanation came from the system and which came from the model.

Thread Thread
 
nujovich profile image
nujovich

Exactly! You nailed it. The boundary prohibits the agent from "laying" about what it's doing. The narrative stays uncorrupted.

Thread Thread
 
alexshev profile image
Alex Shev

Right. The small typo almost makes the point better: the boundary prevents the agent from laying down its own story as truth. Once the narrative is signed outside the actor, the audit trail can disagree with the explanation instead of being overwritten by it.

Thread Thread
 
nujovich profile image
nujovich

Agreed! And that's what auditing agents are all about

Collapse
 
julianneagu profile image
Julian Neagu

This is the kind of layer agent systems will need as they move into real workflows. Debugging agents without a clear trail gets painful fast. I like the idea of treating audit as part of the runtime.

Collapse
 
nujovich profile image
nujovich

Exactly. Audit shouldn't be a post-processing step you bolt on after something breaks — it needs to be part of the runtime itself. Every tool call signed, checked, and stored before the agent takes its next step. Thanks for reading!

Collapse
 
mads_hansen_27b33ebfee4c9 profile image
Mads Hansen

This is a useful direction. The detail I like most is that you are treating the audit trail as a first-class runtime surface, not as logs someone might inspect later if they remember.

For agent systems, I think the minimum useful audit unit is not just the tool call. It is the lineage around it: prompt/request, selected tool, arguments, policy decision, result metadata, and any follow-up action that used the result.

The Ed25519 + WORM piece is especially interesting because it makes the trail harder to rewrite after the fact. That matters a lot once agents can touch money, customer data, production systems, or regulated workflows.

Collapse
 
nujovich profile image
nujovich

Yes! Especially if they can buy things. I am very active in the Hermes community, and it recently added Stripe skills, which Hermes agents can use to provision SaaS apps for example. This would help to configure policies according to spending.

Collapse
 
voltagegpu profile image
VoltageGPU

Interesting take on AI agent auditing—keeping track of decision trees and external calls is crucial for transparency. Have you considered integrating something like eBPF for lower-level syscall visibility without modifying the agent itself? At work, we sometimes use similar techniques to monitor GPU workloads securely, especially when dealing with confidential computing environments.

Collapse
 
nujovich profile image
nujovich

Great suggestion! eBPF would give visibility one layer below the gateway — at the syscall level, without the agent knowing it's being observed. Not in the MVP, but definitely on the radar for defense-in-depth. Thanks for the nudge!

Collapse
 
voltagegpu profile image
VoltageGPU

Interesting approach to AI agent auditing! Have you considered integrating eBPF for more granular system call tracing without modifying the agent’s code? I've used similar techniques for monitoring GPU workloads on VoltageGPU, and it can help with transparency in execution without performance overhead.