← Blog

Agno Audit Logs: Separate Traces from Runs and Approval Records

Parminder Singh
Parminder Singh··6 min read
Summarize with AI

Agno spreads operational evidence across OpenTelemetry traces, run and session records, approval records, and authentication context. This guide maps each record to the question it can answer, identifies the configuration that preserves user attribution, and shows where an independent LLM request decision record still belongs.

Platform & Architectureai-securityauditforensic-auditagentic-aiidentity-and-authorization
Agno Audit Logs: Separate Traces from Runs and Approval Records

Agno can record one agent execution in several places. OpenTelemetry spans describe model calls and tool execution. Session and run tables preserve runtime state. Approval records show how a protected action was resolved. JWT configuration determines which caller identity can reach AgentOS in the first place. Calling this collection "the Agno audit log" hides the evidence boundaries an investigator needs.

I would treat those records as separate exhibits. A trace can explain execution without proving that the attached user value came from a verified token. An approval can prove a stored resolution without proving who your application allowed to resolve it. The useful review starts by naming each record and the question it answers.

TL;DR

  • Agno tracing writes aggregate traces and individual spans, covering model calls and tools as well as teams and workflow steps.
  • Sessions and runs live in storage domains separate from approvals and traces, and each answers different audit questions.
  • User attribution depends on JWT verification and scope enforcement, with deliberate propagation of the verified subject.
  • Routed LLM calls still need an independent policy decision record tied to the authenticated caller.

Agno tracing records the execution tree

Agno's Agent Observability documentation says tracing=True instruments agent and team operations plus workflow operations. The built-in database exporter writes aggregate records to agno_traces and individual spans to agno_spans. A span can represent a model call, tool execution, team coordination step, or workflow step. The aggregate trace can carry run, session, user, and component identifiers when those values are present.

That creates a useful execution tree. An engineer can open one run and follow the model hops and nested agent activity, including tool inputs and outputs. The same documentation also names two limits worth putting in the collection procedure. Tracing is skipped with a warning when Agno has no database to use, and an existing OpenTelemetry provider prevents Agno's setup from silently replacing that provider or adding its database exporter.

The first audit test should trigger a known run, retrieve its trace and spans, and confirm the expected exporter received them. A configuration screenshot proves intent. The stored records prove operation.

Storage separates evidence by domain

The Agent Storage inventory lists the records AgentOS can persist. agno_sessions holds session metadata and state. Backends with normalized run storage use agno_runs for per-run records. OpenTelemetry evidence lands in agno_traces and agno_spans. Human-in-the-loop requests use agno_approvals, while evaluation and metric records use their own tables.

This separation is sensible, and it changes collection. A trace explains the path through models and tools. A run record anchors execution to a session. An approval record shows a pending request and its resolution. None should be substituted for another because their write conditions differ.

Picture an incident review with four tabs open in a SQL client: one session row, two run rows, a trace tree, and a resolved approval. The timestamps may line up, yet the records still need stable identifiers to join them. I would reject a collection plan that relies on a Control Plane screenshot alone. Preserve the database rows or exported OpenTelemetry records. Preserve the query time and the identifiers used for correlation.

This is narrower than the general AI agent observability problem. Agno supplies the runtime evidence. The reviewer's job is to show which parts survived and how they join.

Trace detail creates a sensitive evidence store

Agno states that trace attributes can contain prompts, tool arguments, and model output. The tracing overview also says application inputs and outputs can appear in trace payloads. That makes the trace database useful during an investigation and sensitive during normal operation.

Access and retention decisions belong in the evidence design before tracing is enabled. Export decisions belong there too. The database account used by AgentOS needs only the permissions required to write and query the selected tables. Investigators need a documented read path. External OpenTelemetry exporters need an explicit data review because moving spans to another service can move prompt content and tool arguments with them.

Agno supports a dedicated trace database through the AgentOS db setting. The documentation presents that split as a way to isolate high-volume trace writes and manage retention separately. It also gives security teams a cleaner access boundary. The runtime database can retain session state under one grant set, while the trace database uses a narrower investigator group and its own retention rule.

