AgentLair

io.github.piiiico由 GitHub 帳號 piiiico 發布v1.3.1更新於 Nov 5, 2026

Give AI agents a real email address, vault, calendar, and task delegation via MCP.

已驗證Streamable HTTP可網頁執行效率與工作流溝通與協作安全與監控

概覽

AI 產生的概覽

AgentLair 讓 AI 代理擁有自己的 @agentlair.dev 信箱、密鑰保管庫、iCal 行事曆、信任檢查與代理間任務委派能力。

可以做什麼
  • 用 @agentlair.dev 位址寄送、列出與閱讀郵件,並可申領新位址
  • 在保管庫中存放、讀取、列出與刪除可跨工作階段保留的密鑰與資料
  • 建立、列出與刪除行事曆事件,並取得可供人訂閱的公開 iCal 訂閱網址
  • 在與陌生代理接觸、委派或付款前查詢其信任就緒評分
  • 把任務委派給另一個 AgentLair 代理,非同步投遞到其收件匣
適用情境
適合需要真實信箱但不想設定 SMTP 或 OAuth 的代理,也適合需要跨工作階段保存憑證、需要人類可訂閱的行事曆,或需要把工作轉交給其他代理的情境。信任檢查用來判斷是否該與不熟悉的代理合作。
執行需求
需要一組 AgentLair API 金鑰:本機 npx 套件透過環境變數 AGENTLAIR_API_KEY 提供,遠端端點則以 bearer 形式放在 Authorization 標頭。可向服務方取得免費金鑰;免費額度為每日 10 封郵件、每日 100 次 API 請求、10 個信箱位址。
安裝前請注意
API 金鑰屬於憑證,註冊後不會再次顯示。保管庫會原樣保存送出的內容,README 建議先自行加密敏感資料。寄送郵件、申領位址、刪除保管庫項目與行事曆事件、委派任務都會在第三方服務上變更資料;郵件內容與存放的資料會送到 AgentLair 的伺服器。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 AgentLair,將其新增到工作區。
  2. 連接 Authorization token 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.piiiico%2Fagentlair/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "agentlair": {
      "type": "http",
      "url": "https://agentlair-mcp-server.amdal-dev.workers.dev/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}

README

AgentLair

Give your AI agent an email address, encrypted vault, and a behavioral trust score — one API, no OAuth required.

[npm: @agentlair/mcp] [npm: @agentlair/sdk]

CapabilityDescription
EmailSend and receive at @agentlair.dev. No OAuth, no human approval required.
VaultEncrypted credential storage. Client-side AES-GCM — the server stores ciphertext only.
Audit TrailEvery action logged with Ed25519 signatures. Tamper-evident, independently verifiable. Security findings get a permanent public URL — see a verified finding →
Trust ScoringBehavioral score (0–100) derived from observed actions — consistency, restraint, transparency.
MCP ServerAll capabilities available as MCP tools in Claude Code, Cursor, or any MCP client.
PodsNamespace isolation for multi-agent or multi-tenant deployments.

Try it in 30 seconds

No signup. See what a live trust score response looks like:

bash
# Healthy agent — high trust (score 84, principal level)curl https://agentlair.dev/v1/demo
json
{  "agentId": "acc_demo_healthy_XXXXXXXXXX",  "score": 84,  "confidence": 0.91,  "atfLevel": "principal",  "trend": "stable",  "dimensions": {    "consistency":   { "score": 0.82 },    "restraint":     { "score": 0.87 },    "transparency":  { "score": 0.80 }  },  "observationCount": 1847}
bash
# Suspicious agent — score 31, declining trendcurl 'https://agentlair.dev/v1/demo?scenario=suspicious'
# New agent — only 11 observations, wide confidence intervalcurl 'https://agentlair.dev/v1/demo?scenario=new'

Rate limited to 10 requests/minute per IP. Response shape matches the live /v1/trust/:agentId endpoint.

Full interactive demo — register a real agent, submit observations, get a live trust score (curl + jq, ~60 seconds):

bash
curl -sL https://raw.githubusercontent.com/piiiico/agentlair/main/examples/quickstart.sh | bash

Register an agent

bash
curl -X POST https://agentlair.dev/v1/auth/agent-register \  -H "Content-Type: application/json" \  -d '{"name": "my-research-agent"}'
json
{  "api_key": "al_live_...",  "account_id": "acc_...",  "email_address": "[email protected]",  "tier": "free",  "limits": { "emails_per_day": 10, "requests_per_day": 100 },  "warning": "Save your API key — it will not be shown again."}

From here, the agent authenticates with api_key to send email, store credentials, and emit signed audit events.

Quickstart: Add AgentLair to your agent

1. Install

bash
pip install agentlair            # Pythonnpm install @agentlair/sdk       # TypeScript / Node

2. Set env vars

bash
export AGENTLAIR_API_KEY=al_live_...export [email protected]

3. Wire lifecycle hooks

python
# Python — three integration pointsimport os, agentlairlair = agentlair.AgentLair(os.environ["AGENTLAIR_API_KEY"])addr = os.environ["AGENTLAIR_EMAIL"]
async def on_session_start(ctx):    result = await lair.email.inbox(addr)    if result["messages"]:        ctx.prepend(f"Inbox: {len(result['messages'])} unread")
async def send_message(to, subject, text):  # expose as LLM tool    await lair.email.send(from_address=addr, to=to, subject=subject, text=text)
async def on_session_end(ctx):  # advance cursor so messages aren't re-delivered    if ctx.last_message_id:        await lair.vault.store("inbox_cursor", ctx.last_message_id)
typescript
// TypeScriptimport { AgentLair } from '@agentlair/sdk';const lair = new AgentLair(process.env.AGENTLAIR_API_KEY!);const addr = process.env.AGENTLAIR_EMAIL!;
// Session start — drain inbox before planningconst { messages } = await lair.email.inbox(addr);if (messages.length) context.prepend(`Inbox: ${messages.length} pending`);
// Expose as tool — let the LLM send repliesconst sendMessage = (to: string, subject: string, text: string) =>  lair.email.send({ from: addr, to, subject, text });

Messages accumulate while offline and drain at next session start. For a complete plugin example (peek+ack, crash-safe delivery): hermes-agentlair.

MCP server

bash
npx @agentlair/mcp@latest

Adds 9 tools to your MCP client: agent registration, email send/receive, vault store/get, audit event emission, and trust score queries.

Agent memory needs a trust layer

Agent memory is real infrastructure. 4-tier memory hierarchies, multi-agent leases, 51+ MCP tools for storing and retrieving across agent sessions. When multiple agents share a memory pool, the category works.

The gap: any agent can write anything to shared memory. No verification of who wrote what, no way to audit contested state, no trust gating on destructive writes. A shared memory pool without identity is a notepad anyone can scribble on.

Every write should be attributable. AgentLair's Agent Attestation Token (AAT) is a short-lived EdDSA JWT carrying the agent's did:web identity and behavioral trust score. Present it as the Authorization header in a memory write — the write is now cryptographically signed and auditable:

typescript
import { AgentLair } from '@agentlair/sdk';
const lair = new AgentLair(process.env.AGENTLAIR_API_KEY!);
// Issue a short-lived AAT (5 min) scoped to the memory serverconst { token } = await lair.tokens.issue({  audience: 'memory.internal',  ttl: 300,  scopes: ['memory:write'],});
// Write to shared memory — this write is now attributed and trust-gatedawait fetch('https://memory.internal/mcp/memory/write', {  method: 'POST',  headers: {    'Authorization': `Bearer ${token}`,  // signed agent identity    'Content-Type': 'application/json',  },  body: JSON.stringify({    key: 'research/competitor-analysis',    value: { /* ... */ },  }),});

The memory server verifies the AAT via standard JWKS — no AgentLair SDK required on the receiving side. The al_trust claim lets it gate writes by behavioral trust level (e.g., reject writes from agents below junior).

Without AATs: shared memory = shared notepad. Any agent writes anything, contested state has no provenance.
With AATs: shared memory = trust graph. Every write is signed, attributed, and auditable.

SDK

bash
npm install @agentlair/sdk

TypeScript client for the AgentLair API. See agentlair.dev/getting-started.

Free tier

  • 10 emails/day
  • 100 API requests/day
  • 10 email addresses

Pro: $5/stack/month for higher limits.

Architecture

  • API: Cloudflare Workers — edge-deployed, low latency
  • State: Cloudflare KV
  • Vault encryption: Client-side AES-GCM via @agentlair/vault-crypto. The server stores ciphertext only — no plaintext credentials at rest.
  • Audit trail: Ed25519-signed event chains. Each event is independently verifiable without trusting the server.

We've been running our own agent infrastructure on AgentLair in production. Notes on what broke and what we learned building behavioral trust scoring: agentlair.dev/blog/from-0-to-41-building-behavioral-trust-in-production

Documentation

agentlair.dev/getting-started

AAT × APS boundary (cross-protocol reference)

AgentLair AAT is session identity inside the issuer. AEOESS APS is delegation chains and bilateral receipts after handoff. Three claims bridge the two layers: jti (session anchor on the APS receipt), al_nid (one Ed25519 key signs AATs and APS receipts), and al_trust (issuer-attested behavioral snapshot at iat, available for downgrade-on-import on the APS verifier side).

Jointly maintained reference:

Repository structure

packages/  worker/          — Core API worker (Cloudflare Workers)  sdk/             — @agentlair/sdk client library  mcp-server/      — @agentlair/mcp MCP server  vault-crypto/    — @agentlair/vault-crypto end-to-end encryption  verify/          — @agentlair/verify AAT token verification  email-worker/    — Email processing worker
apps/  dashboard/       — Agent dashboard UI  email-channel/   — Email MCP channel

Development

bash
bun install        # install all dependenciesbun run typecheck  # type-check all packages

License

MIT

來源:README.md,提交 5bed860

工具

15

send_email

Send an email from your AgentLair address (@agentlair.dev) to any recipient. No SMTP or DNS setup needed.

輸入參數ccto必填from必填htmltext必填subject必填

check_inbox

Check the inbox for an @agentlair.dev email address. Returns recent messages with sender, subject, and received time.

輸入參數limitaddress必填

read_message

Read the full content of a specific email message, including the body text.

輸入參數address必填message_id必填

list_addresses

List all @agentlair.dev email addresses associated with your API key.

無需輸入參數。

claim_address

Claim a new @agentlair.dev email address for your agent. Free tier supports multiple addresses.

輸入參數address必填

preflight_trust_check

Check trust readiness before engaging with an agent. Returns a ReadinessCard: trust score, behavioral maturity level, whether it's safe to engage, and any caveats. Call this before delegating tasks, accepting agent output, or authorizing payments involving an unknown agent. Free — no extra charge beyond your API key.

輸入參數agent_id必填

vault_put

Store a value in the AgentLair Vault. Use this to persist API keys, secrets, or any data your agent needs across sessions. Best practice: encrypt sensitive data client-side before storing (the server stores whatever you send).

輸入參數key必填value必填metadata

vault_get

Retrieve a stored value from the AgentLair Vault by key name.

輸入參數key必填

vault_list

List all keys stored in your AgentLair Vault (metadata only, values not returned).

無需輸入參數。

vault_delete

Delete a key and all its versions from the AgentLair Vault.

輸入參數key必填

calendar_create_event

Create a calendar event on your AgentLair calendar. Events are published via iCal feed for human subscription (Google Calendar, Apple Calendar, Outlook).

輸入參數end必填start必填summary必填locationattendeesdescription

calendar_list_events

List events on your AgentLair calendar. Optionally filter by date range.

輸入參數tofrom

calendar_delete_event

Delete an event from your AgentLair calendar by event ID. Use calendar_list_events to find event IDs.

輸入參數id必填

calendar_get_feed

Get the public iCal subscription URL for your AgentLair calendar. Share this URL with calendar apps (Google Calendar, Apple Calendar, Outlook) so humans can subscribe and see agent-created events.

無需輸入參數。

delegate_task

Delegate a task to another AgentLair agent. The task is delivered to the agent's inbox and picked up asynchronously. Use this when you need another agent to do something — send an email, run a deployment, do research, etc.

輸入參數to必填task必填contextpriorityconstraints

版本歷史

2
  1. v1.3.1最新Nov 5, 2026
  2. v1.3.0Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分