Skip to main content
Glama
danielsoimu

altweb-context

by danielsoimu

ALTWEB — 带签名的上下文胶囊

用 Markdown 编写。将其打包为自包含、可验证、可选加密的产物。让 AI 代理仅在签名验证通过之后才会加载它。

AI 代理运行于纯文本上下文之上:指令、人设、技能、记忆文件。这些内容没有任何来源——任何能写入这些文件的东西都能污染它们。ALTWEB 给上下文赋予了保管链,并让加载器拒绝任何缺少保管链的上下文:

  • Capsule(胶囊) —— 将 markdown 编译成单个 .altweb.html 文件(或 URL):内容经压缩(deflate)、可选加密(AES-256-GCM)、可选签名(ECDSA P-256)。自包含——可在任何浏览器中打开、离线验证,无需服务器:你交给别人的是一个文件,而非一个数据库。

  • 验证后再加载 —— altweb-context MCP 服务器只有在签名有效 签名者的公钥在你的信任文件中时,才会加载胶囊到你的代理。未签名、被篡改或不受信任的胶囊会在加载时被拒绝,并给出明确原因。拒绝是默认行为:空的信任文件会拒绝一切,无论是否签名。

you write MD ──► altweb compile --sign ──► capsule (.altweb.html / URL)
                                              │
agent asks for context ──► altweb-context ──► verify signature + trust
                                              │
                              trusted ──► markdown injected
                          everything else ──► REFUSED (reason)

包/组件

说明

@altweb/core

无头引擎:内容模型、编解码器、加密、markdown、安全过滤(sanitize)

@altweb/cli

altweb compile / decode / verify / keygen

@altweb/mcp

altweb-context — MCP 服务器:load_capsule, verify_capsule, list_trusted_keys

@altweb/editor

Notion 风格的编辑器(构建于 Novel),一键导出 Capsule

site/

文档站点(Astro + Starlight)

Related MCP server: context-diamond

快速开始

npm install
npm run build

# create your signing identity (deterministic from a passphrase; only the
# public key + fingerprint are stored, in ~/.altweb/identity.json)
node packages/cli/dist/altweb.mjs keygen --save

# write, compile, sign
echo "# My agent's operating notes" > notes.md
node packages/cli/dist/altweb.mjs compile notes.md -o notes.altweb.html --sign

# verify anywhere, offline
node packages/cli/dist/altweb.mjs verify notes.altweb.html

将加载器接入 MCP 客户端(Claude Code 示例):

claude mcp add altweb-context -- node "$(pwd)/packages/mcp/dist/altweb-context.mjs"

完整公钥 添加到 ~/.altweb/trusted-keys.json 即代表信任该签名者(UNTRUSTED_KEY 拒绝消息会直接给你现成条目;短指纹只是人类可读的标签,并不是信任锚点):

{ "keys": [ { "name": "Me", "publicKey": "<base64url SPKI>", "fingerprint": "ab:12:..." } ] }

签名证明了什么——以及它不能证明什么

有效的签名可以证明确实地证明胶囊的签名者以及字节内容是完整的。它并不保证内容的安全性或真实性。信任文件就是你的策略,请保持它的精简。

选择一个长的 passphrase。 身份是一个固定全局 salt,确定性用途源于你的密码口令(正因如此,,它们可以在不保存任何东西的情况下移动使用)——因此口令的熵便是身份的全部安全所在。请使用至少 16 个字符的 diceware 风格口令;工具会强制最低强度。

安全性

在解码时,内容会经过 DOMPurify 进行 sanitize;产物携带 CSP;编解码器用 zod 验证结构。完整说明见 site/ 文档 → Security model,包括加密胶囊的注意事项(签名覆盖解密后的 payload,因此验证需在解密后才会完全完成)。

致谢

基于一流开源项目构建:Novel (Apache-2.0) 和 Tiptap(MIT)用于编辑器;DOMPurify、marked、pako、zod、@noble/curves 位于引擎中。更多见 NOTICE。

License

ALTWEB 是 双证书

  • 开源:开源的:AGPL-3.0-or-later 免费使用、学习、修改和分享,但有一个核心义务:如果你修改了 ALTWEB 并分发它,或把它作为网络服务运行(例如为别人托管 altweb-context),你必须在 AGPL 许可下发布修改后的源代码。

  • 商业:另行协议。 如果想在闭源产品中使用 ALTWEB,或者在不开源你的修改的情况下把它作为托管服务提供,则需要单独的商业许可。见 COMMERCIAL.md

版权所有:Copyright © 2026 Daniel C. ȘOIMU。包含的第三方组件保留它们各自的(宽松)许可证——见 NOTICE

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides cryptographic identity and signing capabilities for AI agents, enabling them to create persistent identities, sign actions with private keys, and allow external systems to verify the authenticity and provenance of agent-initiated operations.
    4
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to sign and verify actions with ML-DSA-65 digital signatures, providing tamper-proof receipts that can be verified offline without any secrets.
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables LLM agents to acquire token-budgeted, deterministic context packs from repositories, with hash-chained provenance for auditability.
    2
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP-native Trust Infrastructure for AI Agents. Persistent encrypted memory with Trust Quotient.

  • Issue signed receipts for AI agent actions; verify any receipt offline - free, no account.

  • Post-quantum, tamper-evident receipts for agent actions. Ed25519 + ML-DSA-65, offline verify.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/danielsoimu/altweb'

If you have feedback or need assistance with the MCP directory API, please join our Discord server