v0.1.0 — the guardian layer for AI agents
Base URL: https://haldir.xyz/v1
Auth: Authorization: Bearer hld_your_key or X-API-Key: hld_your_key
Create an API key. First key requires no auth.
curl -X POST https://haldir.xyz/v1/keys \
-H "Content-Type: application/json" \
-d '{"name": "my-app", "tier": "pro"}'
Create a scoped agent session.
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}'
Get session info including remaining budget.
Revoke a session immediately.
Check if a session has a permission. Body: {"scope": "write"}
Store an encrypted secret.
curl -X POST https://haldir.xyz/v1/secrets \
-H "Authorization: Bearer hld_xxx" \
-H "Content-Type: application/json" \
-d '{"name": "stripe_key", "value": "sk_live_xxx", "scope_required": "read"}'
Retrieve a secret. Pass X-Session-ID header for scope enforcement.
List all secret names (never values).
Delete a secret permanently.
Authorize a payment against a session's budget.
curl -X POST https://haldir.xyz/v1/payments/authorize \
-H "Authorization: Bearer hld_xxx" \
-H "Content-Type: application/json" \
-d '{"session_id": "ses_xxx", "amount": 29.99, "description": "API subscription"}'
Log an agent action.
curl -X POST https://haldir.xyz/v1/audit \
-H "Authorization: Bearer hld_xxx" \
-H "Content-Type: application/json" \
-d '{"session_id": "ses_xxx", "tool": "stripe", "action": "charge", "cost_usd": 29.99}'
Query audit trail. Params: session_id, agent_id, tool, flagged=true, limit.
Spend summary by tool. Params: session_id, agent_id.
Add an auto-approval rule. Types: spend_over, tool_blocked, destructive, all.
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}'
Request human approval for an action.
Check approval status (agent polls this).
Approve a pending request.
Deny a pending request.
List all pending approval requests.
Register a webhook. Events: all, anomaly, approval_requested, budget_exhausted.
curl -X POST https://haldir.xyz/v1/webhooks \
-H "Authorization: Bearer hld_xxx" \
-H "Content-Type: application/json" \
-d '{"url": "https://hooks.slack.com/xxx", "events": ["anomaly", "approval_requested"]}'
List registered webhooks.
MCP JSON-RPC endpoint for AI assistants. Supports initialize, tools/list, tools/call, resources/list, prompts/list.
MCP server discovery metadata.
© 2026 Haldir · haldir.xyz