
AgentLens
io.github.agentkitaiPublished by GitHub account agentkitaiv0.13.7Updated Oct 24, 2026
Tamper-evident, SHA-256 hash-chained audit trail and observability for AI agents.
Overview
Lets an assistant query an AgentLens observability server for AI agent sessions, events, LLM analytics, costs, health scores, and tamper-evident audit trails.
- What you can do
- AgentLens is an observability and audit-trail platform for AI agents. Its MCP server exposes 22 tools covering core observability, intelligence and analytics, and operations, so an assistant can inspect sessions and event timelines, search events, review LLM call analytics, token usage and cost, check agent health scores, and work with the SHA-256 hash-chained audit log. It talks to a separately running AgentLens server over HTTP.
- When to use it
- Worth adding when you already run an AgentLens instance and want an assistant to read or operate on agent telemetry and audit records from Claude Desktop, Cursor, or another MCP client. It is not useful on its own, since it only queries an AgentLens server.
- Requirements
- A local Node.js runtime to run the npm package @agentkitai/agentlens-mcp via npx, plus a reachable AgentLens server. The documented configuration sets AGENTLENS_API_URL and AGENTLENS_API_KEY; the API key is created on the AgentLens server and shown only once. The manifest declares no authentication or environment variables.
Installation
In SourceWeft
- Open AgentLens in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
🔍 AgentLens
Open-source observability for AI agents — with a tamper-evident audit trail
Every event SHA-256 hash-chained & cryptographically verifiable — built for EU AI Act Article 12 record-keeping
[PyPI] [npm server] [npm mcp] [License: MIT] [Build Status] [Container: ghcr.io/agentkitai/agentlens]
📖 Documentation · Quick Start · Dashboard · ☁️ Cloud
📑 Table of Contents
- Tamper-Evident by Design
- Quick Start
- Architecture
- Integration Guides
- Key Features
- Dashboard
- AgentLens Cloud
- Packages
- API Overview
- CLI
- Development
- Contributing
- AgentKit Ecosystem
- License
AgentLens is a flight recorder for AI agents. It captures every LLM call, tool invocation, approval decision, and error — then presents it through a queryable API and real-time web dashboard.
🔒 Tamper-evident by design
What sets AgentLens apart from other observability tools: every event is SHA-256 hash-chained to the one before it, the same way git commits and blockchains are linked. The audit log is append-only and cryptographically verifiable — alter, delete, or reorder a single record after the fact and verification fails, pointing at the exact event that broke. Purpose-built for the record-keeping obligations of EU AI Act Article 12 and the emerging IETF Agent Audit Trail work.
See it for yourself in 30 seconds (needs Docker):
The demo ingests a real trace, verifies the chain (passes), edits one record directly in the database behind the audit log's back, then re-verifies (fails). Auditors get a signed, verifiable JSON snapshot from GET /api/audit/verify/export.
Five ways to integrate — pick what fits your stack:
🚀 Quick Start
One command — server + dashboard on SQLite, zero config:
Or without Docker:
AUTH_DISABLED=trueis for a quick local trial (JWT_SECRETis still required by the hardened image). For anything shared, dropAUTH_DISABLED, set a realJWT_SECRET, and create an API key (below).
Full stack (Postgres + Redis, auth, TLS) — runs from source:
Create an API Key
Save the als_... key from the response — it's shown only once. Then head to the Integration Guides to instrument your agent.
🏗️ Architecture
🔧 Integration Guides
🔭 OpenTelemetry (any GenAI agent — no SDK)
If your agent is already instrumented with the OpenTelemetry GenAI semantic conventions — via OpenLLMetry, OpenInference, or the official OTel instrumentations — just point its OTLP exporter at AgentLens. No AgentLens SDK required.
AgentLens maps gen_ai.* spans into its model and into the tamper-evident audit log:
Each OTel trace maps to a session (or gen_ai.conversation.id if present), and every event is hash-chained like any other — so traces from any GenAI framework get the same verifiable audit trail. Set OTLP_AUTH_TOKEN to require a bearer token on the OTLP endpoints in production.
Cost with no SDK: OTel GenAI instrumentation reports tokens but rarely cost. AgentLens reconstructs
costUsdfrom the model's per-1M-token pricing (fuzzy-matched on the model id), so OTel-only agents get the same cost analytics as SDK-instrumented ones — no per-call cost attribute required.
🤖 OpenClaw Plugin
If you're running OpenClaw, the AgentLens plugin captures every Anthropic API call automatically — prompts, completions, token usage, costs, latency, and tool calls.
Set AGENTLENS_URL if your AgentLens instance isn't on localhost:3400. See the plugin README for details.
🐍 Python Auto-Instrumentation
One line — every LLM call captured automatically across 9 providers (OpenAI, Anthropic, LiteLLM, AWS Bedrock, Google Vertex AI, Google Gemini, Mistral AI, Cohere, Ollama):
Key guarantees: ✅ Deterministic · ✅ Fail-safe · ✅ Non-blocking · ✅ Privacy (init(redact=True))
🔌 MCP Integration
For Claude Desktop, Cursor, or any MCP client — add to your config:
AgentLens ships 22 MCP tools — covering core observability, intelligence & analytics, and operations. Full MCP tool reference →
📦 Programmatic SDK
Python:
TypeScript:
✨ Key Features
- 🐍 Python Auto-Instrumentation —
agentlensai.init()captures every LLM call across 9 providers automatically. Deterministic — no reliance on LLM behavior. - 🔌 MCP-Native — Ships as an MCP server. Works with Claude Desktop, Cursor, and any MCP client.
- 🔭 OpenTelemetry GenAI — Ingests
gen_ai.*OTLP traces from any OTel-instrumented agent (OpenLLMetry, OpenInference, official OTel) — no AgentLens SDK required. - 🧠 LLM Call Tracking — Full prompt/completion visibility, token usage, cost aggregation, latency measurement, and privacy redaction.
- 📊 Real-Time Dashboard — Session timelines, event explorer, LLM analytics, cost tracking, and alerting.
- 🔒 Tamper-Evident Audit Trail — Append-only event storage with SHA-256 hash chains per session.
- 💰 Cost Tracking — Track token usage and estimated costs per session, per agent, per model. Alert on cost spikes.
- 🚨 Alerting — Configurable rules for error rate, cost threshold, latency anomalies, and inactivity.
- ❤️🩹 Health Scores — 5-dimension health scoring with trend tracking.
- 💡 Cost Optimization — Complexity-aware model recommendation engine with projected savings.
- 📼 Session Replay — Step-through any past session with full context reconstruction.
- ⚖️ A/B Benchmarking — Statistical comparison of agent variants using Welch's t-test and chi-squared analysis.
- 🛡️ Guardrails — Automated safety rules with dry-run mode for safe testing.
- 🔌 Framework Plugins — LangChain, CrewAI, AutoGen, Semantic Kernel — auto-detection, fail-safe, non-blocking.
- 🔗 AgentKit Ecosystem — Integrations with AgentGate, FormBridge, Lore, and AgentEval.
- 🔒 Tenant Isolation — Multi-tenant support with per-tenant data scoping and API key binding.
- 🏠 Self-Hosted — SQLite by default, no external dependencies. MIT licensed.
📸 Dashboard
AgentLens ships with a real-time web dashboard for monitoring your agents.
📸 Dashboard Screenshots (click to expand)
Overview — At-a-Glance Metrics
The overview page shows live metrics — sessions, events, errors, and active agents — with a 24-hour event timeline chart, recent sessions with status badges, and a recent errors feed.
Sessions — Track Every Agent Run
Every agent session with sortable columns: agent name, status, start time, duration, event count, error count, and total cost.
Session Detail — Timeline & Hash Chain
Full event timeline with tamper-evident hash chain verification. Filter by event type, view cost breakdown.
Events Explorer — Search & Filter Everything
Searchable, filterable view of every event across all sessions.
🧠 LLM Analytics — Prompt & Cost Tracking
Total LLM calls, cost, latency, and token usage across all agents with model comparison.
🧠 Session Timeline — LLM Call Pairing
LLM calls in session timeline with model, tokens, cost, and latency.
💬 Prompt Detail — Chat Bubble Viewer
Full prompt and completion in a chat-bubble style viewer with metadata panel.
❤️🩹 Health Overview — Agent Reliability
5-dimension health score for every agent with trend tracking.
💡 Cost Optimization — Model Recommendations
Analyzes LLM call patterns and recommends cheaper model alternatives with confidence levels.
📼 Session Replay — Step-Through Debugger
Step through any past session event by event with full context reconstruction.
⚖️ Benchmarks — A/B Testing for Agents
Create and manage A/B experiments with statistical significance testing.
🛡️ Guardrails — Automated Safety Rules
Create and manage automated safety rules with trigger history and activity feed.
☁️ AgentLens Cloud
Don't want to self-host? AgentLens Cloud is a fully managed SaaS — same SDK, zero infrastructure:
- Same SDK, one parameter change — switch
url=tocloud=True - Managed Postgres — multi-tenant with row-level security
- Team features — organizations, RBAC, audit logs
- No server to run — dashboard at app.agentlens.ai
📖 Cloud Setup Guide · Migration Guide · Troubleshooting
📦 Packages
Python (PyPI)
TypeScript / Node.js (npm)
🔌 API Overview
⌨️ CLI
Both commands support --format json for machine-readable output. See agentlens health --help for all options.
🛠️ Development
Requirements: Node.js ≥ 20.0.0 · pnpm ≥ 10.0.0
🤝 Contributing
We welcome contributions! See CONTRIBUTING.md for setup instructions, coding standards, and the PR process.
🧰 AgentKit Ecosystem
📄 License
Source: README.md at commit 78fe5eb
Tools
0Version history
1- v0.13.7LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts