Logging the right things at agent runtime makes the difference between debugging in 5 minutes vs. 5 days. Here is the schema we deploy with every enterprise AI engagement.
The Minimum Viable Agent Log Schema
- 01trace_id + span_id (OpenTelemetry)
Always start here. Every agent call gets a trace.
- 02Input payload + content hash
Hash for replay; payload for debugging.
- 03Prompt version (git SHA) + model version
Pin the exact prompt + model that produced the output.
- 04Tool calls — name, input, output, latency
Every tool invocation, fully serialized.
- 05Token counts (input, output, cached)
Cost reconciliation + drift detection.
- 06Validation gate results
Schema pass/fail, range checks, anomaly checks.
- 07Final action taken (or human-review fallback)
Closes the audit loop.
Sample Log Record
{
"trace_id": "01HZQ3...4F",
"span_id": "7B91...8A",
"agent": "ticket-triage-v2",
"prompt_sha": "abc123",
"model": "claude-3-7-sonnet-20250219",
"input_hash": "sha256:5f...e2",
"tool_calls": [
{"name": "fetch_customer_tier", "input": {"customer_id": "c-882"}, "latency_ms": 38},
{"name": "fetch_recent_tickets", "input": {"customer_id": "c-882"}, "latency_ms": 112}
],
"tokens": {"input": 1840, "output": 220, "cached": 980},
"validation": {"schema_ok": true, "range_ok": true},
"result": {"category": "billing", "priority": "P2", "confidence": 0.91},
"action_taken": "routed_to_billing_queue"
}
Ready to optimize your cloud or AI footprint?
Book a free 30-minute architecture review. We will deliver a written cost-and-architecture audit within 48 hours.
Need help with AI agent observability?
Ohveda runs free 30-minute architecture reviews. We will identify your top opportunities in writing within 48 hours — at no cost.