
Haldir
io.github.ExposureGuard由 GitHub 帳號 ExposureGuard 發布v0.1.0更新於 Oct 24, 2026
Guardian layer for AI agents: identity, secrets, audit via MCP.
概覽
Haldir 是給 AI 代理的治理層,透過 MCP 提供工作階段權限、加密機密保管庫、支出上限與可驗證的稽核紀錄。
- 可以做什麼
- 建立、查詢與撤銷具權限範圍的代理工作階段,並檢查權限。儲存、列出與取出保管庫中的機密,代理僅在範圍允許下取得。授權付款並查詢支出,依工作階段預算控管。寫入稽核紀錄、查詢稽核軌跡,並驗證雜湊鏈、取得樹頭、包含證明與一致性證明。申請人工核准、查詢核准狀態,產出合規分數與證據包。
- 適用情境
- 當你讓 AI 代理呼叫工具、動用金錢或讀取憑證,並需要權限範圍、支出上限、加密保管庫與可驗證的稽核紀錄時適用。也適合需要人工核准與合規證據包的場景。
- 執行需求
- 以本機程序執行,需安裝 PyPI 套件 haldir 並具備 Python 環境。MCP 伺服器需設定 HALDIR_API_KEY 環境變數,金鑰由 haldir serve 或 haldir login 產生。自架需本機服務與資料庫,雲端版本需網路連線。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Haldir,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Haldir
Scoped permissions, spend caps, an encrypted vault, and an audit log that can prove it wasn't edited — for AI agents that call tools, move money, and read secrets.
[tests] [PyPI] [License: MIT] [GitHub Stars]
That loop is the whole idea, running live. Someone rewrites a row in the audit log — silently, straight in the database. The entry's inclusion proof no longer matches the live Merkle root, and the verdict flips. Not caught by monitoring, not caught by a diff: caught by arithmetic, because the root is a hash of what the log actually contains and the earlier Signed Tree Head is already pinned somewhere you don't control.
→ Try it yourself. Run haldir serve (below) and open http://127.0.0.1:8000/demo — the same tamper demo, against an instance on your own machine. It ships inside the package, so there is nothing to download and no account involved.
What you get
- Scoped sessions — permissions and spend caps per agent, revocable the moment something looks wrong.
- Encrypted vault — AES-256-GCM. Your agent asks for a secret; the model never sees it. Every ciphertext records which key made it, so you can rotate the encryption key without re-entering a single secret — and without downtime.
- Tamper-evident audit — every call logged into an RFC 6962 Merkle tree with signed tree heads, so history can be proven, not just trusted.
- Human approvals — pause a run on a spend threshold and get a webhook.
That starts a real Haldir on this machine — SQLite, no Docker, no Postgres, no account. It generates an encryption key, applies the schema, mints an API key, and points the CLI at itself, so the next command just works:
From there, point anything at it — the CLI, the Python SDK, an MCP client — or read the API reference at /docs on the instance you started. When you want Postgres and containers, haldir init && haldir dev scaffolds and runs that instead; SELF_HOSTING.md covers the rest.
Works with Claude Code, Cursor, LangChain, CrewAI, AutoGen, LlamaIndex and the Vercel AI SDK — anything that can make an HTTP call or speak MCP. MIT licensed: self-host it, or point at haldir.xyz (free tier, no signup).
See it in action
Here's what Haldir actually looks like — no diagrams, no spec sheets, just screenshots of the real thing.
Without Haldir, an agent calls whatever API it wants, spends whatever it wants, and accesses whatever secret it finds — with zero oversight and zero audit trail. With Haldir, every action is scoped, spend-limited, logged immutably, and secrets never leave the vault.
Here's the three things you'd see as a new visitor, in order:
[Quick tour: landing page, cloud dashboard, audit trail]
-
Landing page — dark mode, live terminal animation at the top, four product cards (Gate, Vault, Watch, Proxy), a self-host vs cloud comparison, and a call to claim a design partner spot. One page, everything a first-time visitor needs.
-
Cloud dashboard — this is what you see after signing in. A sidebar on the left takes you to any page — account, quotas, sessions, audit, webhooks, approvals, compliance, or settings. The account view shows your tenant, tier, live counts, and API keys by prefix (the full key is never shown again after it's minted, and revoking one never involves a database shell).
-
Audit trail — the killer feature. Filter by session, agent, or tool. Click any row to see the full MCP call details: what tool was called, what upstream API it hit, how long it took, what arguments it sent, and what it returned. This is the one thing that makes the whole product click — you can see exactly what every agent did, when, and with what.
Here's the dashboard with the important parts labeled:
[Cloud dashboard with annotations: sidebar, stat cards, sessions table, audit table]
The sidebar on the left takes you anywhere. The numbered markers point at the parts you'll actually use: your tenant and tier, the live counts, and your API keys by prefix — with the revoke button right there, so ending an agent's access never means opening a database shell.
Play with it yourself
All of these ship inside the package and are served by haldir serve, so they work on your machine with no account and nothing to deploy:
→ The tamper demo at /demo/tamper — the one in the GIF above. Rewrite a real log row and watch the inclusion proof stop matching the Merkle root. Nothing is simulated; it is the same Merkle code the API ships.
→ The playground at /demo — four steps walk the happy path (mint a key, open a scoped session, check a permission, write to the audit trail), then three try to break it: spend past the cap, revoke the session mid-flight, and act after revocation. Pick a scope that was never granted in step 03 to see a denial as well as an approval.
→ The gallery at /gallery — every screenshot on this page in one place, if you'd rather look than read.
Want something to run without installing anything? There is a one-file demo binary — no Python, no clone — and a three-probe fixture that ships with the package. Both are in DEMO.md: what to run, what you'll see, and what each probe is built to catch.
The rest of the API
The full reference is at /docs and /openapi.json on whichever instance you are running. Below: the Python quickstart, performance numbers, and compliance mapping.
There is a hosted option at haldir.xyz — free tier, no signup. haldir serve is the path that works today, and the one to reach for if the cloud is not what you want anyway.
Two ways to run
Same product either way.
The cloud tier is free to start and needs no signup. We're taking 5 design partners — 30 days, full access, direct line to the founder: [email protected].
Self-host in 5 minutes
Full self-hosting guide: SELF_HOSTING.md
Cloud (no setup)
That's it — point at https://haldir.xyz, no signup for the free tier.
CLI
Install once, drive the whole platform from the terminal:
haldir --help lists every command and CLI.md is the full
reference — what each one does, the flags it takes, and which commands support
--json (not all of them do; the reference says which).
Why Haldir
AI agents are calling APIs, spending money, and accessing credentials with zero oversight. Haldir is the missing layer:
Everything on the right is one process in front of your tools. Your agent keeps its existing tool calls; Haldir answers first:
[Haldir architecture: Agent → Proxy → (Gate/Vault/Watch/Policy) → Upstream APIs]
Quick Start (Python)
Under the hood that's four HTTP calls — mint a key, open a session, check a permission, write to the audit chain:
Products
Gate — Agent Identity & Auth
Scoped sessions with permissions, spend limits, and TTL. No session = no access.
Vault — Encrypted Secrets & Payments
AES-encrypted storage. Agents request access; Vault checks session scope. Payment authorization with per-session budgets.
Watch — Audit Trail & Compliance
Immutable log for every action. Anomaly detection. Cost tracking. Compliance exports.
Proxy — Enforcement Layer
Sits between agents and MCP servers. Every tool call is intercepted, authorized, and logged. Supports policy enforcement: allow lists, deny lists, spend limits, rate limits, time windows.
Approvals — Human-in-the-Loop
Pause agent execution for human review. Webhook notifications. Approve or deny from dashboard or API.
MCP Server
Haldir is available as an MCP server with 19 tools for Claude, Cursor, Windsurf, and any MCP-compatible AI:
MCP Tools (the process above registers all 19):
There is one tool catalog. The stdio server (haldir-mcp, or haldir mcp serve) registers all 19; the hosted POST /mcp endpoint implements a 10-tool subset under the same names. A name means the same thing on both surfaces, so a client written against one works against the other.
MCP HTTP Endpoint: POST https://haldir.xyz/mcp
Performance
Haldir is fast enough to sit in the hot path of every agent tool call without becoming the bottleneck.
Single-box HTTP throughput (gunicorn 4 workers, 32 concurrent clients, tuned SQLite backend, every request goes through the full middleware stack — auth, validation, idempotency, metrics, structured logging):
Hardware: 12th-gen Intel Core i3-1215U (8 cores, 8 GB RAM). SQLite is configured with WAL + synchronous=NORMAL + 256 MiB mmap + in-memory temp store — the session-lookup p99 dropped by 52 % versus the untuned path. Postgres deployments (configurable pool via HALDIR_PG_POOL_MIN/MAX) flatten the p99 further still; enable via DATABASE_URL=postgresql://....
Primitive cost (pure-Python, no I/O):
Agents typically wait 500-3000 ms for an LLM completion and 100-1000 ms for an upstream API call, so Haldir's overhead sits inside the noise. Reproduce locally:
Compliance
One endpoint produces an auditor-ready proof-of-control pack covering eight sections, each anchored to a SOC2 trust services criterion:
The pack signs itself: a SHA-256 over the canonical JSON of sections 1-7. An auditor receiving an archived pack can re-call /v1/compliance/evidence/manifest and confirm the digest matches — proof the document was not modified after issuance.
JSON for evidence-locker upload, Markdown for the "show this to the auditor" moment, both from the same /v1/compliance/evidence endpoint.
Retention and deletion
Audit data is kept forever by default. When a policy requires otherwise, you can set a window and prune to it — and the prune stays provable:
The audit log is a hash chain, so deleting old entries naively leaves the surviving chain pointing at a hash that no longer exists — which would turn a working audit trail into one that fails verification. Instead, a Signed Tree Head is taken over the log before anything is removed, and the hash of the last deleted entry is recorded as the link across the boundary.
The result is that pruning is not silent. haldir audit verify still passes, and reports what was removed along with the signed Merkle root that commits to it — so the honest answer to an auditor is "entries before this point were deleted under a retention policy, and here is the root they produced at the time." If that commitment cannot be produced, nothing is deleted.
API Reference
Full docs at haldir.xyz/docs — the complete OpenAPI 3.1 spec is at haldir.xyz/openapi.json.
Key endpoints (see the spec for the full surface):
Agent Discovery
Haldir is discoverable through every major protocol:
Design partners wanted
Live now: haldir.xyz · API Docs · OpenAPI Spec · Smithery
We're taking 5 design partners — 30 days free, full access, direct line to the founder. If you're shipping AI agents to production, email [email protected].
License
MIT
Links
- Website: haldir.xyz
- API Docs: haldir.xyz/docs
- Smithery: View on Smithery
- PyPI: haldir
- OpenAPI: haldir.xyz/openapi.json
來源:README.md,提交 a8235e3
工具
0版本歷史
1- v0.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分