altweb-context
ALTWEB — 带签名的上下文胶囊
用 Markdown 编写。将其打包为自包含、可验证、可选加密的产物。让 AI 代理仅在签名验证通过之后才会加载它。
AI 代理运行于纯文本上下文之上:指令、人设、技能、记忆文件。这些内容没有任何来源——任何能写入这些文件的东西都能污染它们。ALTWEB 给上下文赋予了保管链,并让加载器拒绝任何缺少保管链的上下文:
Capsule(胶囊) —— 将 markdown 编译成单个
.altweb.html文件(或 URL):内容经压缩(deflate)、可选加密(AES-256-GCM)、可选签名(ECDSA P-256)。自包含——可在任何浏览器中打开、离线验证,无需服务器:你交给别人的是一个文件,而非一个数据库。验证后再加载 ——
altweb-contextMCP 服务器只有在签名有效 且 签名者的公钥在你的信任文件中时,才会加载胶囊到你的代理。未签名、被篡改或不受信任的胶囊会在加载时被拒绝,并给出明确原因。拒绝是默认行为:空的信任文件会拒绝一切,无论是否签名。
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)包/组件
包 | 说明 |
| 无头引擎:内容模型、编解码器、加密、markdown、安全过滤(sanitize) |
|
|
|
|
| Notion 风格的编辑器(构建于 Novel),一键导出 Capsule |
| 文档站点(Astro + Starlight) |
Related MCP server: governed-memory
快速开始
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。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Verified memory for AI agents. Signed assertions, billing attestation, session continuity.
Verifiable execution records for AI agents: signed receipts, tamper-evident archives and portable evidence bundles, exposed via MCP and REST, with paid verify and anchor calls settled over x402.
Local-first long-term memory for AI agents, with byte-recomputable signed verification receipts.
Signed security scores for what an AI agent runs and reads: skills, MCP servers, prompts, tokens.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables 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
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to read, search, and preview governed markdown memories with explicit state and sensitivity, plus quarantine-only write, while never mutating canonical memory or exposing undeclared content.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to operate through a local, signed boundary that blocks prompt injection and secret leakage, verifies outputs, preserves cross-session memory, and provides offline-verifiable receipts. It also exposes 900+ MCP tools for discoverable agent actions.7MIT
- AlicenseNot gradedqualityDmaintenanceEnforces a fail-closed capability gateway for agents consuming untrusted Technocore messages, requiring exact human-approved action hashes before forwarding any downstream tool call and maintaining a tamper-evident audit chain.MIT