[Proposal] Execution provenance exporter for compliance-grade audit trails #5090
Ratnaditya-J
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
ADK's telemetry module (
telemetry/tracing.py) emits OpenTelemetry spans covering agent execution, tool calls, and LLM interactions. This is excellent for debugging and observability.However, enterprises deploying ADK agents in regulated environments (financial services, healthcare, legal, government) need more than observability -- they need provenance: tamper-evident, queryable records that prove what an agent did, with what data, under what authorization, and why. Current OTel spans are mutable, lack cryptographic integrity, and don't capture data lineage or authorization context.
Regulations driving this:
Without a provenance-grade audit trail, ADK agents can't be deployed in these environments regardless of how good the agent logic is.
What's missing vs. what exists
Execution traces -- ADK today: OTel spans via
tracing.py. What's needed: tamper-evident execution records with cryptographic integrity.Data lineage -- ADK today: not tracked. What's needed: which data sources were accessed, transformed, or output by each agent action.
Authorization context -- ADK today: not captured in spans. What's needed: who/what authorized each action, pulled from session state.
Integrity verification -- ADK today: none. What's needed: cryptographic hash chains linking spans so records can't be retroactively modified.
Audit export -- ADK today:
sqlite_span_exporter.py(debug-oriented). What's needed: compliance-ready formats (JSON Lines, SIEM-compatible) that enterprise security teams can ingest.Retention guarantees -- ADK today: in-memory or SQLite debug store. What's needed: append-only, immutable storage suitable for regulatory retention requirements.
Proposed approach
A
ProvenanceExporterthat extends ADK's existing telemetry infrastructure rather than replacing it. This hooks into the same OTel pipeline thattracing.pyandsqlite_span_exporter.pyalready use.What it captures (per agent action)
{ "trace_id": "abc123", "span_id": "def456", "parent_span_id": "ghi789", "timestamp": "2026-03-31T12:00:00Z", "agent_id": "claims_processor", "action": "tool_call", "tool_name": "postgres-execute-sql", "tool_args_hash": "sha256:...", "data_sources_accessed": ["patient_records.claims"], "data_sources_modified": [], "authorization": {"user": "agent_service_account", "scope": "read:claims"}, "result_hash": "sha256:...", "previous_hash": "sha256:...", "signature": "ed25519:..." }Integration points in ADK's architecture
This is achievable through ADK's existing extension points:
BasePlugin.before_tool_callback/after_tool_callback: Capture tool invocation provenance (what was called, with what args, what returned)BasePlugin.before_agent_callback/after_agent_callback: Capture delegation chains (which agent delegated to which sub-agent)telemetry/tracing.py: Existing OTel span pipeline -- provenance records attach as span attributes or export via a parallel exporterevents/: Event system already structures agent lifecycle -- provenance enriches these events with integrity metadatasessions/: Session state provides authorization context that provenance records referenceThe key design decision: this should be a telemetry exporter (like
sqlite_span_exporter.py), not a plugin. Plugins have short-circuit semantics where one plugin returning non-None bypasses subsequent plugins. Provenance recording must never be bypassed -- it should be in the telemetry pipeline, which always runs.This was actually identified as an open problem in the governance callback discussions (#4764): "the short-circuit semantics mean governance callbacks can be bypassed by earlier plugins." Moving audit to the telemetry layer avoids this entirely.
Why this is different from previous governance proposals
To be direct: I've read #4543, #4764, #4517, and #4910. Those proposals bundled policy enforcement + threat detection + access control + audit trails into monolithic governance plugins. This proposal is deliberately narrow:
safety-pluginsand Model Armor handle content safety)This is the audit trail layer that sits underneath any governance framework. Whether you use Google's Model Armor, Microsoft's agent-governance-toolkit, or custom policies -- you still need provenance records of what happened. This is infrastructure, not a framework.
Prior work in this repo
I have an open PR fixing MCP session disconnect handling (#4906) and have been working with the genai-toolbox team on a security audit of database tool permissions (googleapis/genai-toolbox#2716, assigned to @averikitsch). This proposal comes from the same perspective: making ADK safer for production deployments in regulated environments.
What I'm proposing to build
I'm happy to submit a reference implementation as a PR. Specifically:
ProvenanceExporterclass intelemetry/that extends the existing OTel exporter patternThis is open-source work. I maintain SpineFrame, a provenance runtime for AI agents, and would build the ADK exporter to be compatible with SpineFrame's format while being fully standalone -- no external dependencies required.
Open questions for the ADK team
telemetry/the right home for this, or would a dedicatedprovenance/module be preferred?_experimental_semconv.pysemantic conventions, or define new ones?feat: Support AgentRegistry associationlanded 4 days ago)?Happy to discuss and iterate. This is meant as a starting point, not a finished design.
Beta Was this translation helpful? Give feedback.
All reactions