PROMETHEUS:可验证的AI执行引擎
太长,读不下去了 证明每一项主张的代理人都有证据。盖茨拒绝幻觉。人类控制着不可逆转的行动。
视觉
AI代理非常强大。但他们产生了幻觉。他们提升了特权。他们操纵编排。普罗米修斯是一个 验证引擎 即:
- 收集证据 对于每个声明(语义熵、来源、置信度得分)
- 核实索赔 通过5个强制性关卡(证据→ 不确定性→ 安全→ 对抗的→ 人类)
- 维护审计跟踪 用于法医重建
- 让人类控制局面 不可逆转的行动
建筑
Task Input
↓
[Orchestrator] Decompose → Execute → Collect Evidence
↓
[ClaimBundle] Wrap results in contract
↓
[GateStack] 5 verification gates:
1. Evidence Gate → FACT claims must have sources (confidence >= 0.60)
2. Uncertainty Gate → Defer if uncertainty > 0.75
3. Security Gate → Enforce privilege hierarchy
4. Adversarial Gate → Guardian agent monitors anomalies
5. Human Approval Gate → High-risk actions require sign-off
↓
[Decision]
✅ PUBLISH → Output results
⚠️ DEFER → Escalate to human
❌ REFUSE → Reject action
🚨 ESCALATE → Blocking high-risk action快速开始
1.Bootstrap环境
bash scripts/bootstrap.sh这个:
- 检查Python 3.10+
- 创建虚拟环境
- 安装依赖项
- 创建源目录
- 设置审核日志记录
2.运行测试
bash scripts/run_tests.sh3.最小示例
from src.claim_bundle import (
ClaimBundle, Claim, Uncertainty,
UncertaintyMethod, GateRecommendation, RiskTier, ClaimType
)
from src.gates import GateStack
# Create a claim with evidence
claim = Claim(
statement="PROMETHEUS uses semantic entropy for hallucination detection",
claim_type=ClaimType.FACT,
evidence_pointers=[
{
"source": "https://nature.com/articles/s41586-024-07421-0",
"source_confidence": 0.95,
"evidence_hash": "bd24c2aaef2ef37ae95f0f9e5f7d9e7c"
}
],
uncertainty=Uncertainty(
method=UncertaintyMethod.SEMANTIC_ENTROPY,
value=0.15,
interpretation="Strong empirical validation",
gate_recommendation=GateRecommendation.EXECUTE
),
risk_tier=RiskTier.READ_ONLY
)
# Create bundle
bundle = ClaimBundle(origin_agent="demo_agent", claims=[claim])
# Run through gates
result = GateStack.evaluate(bundle)
print(f"Decision: {bundle.decision.value}")
print(f"Reason: {bundle.reason}")关键概念
ClaimBundle合同
每个输出都是 ClaimBundle 与:
- 索赔:有证据和不确定性的陈述(事实、推理、决定)
- 证据指针:具有置信度评分的来源
- 不确定性:通过语义熵、模型不一致或共形集计算
- 风险等级:确定审批要求
- 审计跟踪:通过/失败的门的不可变日志
不确定性方法
| 方法 | 成本 | AUROC | 何时使用 |
|---|---|---|---|
| 语义熵 | 5x | 0.78-0.81 | 推荐(王等,自然2024) |
| 模型不一致 | 3x | ~0.70 | 快速、经验性 |
| 置信度得分 | 1x | ~0.60 | 基线(通常过于自信) |
| 共形集 | O(N+k) | 1.0\* | 正式保证(需要校准) |
\*一致性预测:保证覆盖范围,而不是AUROC
栅叠层
- 证据门:事实索赔必须有证据(置信度>=0.60)
- 不确定性之门:如果不确定性>0.75,则推迟(如果>0.50,请解释)
- 安全门:代理层必须>=工具层(无权限升级)
- 对抗之门:守护者代理监视攻击模式
- 人类审批门:删除和特权级别需要签收
流量:
All gates must PASS or decision → DEFER/REFUSE/ESCALATE16周构建规范
看 BUILD_SPEC.md 有关完整的推出计划:
- 第一阶段(第1-2周): 合同、登记处、审计日志
- 第2阶段(第3-5周): 编排、不确定性门、H001测试
- 第3阶段(第6-9周): 安全,监护人代理人,H002测试
- 第4阶段(第10-16周): 商用发动机,测量,H003/H004测试
可检验的假设
每一项主张都是可检验的。看 docs/HYPOTHESIS_TESTING.md:
| ID | 假设 | 阈值 | 时间线 |
|---|---|---|---|
| H001 | 语义熵AUROC>=0.75 | 0.75 | 第4周 |
| H002 | 监护人ASR降低>=40% | 0.40 | 第9周 |
| H003 | MCP集成\=95% | 0.95 | 第16周 |
文档
- CONTRACTS.md:ClaimBundle规范、证据规则、序列化
- GATES.md:门实现、不确定性方法、安全规范
- 假设_估计.md:4个可测试的假设(H001-H004)
- BUILD_SPEC.md:16周的推出计划,包括团队分配
- INTERFACE_PACK.json:所有接口的JSON模式
源代码
src/
├── __init__.py # Package initialization
├── claim_bundle.py # ClaimBundle contract + serialization
├── gates.py # Evidence, Uncertainty, Security, Adversarial, Human gates
├── orchestrator.py # LangGraph orchestration stub
├── gates/ # Gate implementations (per-file in phase 2+)
├── uncertainty/ # Uncertainty methods (semantic_entropy, model_disagreement, etc.)
├── mcp/ # Model Context Protocol integration
└── audit/ # Immutable event logging测试
# Unit tests
pytest tests/ -v
# Acceptance tests (hypotheses)
pytest tests/acceptance/ -v
# H001: Semantic entropy AUROC
pytest tests/acceptance/test_h001_semantic_entropy.py -v
# H002: Guardian defense
pytest tests/acceptance/test_h002_guardian_defense.py -v
# H003: MCP integration speed
pytest tests/acceptance/test_h003_mcp_speed.py -v
# H004: Claim integrity
pytest tests/acceptance/test_h004_claim_integrity.py -v配置
创建 .env 地方发展:
# Database
DATABASE_URL=postgresql://user:pass@localhost/prometheus
REDIS_URL=redis://localhost:6379
# LLM APIs
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
# Uncertainty method
UNCERTAINTY_METHOD=semantic_entropy # or model_disagreement
# Gate thresholds
DEFER_THRESHOLD=0.75
EXPLAIN_THRESHOLD=0.50
# Security
ALLOWED_ORIGINS=http://localhost:3000,https://example.com参考文献
关键论文
- 语义熵 (王等,自然2024)
- AUROC 0.78-0.81用于幻觉检测 - 生成k=5个答案,按NLI聚类,计算熵 - https://nature.com/articles/s41586-024-07421-0
- 不良行为 (Nöther等人,2025年8月)
- 经过攻击训练的模型将ASR降低25-50% - 守护者代理防御模式 - https://arxiv.org/abs/2408.xxxxx
- MCP规范 (人类学,2025年6月)
- 工具集成的模型上下文协议 - HTTP传输的DNS重新绑定保护 - https://spec.modelcontextprotocol.io
标准
- ClaimBundle的JSON模式:
INTERFACE_PACK.json - Python 3.10+类型提示贯穿始终
- 用于HTTP端点的OpenAPI 3.0(第3+阶段)
- IEEE 1012用于验证和确认
状态
- ✅ 存储库已初始化 有合同、关卡、编排器骨架
- ⏳ 第一阶段(第1-2周): 正在进行中(您在这里)
- ⏳ 第2阶段(第3-5周): 预定
- ⏳ 第3阶段(第6-9周): 预定
- ⏳ 第4阶段(第10-16周): 预定
贡献
遵循16周规范。所有代码必须:
- 通过单元测试(
pytest tests/) - 通行证类型检查(
mypy src/) - 遵循风格指南(
black,flake8) - 包含文档字符串(谷歌格式)
- 对所有与闸门相关的变更进行审计跟踪
许可证
专有的。请参阅许可证文件。
______________________________________________________________________
PROMETHEUS:证明其主张的人工智能代理。
由人类建造。经人类验证。由人类控制。
