MCP Hub
Back to servers

Haldir

Guardian layer for AI agents: identity, secrets, audit via MCP.

Registry
Updated
Apr 6, 2026

Quick Install

uvx haldir

Haldir — The Guardian Layer for AI Agents

Smithery Score PyPI License: MIT

Identity, secrets, and audit for AI agents. MCP-native. Model-agnostic.

Haldir enforces governance on every AI agent tool call — scoped sessions, encrypted secrets, spend limits, immutable audit trail, human-in-the-loop approvals, and a proxy that intercepts every MCP call before it reaches your tools.

Live now: haldir.xyz · API Docs · OpenAPI Spec · Smithery

Why Haldir

AI agents are calling APIs, spending money, and accessing credentials with zero oversight. Haldir is the missing layer:

Without HaldirWith Haldir
Agent has unlimited accessScoped sessions with permissions
Secrets in plaintext env varsAES-encrypted vault with access control
No spend limitsPer-session budget enforcement
No record of what happenedImmutable audit trail
No human oversightApproval workflows with webhooks
Agent talks to tools directlyProxy intercepts and enforces policies

Quick Start

pip install haldir
from sdk.client import HaldirClient

h = HaldirClient(api_key="hld_xxx", base_url="https://haldir.xyz")

# Create a governed agent session
session = h.create_session("my-agent", scopes=["read", "spend:50"])

# Store secrets agents never see directly
h.store_secret("stripe_key", "sk_live_xxx")

# Retrieve with scope enforcement
key = h.get_secret("stripe_key", session_id=session["session_id"])

# Authorize payments against budget
h.authorize_payment(session["session_id"], 29.99)

# Every action is logged
h.log_action(session["session_id"], tool="stripe", action="charge", cost_usd=29.99)

# Revoke when done
h.revoke_session(session["session_id"])

Products

Gate — Agent Identity & Auth

Scoped sessions with permissions, spend limits, and TTL. No session = no access.

curl -X POST https://haldir.xyz/v1/sessions \
  -H "Authorization: Bearer hld_xxx" \
  -H "Content-Type: application/json" \
  -d '{"agent_id": "my-bot", "scopes": ["read", "browse", "spend:50"], "ttl": 3600}'

Vault — Encrypted Secrets & Payments

AES-encrypted storage. Agents request access; Vault checks session scope. Payment authorization with per-session budgets.

curl -X POST https://haldir.xyz/v1/secrets \
  -H "Authorization: Bearer hld_xxx" \
  -H "Content-Type: application/json" \
  -d '{"name": "api_key", "value": "sk_live_xxx", "scope_required": "read"}'

Watch — Audit Trail & Compliance

Immutable log for every action. Anomaly detection. Cost tracking. Compliance exports.

curl https://haldir.xyz/v1/audit?agent_id=my-bot \
  -H "Authorization: Bearer hld_xxx"

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.

# Register an upstream MCP server
curl -X POST https://haldir.xyz/v1/proxy/upstreams \
  -H "Authorization: Bearer hld_xxx" \
  -H "Content-Type: application/json" \
  -d '{"name": "myserver", "url": "https://my-mcp-server.com/mcp"}'

# Call through the proxy — governance enforced
curl -X POST https://haldir.xyz/v1/proxy/call \
  -H "Authorization: Bearer hld_xxx" \
  -H "Content-Type: application/json" \
  -d '{"tool": "scan_domain", "arguments": {"domain": "example.com"}, "session_id": "ses_xxx"}'

Approvals — Human-in-the-Loop

Pause agent execution for human review. Webhook notifications. Approve or deny from dashboard or API.

# Require approval for spend over $100
curl -X POST https://haldir.xyz/v1/approvals/rules \
  -H "Authorization: Bearer hld_xxx" \
  -H "Content-Type: application/json" \
  -d '{"type": "spend_over", "threshold": 100}'

MCP Server

Haldir is available as an MCP server with 10 tools for Claude, Cursor, Windsurf, and any MCP-compatible AI:

{
  "mcpServers": {
    "haldir": {
      "command": "haldir-mcp",
      "env": {
        "HALDIR_API_KEY": "hld_xxx"
      }
    }
  }
}

MCP Tools: createSession, getSession, revokeSession, checkPermission, storeSecret, getSecret, authorizePayment, logAction, getAuditTrail, getSpend

MCP HTTP Endpoint: POST https://haldir.xyz/mcp

Architecture

Agent (Claude, GPT, Cursor, etc.)
    │
    ▼
┌─────────────────────────────┐
│       Haldir Proxy          │  ← Intercepts every tool call
│  Policy enforcement layer   │
└──────┬──────────┬───────────┘
       │          │
  ┌────▼────┐ ┌───▼────┐
  │  Gate   │ │ Watch  │
  │identity │ │ audit  │
  │sessions │ │ costs  │
  └────┬────┘ └────────┘
       │
  ┌────▼────┐
  │ Vault   │
  │secrets  │
  │payments │
  └────┬────┘
       │
       ▼
  Upstream MCP Servers
  (your actual tools)

API Reference

Full docs at haldir.xyz/docs

EndpointMethodDescription
/v1/keysPOSTCreate API key
/v1/sessionsPOSTCreate agent session
/v1/sessions/:idGETGet session info
/v1/sessions/:idDELETERevoke session
/v1/sessions/:id/checkPOSTCheck permission
/v1/secretsPOSTStore secret
/v1/secrets/:nameGETRetrieve secret
/v1/secretsGETList secrets
/v1/secrets/:nameDELETEDelete secret
/v1/payments/authorizePOSTAuthorize payment
/v1/auditPOSTLog action
/v1/auditGETQuery audit trail
/v1/audit/spendGETSpend summary
/v1/approvals/rulesPOSTAdd approval rule
/v1/approvals/requestPOSTRequest approval
/v1/approvals/:idGETCheck approval status
/v1/approvals/:id/approvePOSTApprove
/v1/approvals/:id/denyPOSTDeny
/v1/approvals/pendingGETList pending
/v1/webhooksPOSTRegister webhook
/v1/webhooksGETList webhooks
/v1/proxy/upstreamsPOSTRegister upstream
/v1/proxy/toolsGETList proxy tools
/v1/proxy/callPOSTCall through proxy
/v1/proxy/policiesPOSTAdd policy
/v1/usageGETUsage stats
/v1/metricsGETPlatform metrics

Agent Discovery

Haldir is discoverable through every major protocol:

URLProtocol
haldir.xyz/openapi.jsonOpenAPI 3.1
haldir.xyz/llms.txtLLM-readable docs
haldir.xyz/.well-known/ai-plugin.jsonChatGPT plugins
haldir.xyz/.well-known/mcp/server-card.jsonMCP discovery
haldir.xyz/mcpMCP JSON-RPC
smithery.ai/server/haldir/haldirSmithery registry
pypi.org/project/haldirPyPI

License

MIT

Links

Reviews

No reviews yet

Sign in to write a review