
AgentLens
io.github.agentkitai由 GitHub 帳號 agentkitai 發布v0.13.7更新於 Oct 24, 2026
Tamper-evident, SHA-256 hash-chained audit trail and observability for AI agents.
概覽
讓助理查詢 AgentLens 可觀測性伺服器,取得 AI 代理工作階段、事件、LLM 分析、成本、健康分數與防竄改稽核軌跡。
- 可以做什麼
- AgentLens 是針對 AI 代理的可觀測性與稽核軌跡平台。其 MCP 伺服器提供 22 個工具,涵蓋核心可觀測性、智慧分析與維運,助理可藉此檢視工作階段與事件時間軸、搜尋事件、查看 LLM 呼叫分析、token 用量與成本、檢查代理健康分數,並使用以 SHA-256 雜湊鏈建立的稽核日誌。它透過 HTTP 與另外執行的 AgentLens 伺服器通訊。
- 適用情境
- 當你已經執行 AgentLens 執行個體,並希望助理從 Claude Desktop、Cursor 或其他 MCP 用戶端讀取或操作代理遙測與稽核記錄時,值得加入。它本身無法獨立運作,只能查詢 AgentLens 伺服器。
- 執行需求
- 需要本機 Node.js 執行環境,透過 npx 執行 npm 套件 @agentkitai/agentlens-mcp,並需要可連線的 AgentLens 伺服器。文件中的設定會設定 AGENTLENS_API_URL 與 AGENTLENS_API_KEY;API 金鑰在 AgentLens 伺服器上建立且僅顯示一次。清單未宣告任何驗證或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 AgentLens,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
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
來源:README.md,提交 78fe5eb
工具
0版本歷史
1- v0.13.7最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分