Agent Observability
Design trace and audit logging for agent runs, including tool calls, cost attribution, and tamper-evident schemas.
$12
Agent Observability
Example session with this skill installed
Design a schema for tracing a multi-agent research workflow that includes tool calls and cost tracking. Focus on auditability and PII safety.
- Read your context and instructions
- Compiled the agent observability
I have designed the observability schema for your research workflow. This model uses a hierarchical step structure to link parent plans to tool outputs while keeping user data secure via hashing.
Agent Trace Schema (SQL/JSON)
| Field | Type | Description | Purpose |
|---|---|---|---|
run_id | UUID | Unique identifier for the session | Primary Key |
parent_step_id | UUID | Links to the step that spawned this | Tree Reconstruction |
type | Enum | llm, tool, decision, error | Categorization |
input_hash | String | SHA-256 of the input payload | PII-Safe Audit |
output_hash | String | SHA-256 of the output payload | Tamper Evidence |
tokens_total | Integer | Sum of input and output tokens | Cost Attribution |
cost_usd | Decimal | Calculated cost of the specific step | Billing/ROI |
latency_ms | Integer | Time elapsed during execution | Perf Monitoring |
metadata | JSONB | Version of prompt and skill used | Drift Detection |
Next steps
- Implement an
agent_stepstable in your database with these fields and a GIN index onrun_id. - Wrap your tool execution loop in a decorator that calculates hashes and emits these records.
- Set up an alert for
retry_count > 2to catch agents stuck in silent error loops.
Connects securely to your tools. The creator never sees your data.
About this skill
Agents fail in ways standard logs cannot explain. Silent retries, cost spikes, and logic drift often happen inside a black box, leaving developers unable to debug or audit behavior. This skill provides a concrete observability model for tracing agent execution, tool usage, and decision-making.
What it does
- Trace individual steps by recording LLM calls, tool executions, and internal decisions as a linked tree.
- Implement cost attribution at the step level to identify exactly where token usage spikes occur.
- Maintain PII-safe logs by focusing on input and output hashes rather than full data payloads.
- Reconstruct agent trees using parent-child step IDs to map nested plan-to-tool-to-subagent workflows.
- Enforce tamper-evidence through immutable, append-only records designed for audit trails.
How it works
- Initialize the run schema including model identifiers, prompt versions, and skill versions used.
- Instrument step tracking for every LLM call or tool execution, capturing tokens, cost, and latency.
- Log decision rationale to capture why an agent chose one tool or path over another.
- Export run summaries to trigger alerts based on cost thresholds or retry loops.
Frameworks & tools
Works with any agentic architecture including LangChain, CrewAI, and custom Python/Node.js agent loops. It is designed for implementation in SQL databases, document stores like MongoDB, or JSONL-based logging pipelines.
Why this beats prompting it yourself
Prompting an agent to "be observable" doesn't produce the structured schema needed for production monitoring. This skill provides the engineering requirements for an immutable trace system that supports invoice defense and high-scale debugging.
Use cases
- Debug silent agent failures where a tool is called incorrectly or loops.
- Justify costs to customers by providing granular, step-by-step invoice traces.
- Monitor prompt drift by comparing step hashes across different skill versions.
- Alert on cost blowouts before they drain an API credit balance.
Known limitations
This skill provides a design model and schema rather than a specific library or NPM package. Developers must handle their own storage backend and dashboarding UI.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 5 days ago
Requires
Nothing to install.
Permissions
No special permissions declared or detected
What's inside
Frequently Asked Questions
New in LLM Ops
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.