KodyDennon/TrustForge

GitHub: KodyDennon/TrustForge

TrustForge 是一个面向 AI 原生软件和安全设备的开源信任架构,通过密码学证明和可验证操作取代传统登录认证模式。

Stars: 0 | Forks: 0

# TrustForge [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue?logo=typescript)](https://www.typescriptlang.org/) [![Rust](https://img.shields.io/badge/Rust-Ready-orange?logo=rust)](https://www.rust-lang.org/) [![NPM Core](https://img.shields.io/npm/v/@trustforge-protocol/core.svg)](https://www.npmjs.com/package/@trustforge-protocol/core) [![Crates.io Types](https://img.shields.io/crates/v/tf-types.svg)](https://crates.io/crates/tf-types) **TrustForge** 是一个面向 AI 原生软件、安全设备、经过身份验证的实时系统、站点到站点通信、服务到服务通信以及可验证操作的开源信任架构。 TrustForge 的核心主旨是:下一个安全时代的重点不再是登录;而是**由密码学参与者通过已验证的通道执行的可验证操作**。 该项目被划分为**规范系列**(参见 [`docs/specs/`](docs/specs/))以及使用 TypeScript (Bun) 和 Rust 编写的参考实现。两者目前都在积极开发中,但在广泛的底层原生与桥接领域中,各部分的覆盖程度参差不齐。 这是 **0.1.1 experimental** 版本线,v0.2 的加固工作正在进行中。核心 schema、类型绑定、一致性向量、Bun daemon、CLI 以及部分适配器是可用的参考实现。许多原生集成目前仅经过模拟测试、未经硬件测试、仅作为文档存在或处于规划阶段。目前没有任何内容达到生产可用状态;请使用此仓库进行规范审查、本地互操作性实验以及贡献者开发。 ## 0.1.1 版本包含的内容 | 表面层 | 状态 | |---|---| | Schema + 生成的类型 | 可用的参考实现,包含测试数据、linting、模糊测试、TS/Rust 生成的绑定以及一致性检查。 | | Proof/session/Rpc 核心 | 已实现的 TS/Rust 路径的可用参考实现;部分高级一致性仍是 v0.2 的工作。 | | Agent Contract + 策略守卫 | TS/Rust 中用于核心允许/拒绝/批准行为的可用参考实现。 | | `tf-daemon` + `tf-cli` | 可用的参考实现。TCP `/v1/*` 仍受 bearer token 保护;Unix `/run/trustforge/decide.sock` 是本地决策 socket。 | | Web 适配器 | 包含多个可用的参考适配器;每个适配器的 README 是其已测试表面层的权威来源。 | | 原生 OS/网络集成 | 状态不一。在假设任何组件可安装之前,请参阅 [`docs/native-support-matrix.md`](docs/native-support-matrix.md)。 | | 发布产物 | 存在源码安装路径。容器/Kubernetes 以及二进制/包分发属于 v0.2 及更高版本的加固工作。 | ## 仓库布局 ``` docs/ specs/ TF-0000 through TF-0013 RFC-style specs (TF-0013 defines the site-to-site binary path) bridges/ WebAuthn / SPIFFE / OAuth-GNAP / MCP / TLS / DID / Matrix bridge specs profiles/ home / enterprise / constrained / compliance-evidence ai-integration.md How an AI agent should consume the contract schemas/ Generated per-schema Markdown reference schemas/ *.schema.json 36 JSON Schemas fixtures//{valid,invalid,composite}/ conformance/ parity.yaml schema verdict cross-language parity canonical-vectors.yaml canonical-JSON parity (post-B2) cross-language-signature-vectors.yaml TS↔Rust sign+verify parity signature-vectors.yaml ed25519 / hash parity chain-vectors.yaml event-hash / merkle / chain-hash parity framing-vectors.yaml .tflog / .tfproof byte parity session-vectors.yaml X25519 / HKDF / ChaCha20-Poly1305 parity guard-vectors.yaml AgentGuard decision parity bridge-vectors.yaml SPIFFE / MCP / OAuth bridge parity trust-overlay-vectors.yaml posture composition parity relay-forwarding-vectors.yaml relay authority parity negative-capability-vectors.yaml deny-overrides parity examples/ agent-contracts/ full.yaml, minimal.yaml dangerous-actions/ tf-dangerous-std.yaml proofrpc/ code-helper.tfrpc.yaml tools/ tf-schema/ validate / lint / bundle / codegen / fuzz / parity / agent-contract-check tf-types-ts/ TypeScript type bindings + hand-written core tf-proof/ keygen / sign / verify / inspect / derive-pubkey tf-session/ WebSocket carrier for the session protocol tf-daemon/ Runnable daemon (with admin HTTP endpoint) tf-packet/ Packet sign/verify/fragment/reassemble + LoRa simulator tf-evidence/ Evidence assemble/verify/seal/open/anchor/replay/redact tf-cli/ Unified `tf` command tf-dashboard/ Viewer-only dashboard for an active daemon tf-conformance/ Runs every conformance category in one shot crates/ tf-types/ Rust type bindings + hand-written core tf-code-helper-example/ Downstream crate that compiles rpc-rust output ``` ## 快速开始 ``` bun install bun run --filter '*' typecheck bun test bun run tools/tf-conformance/src/cli.ts run cargo test --workspace ``` 该版本线所需的本地检查关口为 `bun test`、`bun run --filter '*' typecheck`、`bun run tools/tf-conformance/src/cli.ts run`、`cargo test --workspace` 和 `cargo check --workspace --all-targets`。 ### 运行 daemon ``` # 1. 将一个 daemon 身份 mint 到 vault 中。 TF_VAULT_PASS=dev-pw bun run tools/tf-cli/src/cli.ts actor create \ --type service --name tf-daemon --domain example.com # 2. 启用 admin HTTP 并启动该 daemon。 TF_VAULT_PASS=dev-pw TF_ADMIN_TOKEN=$(openssl rand -hex 16) \ bun run tools/tf-daemon/src/cli.ts run --config .tf/daemon.yaml # 在不启动 listeners 的情况下执行可选的 preflight。 bun run tools/tf-daemon/src/cli.ts run --config .tf/daemon.yaml --dry-run # 3. 浏览 dashboard(只读)。 TF_ADMIN_TOKEN=$TF_ADMIN_TOKEN \ bun run tools/tf-dashboard/src/cli.ts --daemon http://127.0.0.1:8787 # 4. 从 CLI 中 inspect、approve 和 revoke。 tf session inspect tf approval list tf approve tf revoke actor tf:actor:agent:example.com/bad ``` ## Profile TrustForge 提供四种一致性标签: | Profile | 基准 | 适用场景 | |---|---|---| | `tf-home-compatible` | E3 / L1 | 单操作者部署 —— 家庭自动化、个人网格 | | `tf-enterprise-compatible` | E4 / L2 + RFC 6962 | 多租户、联邦、透明度锚定、quorum | | `tf-constrained-compatible` | E3 / L1 | LoRa、BLE、串行通信、人工网络、存储转发 | | `tf-compliance-evidence-compatible` | E4 / L3 + RFC 3161 + RFC 6962 | 具备离线可重现性的法律/合规证据 | 如果所声明 profile 的 MUST(必须)功能未满足,daemon 将拒绝启动;请参阅 [`docs/profiles/`](docs/profiles/) 获取规范定义。 ## 规范状态 `docs/specs/` 中的每个规范均处于 **Draft**(草案)阶段。参考实现与规范保持一一对应 —— 当规范发生变更时,实现也会随之更新。有关规范流程,请参阅 [`GOVERNANCE.md`](GOVERNANCE.md)。 ## 贡献 有关开发环境设置、一致性预期以及关于新密码学原语、新协议表面和 AI 可实现性的规则,请参阅 [`CONTRIBUTING.md`](CONTRIBUTING.md)。 ## 许可证 Apache-2.0。详见 [LICENSE](LICENSE)。
标签:AI原生, Rust, TypeScript, 可视化界面, 安全插件, 密码学, 手动系统调用, 服务间通信, 网络流量审计, 自动化攻击, 零信任架构