User IDs become audit evidence only after identity verification

The Security and Auth documentation describes JWT signature verification and endpoint scope checks when AgentOS authorization is enabled. Audience verification requires verify_audience=True. For JWT callers, user isolation is opt-in and uses the verified sub claim as user_id when enabled. The default leaves user isolation off.

These settings affect the meaning of a user field inside a trace. A populated identifier shows that a value was attached. Strong attribution requires evidence that AgentOS verified the token, checked the intended audience, enforced the endpoint scope, and threaded the verified subject into the run. This is the same distinction behind the AI agent post-authentication gap: login identity and per-operation identity can diverge when an application drops context between layers.

Test attribution with two users and one service account. Each principal should produce a run whose trace and session records plus approval records can be distinguished without relying on a display name. Then attempt a cross-user read using a non-admin token. An admin scope bypasses user isolation by design, so preserve admin use as a separate access event in the surrounding identity system.

Approval records need their own authorization evidence

Agno's approval workflow persists a pending record when a protected tool pauses a run. An administrator can resolve that record, and the run can continue by run ID after the stored resolution has been checked. Audit-mode approvals record the outcome of a normal human-in-the-loop interaction without adding a second administrator gate.

The documentation assigns authorization of run resolution and continuation to the application. A trusted SDK caller can also provide resolved requirements directly. An approved row therefore proves the stored state transition. The surrounding application and identity records prove that the resolver was entitled to make it.

For a deletion or payment action, including bulk email, collect the pending approval, resolver identity, resolution time, continued run, and resulting tool span. This produces a complete chain without asking one table to prove more than it contains. I would put the point bluntly. An approval dashboard is an interface. An audit package needs the underlying evidence.

An Agno evidence acceptance test

A production acceptance test should retrieve one deliberately chosen run and answer five questions:

  • Which authenticated principal started it, and which token claim supplied that identity?
  • Which session and run records anchor the execution?
  • Which model and tool spans were exported, and where were they stored?
  • Which approval record governed a protected action, and who was authorized to resolve it?
  • Which record shows the policy decision on the outbound LLM request?

The first four questions are Agno configuration and evidence questions. The fifth belongs at the routed model-call boundary. Signed audit logs for AI requests describes the independent record needed there: caller identity, destination, policy version, decision, timestamp, and integrity evidence.

DeepInspect

Agno's traces remain the source for execution detail inside the framework. DeepInspect covers a narrower path: authenticated HTTP requests deliberately routed from the Agno application to an LLM endpoint. It evaluates application-supplied identity and role, prompt classification, destination, and versioned policy before forwarding permitted traffic.

Each routed decision produces an independent record that can be joined to Agno's run and trace identifiers. Tool execution inside AgentOS, local state changes, approval resolution, and calls that bypass the proxy remain outside that record. That boundary gives an investigator two honest views: what Agno executed and what the LLM request policy allowed.

Book a technical deep dive at deepinspect.ai.

Frequently asked questions

Does Agno have one audit log?

Agno distributes evidence across several stores. Traces and spans describe execution. Session and run records preserve runtime history. Approval records capture pending and resolved human-in-the-loop requests. Authentication and authorization records establish access to AgentOS. A useful audit procedure names each source and joins them with run, session, trace, user, and component identifiers.

Does an Agno trace prove who initiated the run?

A trace can carry a user identifier when one is present. Attribution depends on the path that supplied it. Verify JWT signatures, enforce the intended audience, check endpoint scopes, and propagate the verified subject into the run. A string in a trace has evidentiary value only when the collection can show how that string was bound to the authenticated caller.

What happens when tracing has no database?

Agno's observability documentation says tracing is skipped and AgentOS logs a warning when no database is available through AgentOS or its native components. Acceptance testing should trigger a known run and retrieve the resulting trace. Startup configuration alone leaves this failure mode untested.

Are approval records enough for high-risk tool actions?

Approval records show the request and stored resolution. The application remains responsible for authorizing the person or service that resolves and continues the run. Preserve the identity event, authorization decision, approval row, continued run, and resulting tool span as one evidence chain.