🛡️ Zero-Trust Agent Framework
Ship autonomous AI agents with built-in governance, audit trails, and kill switches.
Quick Start · Docs · Architecture · Services · Why · Contribute
大多数 agent 框架帮你*构建*。而这个框架帮你建立*信任*。
Zero-Trust Agent Framework 是一套完整的方法论和参考架构,用于部署具有严格权限边界、加密审计追踪、human-in-the-loop 审批工作流和自动化事件响应的自主 AI agent —— 让你能发布让团队、客户和合规人员都能真正信任的 agent。
## 问题所在
你构建了一个 AI agent。它在开发环境中运行正常。然后呢?
- **谁批准了该操作?** 没有审计追踪。
- **这个 agent 实际上能做什么?** 没有权限模型。
- **出问题了——发生了什么?** 没有结构化日志。
- **agent 正在做意料之外的事——我该如何阻止它?** 没有紧急停止开关。
- **我的客户想要部署它——我如何证明它是安全的?** 缺乏治理方案。
每个部署 agent 的团队都会遇到这些壁垒。大多数团队只是勉强拼凑出一个解决方案。而这个框架从第一天起就为你提供了完整的架构。
## 架构
```
┌─────────────────────────────────────────────────────────┐
│ YOUR APPLICATION │
├─────────────────────────────────────────────────────────┤
│ │
│ ┌───────────┐ ┌───────────┐ ┌────────────────────┐ │
│ │ Agent A │ │ Agent B │ │ Agent C │ │
│ │ (T1) │ │ (T2) │ │ (T0) │ │
│ │ Drafter │ │ Executor │ │ Observer │ │
│ └─────┬─────┘ └─────┬─────┘ └──────────┬─────────┘ │
│ │ │ │ │
│ ┌─────▼──────────────▼────────────────────▼─────────┐ │
│ │ ZERO-TRUST GOVERNANCE LAYER │ │
│ ├───────────────────────────────────────────────────┤ │
│ │ Permission Approval Audit Kill │ │
│ │ Engine Workflows Logger Switch │ │
│ ├───────────────────────────────────────────────────┤ │
│ │ Heartbeat Proactive Incident Scope │ │
│ │ Monitor Watchers Response Enforcer │ │
│ └───────────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────┐ │
│ │ INTEGRATION LAYER │ │
│ │ APIs · Databases · External Services · LLMs │ │
│ └───────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────┘
```
该框架位于你的 agent 和外部世界*之间*。每一个操作、每一次数据访问、每一个外部调用都会通过治理层——被记录、受权限控制且可审计。
## 核心原则
| # | 原则 | 含义 |
|---|-----------|---------------|
| 1 | **默认零信任** | 每个 agent 初始没有任何权限。能力必须通过显式的、可审计的授权来获取。 |
| 2 | **起草 → 批准 → 执行** | 任何 agent 在未通过审批 pipeline 之前,都不得发送、发布、提交或支出。 |
| 3 | **记录一切** | 每一次读取、起草、发送和错误——都带有时间戳、结构化、经过加密签名且不可变。 |
| 4 | **防护栏即代码** | 黑名单、权限边界和升级触发器由程序强制执行,而非依赖约定。 |
| 5 | **高调失败,安全失败** | 出现问题时,agent 会停止、记录并报警。它绝不会在边界之外进行临时发挥。 |
→ 深入了解:[`framework/01-core-principles.md`](framework/01-core-principles.md)
## 权限层级
每个 agent 都在四个信任级别之一运行。权限提升是明确且有记录的。
| 层级 | 名称 | 可执行操作 | 人工介入 |
|------|------|---------------|-------------------|
| **T0** | 观察者 | 读取数据、分析、呈现发现 | 无需介入(只读) |
| **T1** | 起草者 | 读取 + 生成草案/提案 | 执行前需逐项人工审批 |
| **T2** | 执行者 | 读取 + 起草 + 执行已批准的操作类别 | 对已定义的操作给予全权批准;例外情况需升级处理 |
| **T3** | 自主型 | 在限定范围内拥有完全权限 | 事后审计;由异常触发警报 |
```
New agent deployed → Always starts at T0
│
▼
Promote to T1 (requires: scope doc + system prompt + approval config)
│
▼
Promote to T2 (requires: 2+ weeks at T1, <2% rejection rate, audit review)
│
▼
Promote to T3 (requires: 30+ days at T2, incident response plan, kill switch tested)
```
**默认:** 所有新 agent 均从 T0 或 T1 起步。没有捷径。
→ 完整层级规范:[`framework/02-permission-tiers.md`](framework/02-permission-tiers.md)
## 包含内容
```
zero-trust-agent/
│
├── README.md ← You are here
│
├── framework/ ← The methodology
│ ├── 01-core-principles.md ← Philosophy and mental model
│ ├── 02-permission-tiers.md ← T0–T3 trust model specification
│ ├── 03-deployment-checklist.md ← 8-step go-live checklist
│ ├── 04-monitoring-protocol.md ← Heartbeat checks, health scoring, alerting
│ ├── 05-incident-response.md ← P0–P3 severity matrix and post-mortems
│ └── 06-integration-guide.md ← Integrating the framework into your stack
│
├── architecture/ ← Reference architecture (from production)
│ ├── platform-overview.md ← Multi-tenant agent platform design
│ ├── proactive-engine.md ← Configurable watcher/trigger system
│ └── security-model.md ← Auth, isolation, financial action gates
│
├── templates/ ← Copy-paste starter configs
│ ├── agent-scope-document.md ← Scope template for any new agent
│ ├── system-prompt-skeleton.md ← Production system prompt scaffold
│ ├── audit-log-schema.json ← Structured log format (JSON)
│ ├── heartbeat-config.yaml ← Monitoring config template
│ ├── incident-postmortem.md ← Post-incident report template
│ └── watcher-config.yaml ← Proactive engine watcher template
│
├── examples/ ← Real-world agent configurations
│ ├── saas-onboarding-agent.md ← SaaS customer onboarding agent
│ ├── ci-cd-agent.md ← CI/CD pipeline automation agent
│ ├── customer-support-agent.md ← Support agent with escalation rules
│ └── data-pipeline-agent.md ← ETL/data processing agent
│
├── docs/ ← Extended documentation
│ ├── getting-started.md ← Step-by-step setup guide
│ └── configuration-reference.md ← All config options explained
│
├── CONTRIBUTING.md ← How to contribute
└── LICENSE ← MIT
```
## 快速开始
### ⚡ 选项 A:交互式 AI 引导入门(推荐)
你可以使用我们的交互式 CLI 设置向导,在 3 分钟内初始化你的零信任配置。该向导直接在你的终端中运行活跃的 AI 分析:
```
# 运行交互式 onboarding 向导
npx zta
```
此 CLI 会:
1. 使用活跃的 AI(Gemini、OpenAI 或本地启发式算法)审计你的 agent 风险概况。
2. 推荐最佳实践的**信任层级 (T0–T3)** 并解释安全依据。
3. 构建你的读/写/禁止权限边界和防护栏。
4. 自动在你的目录中生成所有文件(`zta-config.yaml`、`zta-scope.md`、`zta-system-prompt.txt`)。
5. 提供与 **ZTA Cloud** 的直接连接桥接,用于远程审计日志和 Slack 通知。
### 📝 选项 B:手动设置
如果你更倾向于手动配置,请按照以下步骤操作:
#### 1. 确定你的 agent 范围
复制 [`templates/agent-scope-document.md`](templates/agent-scope-document.md) 并定义:
- agent 执行的**内容**(一句话)
- 它触及的**集成**(以及处于什么权限级别)
- 明确**禁止**它执行的操作
- **如何**审查输出结果
#### 2. 编写系统 prompt
使用 [`templates/system-prompt-skeleton.md`](templates/system-prompt-skeleton.md)。关键部分包括:
- 身份与目的
- 权限层级与访问规则
- 防护栏(黑名单、禁止操作、升级触发器)
- 失败模式(出问题时的应对措施)
#### 3. 配置治理层
设置审批工作流、审计日志和监控:
```
# 示例:T1 Drafter agent 配置
agent:
name: "support-assistant"
tier: T1
permissions:
read: [crm, knowledge_base, ticket_system]
draft: [email_responses, ticket_updates]
execute: [] # T1 cannot execute — all drafts require approval
approval:
mode: per_item # every draft needs human sign-off
notify: [slack, email]
timeout_hours: 24 # escalate if no response in 24h
audit:
log_reads: true
log_drafts: true
log_approvals: true
retention_days: 365
signature: hmac-sha256
monitoring:
heartbeat_interval: 300 # seconds
alert_on_silence: true
health_checks: [response_time, error_rate, rejection_rate]
kill_switch:
enabled: true
trigger: [manual, error_threshold, anomaly_detection]
action: suspend_and_alert
```
### 4. 部署与监控
上线前运行 [`framework/03-deployment-checklist.md`](framework/03-deployment-checklist.md)。设置心跳监控([`framework/04-monitoring-protocol.md`](framework/04-monitoring-protocol.md))。了解你的事件应急手册([`framework/05-incident-response.md`](framework/05-incident-response.md))。
→ 完整指南:[`docs/getting-started.md`](docs/getting-started.md)
## 参考架构
`architecture/` 目录包含一个完整的、经过生产环境测试的参考设计,用于基于零信任原则构建多 agent 平台。它涵盖了:
| 文档 | 涵盖内容 |
|----------|---------------|
| [`platform-overview.md`](architecture/platform-overview.md) | 多租户架构、意图引擎、记忆管理、对话 FSM、业务逻辑层 |
| [`proactive-engine.md`](architecture/proactive-engine.md) | 开发者可配置的观察者系统——监控数据并呈现可操作性建议的后台进程 |
| [`security-model.md`](architecture/security-model.md) | RBAC、JWT 认证、数据隔离(schema + vector + vault)、四重审批模型、财务操作安全 |
这不是理论。它是从处理真实业务运营的生产级 agent 平台中提取出来的。
## 适用人群
- 希望在**生产环境**中安全部署 AI agent 的**开发者**
- 在现有产品中增加 agent 能力的**工程团队**
- 为需要治理保障的客户部署 agent 的 **AI/自动化代理商**
- 构建 agent 平台、编排器或 SDK 的**开发工具构建者**
- 评估 agent 部署的**安全与合规团队**
## 设计理念
### Agent 是员工,而不是工具。
你不会在第一天就给一名新员工管理员权限。你会先限制他们的访问权限,审查他们的工作,随着时间的推移扩大他们的权限,并制定出问题时的应对计划。
零信任框架将相同的逻辑应用于 AI agent:
- **入职** → 范围文档 + 系统 prompt + T0 部署
- **监督工作** → 带有人工审查的 T1 起草
- **获得自主权** → 在证明可靠性后晋升至 T2/T3
- **问责制** → 每一个操作都有不可变的审计日志
- **事件响应** → 出现故障时的明文应对程序
### 开放核心,拒绝供应商锁定。
该框架方法论优先。它适用于任何 LLM、任何云、任何编排工具。模式即产品——而不是你无法摆脱的专有 SDK。
## ZTA Cloud 与专业服务
核心 Zero-Trust Agent Framework 和 CLI 是免费开源的。对于团队协作、生产环境可见性和合规支持,我们提供 ZTA Cloud (SaaS) 和专业的咨询服务。
### ZTA Cloud (SaaS 平台)
简化 agent 监控,存储防篡改日志,并将审批直接路由给你的团队:
| 方案 | 价格 | 功能 |
|------|-------|----------|
| **ZTA Developer (OSS)** | **$0** | 本地配置,本地 JSONL 文件,终端人工审批 |
| **ZTA Cloud Team** | 每个 agent **$49/月** | 中心化签名远程日志,**Slack/Teams 主动审批按钮**,实时仪表盘,SMS 状态警报 |
| **ZTA Enterprise** | **定制** | SSO/SAML,自定义数据库日志(Splunk, Datadog),24/7 SLA 待命,合规性导出 |
👉 **在 `npx zta` 设置工作流期间注册免费试用!**
### 专业服务
如果你需要我们的安全和 agent 工程师提供亲临指导的帮助:
| 服务 | 起步价 | 获得内容 |
|---------|------------|--------------|
| **Agent 审计** | $1,500 | 权限缺口分析、风险评估、修复路线图 |
| **全面部署** | $5,000 | 端到端实施、培训、监控设置 |
| **托管治理** | $500/月 | 持续监控、事件响应支持、季度报告 |
→ 详情:[`SERVICES.md`](SERVICES.md) · 邮箱:[christopher@trustsignal.dev](mailto:christopher@trustsignal.dev)
## License
[MIT](LICENSE) —— 随意使用、fork 并在此基础上构建产品。如果注明出处将不胜感激。
由 Christopher Marziani 基于生产级 agent 部署构建。
非纸上谈兵——皆源自实践。