AI Traceability Graph:需求-评测-控制追踪
AI Traceability Graph 是把“为什么做、要满足什么、如何评测、如何控制、如何实现、线上发生了什么、证据在哪里”连接成一张可查询的关系图。
AI Traceability Graph / Requirements-Eval-Control-Evidence 解读
配对阅读:本篇的操作手册版(模板/RACI/门禁/runbook)是
docs/AI_TRACEABILITY_REQUIREMENTS_EVAL_CONTROL_GRAPH_PLAYBOOK.md。第一遍读本篇建立原理与架构判断;第二遍做案例时再用 playbook 查表落地,两者不需要重复精读。
核心问题: AI 需求如果只停留在 user story 或 PRD 段落, 很难证明系统上线后真的满足业务目标、风险控制、评测门槛和审计要求。高级 AI 需求工程要把 business outcome、requirement、eval、control、ADR、implementation、telemetry 和 evidence 连接成 traceability graph。
Source Anchors
| Source | Link | 用途 |
|---|---|---|
| W3C PROV Overview | https://www.w3.org/TR/prov-overview/ | 参考 provenance、entity、activity、agent 的思想, 设计证据来源和生成关系(访问日期: 2026-07-01) |
| NIST AI RMF | https://www.nist.gov/itl/ai-risk-management-framework | 将 traceability 连接到 AI 风险治理、测量和管理(配套 GenAI Profile NIST AI 600-1 发布 2024-07,2026-04-08 更新) |
| ISO/IEC 42001 | https://www.iso.org/standard/81230.html | 参考 AI management system、责任、控制、持续改进和证据要求(访问日期: 2026-07-01) |
| OpenTelemetry | https://opentelemetry.io/docs/ | 用 trace、metrics、logs 把运行时行为连接到需求和控制证据(持续更新文档;GenAI 语义约定状态见文末 SOTA 检查,访问日期: 2026-07-01) |
| JSON Schema | https://json-schema.org/ | 为 eval result、control evidence、structured output 和 evidence object 提供结构化约束(访问日期: 2026-07-01) |
核心导读
AI Traceability Graph 是把“为什么做、要满足什么、如何评测、如何控制、如何实现、线上发生了什么、证据在哪里”连接成一张可查询的关系图。
传统 traceability matrix 往往只追踪 requirement 到 test。AI 系统需要更深的链路: business outcome 要连接 requirement; requirement 要连接 eval、metric、threshold、control、architecture decision、component/config; runtime trace 和 evidence 要能回连到 release decision、incident 和 remediation。
这套能力的价值不在于文档更完整, 而在于支持三类高价值判断: 上线前发现覆盖缺口, 上线后定位漂移和事故影响, 审计时证明每个高风险需求如何被测试、控制和复核。
问题定义
普通 user story 可能写成:
As a customer service agent, I want AI to answer customer policy questions, so that I can respond faster.
对传统功能而言这可以作为开头, 但对 AI 系统远远不够:
| 缺口 | AI 系统需要额外回答 |
|---|---|
| 质量不确定 | 什么叫回答好, 用哪些样本、指标和阈值证明 |
| 风险边界 | 哪些问题必须拒答、降级、升级人工或禁止自动化 |
| 数据/知识来源 | 答案必须引用哪些批准来源, 如何处理 stale source 和权限过滤 |
| 控制执行 | 哪个组件执行 policy, 哪个角色审批例外, 控制是否可测试 |
| 运行漂移 | 上线后如何监控质量、成本、风险、人工负载和采用 |
| 审计证据 | 监管或内审问“为什么允许上线”时给什么证据 |
| 变更影响 | prompt/model/retriever/tool/source 改动影响哪些需求和控制 |
成熟的 AI 需求表达应形成链路:
Business outcome
-> requirement
-> acceptance criterion
-> eval case / metric / threshold
-> control
-> architecture decision
-> implementation/config
-> telemetry
-> evidence
-> release decision
如果需求无法追踪到 eval 和 control, 它只是愿望; 如果控制无法追踪到 runtime evidence, 它只是宣称。
架构模型/核心原理
Graph nodes
AI traceability graph 可以用节点和边表达。节点类型包括:
| Node | 示例 |
|---|---|
| Business outcome | 减少客服平均处理时间 20%, 不增加投诉 |
| Stakeholder concern | 准确性、信任、合规、成本、人工负载 |
| Requirement | 回答必须基于批准政策知识源 |
| Risk | 未经授权建议、错误费用解释、PII 泄露 |
| Acceptance criterion | customer-facing answer must cite source |
| Eval case | 费用政策问答 golden set |
| Metric | citation correctness、unsupported claim rate |
| Threshold | citation correctness >= 95%, regulated answer unsupported claim = 0 |
| Control | source allowlist、policy classifier、HITL |
| ADR | choose RAG over fine-tuning for policy knowledge |
| Component | retrieval service、policy engine、model gateway |
| Config | prompt version、retriever version、policy profile |
| Runtime trace | request span、retrieval span、policy decision span |
| Evidence | eval report、release memo、approval、trace sample |
| Decision | release、scale、hold、rollback、exception |
| Incident | wrong answer、policy bypass、data exposure |
| Remediation | source update、eval expansion、policy rule change |
Graph edges
| Edge | Meaning |
|---|---|
satisfies | requirement satisfies business outcome |
decomposes | capability decomposes into requirements |
mitigates | control mitigates risk |
measured_by | requirement measured by eval/metric |
has_threshold | metric has pass/warn/block threshold |
implemented_by | requirement implemented by component/config |
decided_by | ADR explains architecture choice |
emits | component emits telemetry |
evidenced_by | decision/control supported by evidence |
violated_by | incident violates requirement/control |
remediated_by | remediation changes control/config/eval |
supersedes | new ADR/config/eval replaces previous one |
Example graph
场景: Customer-facing fee policy assistant。
| From | Edge | To |
|---|---|---|
| Reduce call handling time without increasing complaints | satisfied_by | AI policy assistant capability |
| AI policy assistant capability | decomposed_into | Fee explanation requirement |
| Fee explanation requirement | measured_by | Fee policy golden set |
| Fee policy golden set | uses_metric | Citation correctness |
| Citation correctness | has_threshold | >= 95% |
| Fee explanation requirement | constrained_by | No personalized financial advice risk |
| No personalized financial advice risk | mitigated_by | Advice boundary policy |
| Advice boundary policy | implemented_by | Policy engine profile retail-advice-boundary-v3 |
| Fee explanation requirement | implemented_by | RAG retrieval service |
| RAG retrieval service | uses_config | Source allowlist retail-policy-approved |
| RAG design | decided_by | ADR-001 RAG over fine-tuning |
| Production request | emits | OpenTelemetry trace |
| Release decision | evidenced_by | Eval report, ADR, risk signoff, trace sample |
| Wrong fee answer incident | violates | Fee explanation requirement |
| Wrong fee answer incident | remediated_by | Eval set expansion and source version update |
Graph 不一定一开始就用图数据库。表格、YAML、spreadsheet、markdown 矩阵都可以作为早期实现。关键是关系明确, 能查询覆盖、影响和证据。
关键机制
Requirements-to-eval
AI requirement 必须写到可评测:
| Requirement pattern | Eval translation |
|---|---|
| Must answer using approved source | source-grounded eval、citation check |
| Must refuse unsupported question | no-answer eval、refusal correctness |
| Must escalate high-risk scenario | escalation eval、HITL routing test |
| Must not expose PII | redaction eval、privacy test |
| Must call correct tool | trajectory eval、tool selection accuracy |
| Must complete under time budget | latency SLO、load test |
| Must be cost efficient | cost per successful task |
| Must be understandable to user | human rating、comprehension test |
高级要求:
- Eval case 覆盖 normal、edge、adversarial、regulatory、segment-specific cases。
- Eval result 映射回 requirement、risk、control。
- Eval failure 可追踪到 component、config、source、prompt 或 tool。
- Release decision 必须引用 eval evidence。
Requirements-to-control
AI requirement 还必须写到控制:
| Requirement / Risk | Control | Evidence |
|---|---|---|
| 不得给个性化投资建议 | advice boundary classifier + refusal template | policy decision logs、red-team eval |
| 工具调用必须授权 | tool gateway + RBAC/ABAC/ReBAC | tool audit span |
| 高风险 case 必须人工复核 | HITL queue + approval workflow | approval id、review record |
| 知识必须来自批准来源 | source registry + retrieval filter | citation source version |
| 不能保存超过期限的 prompt context | retention policy + deletion job | retention audit report |
| 变更必须可追溯 | ADR + version registry + release bundle | ADR log、release memo |
成熟控制要说明发生在哪里、是预防/检测/纠正哪一类、是否自动化、由谁负责、如何测试有效性、产生什么证据。
Requirements-to-architecture
Traceability graph 能暴露架构决策的必要性。
| Requirement pressure | Architecture response |
|---|---|
| 需要引用和快速更新政策 | RAG + source registry, 不使用纯 fine-tuning 存政策知识 |
| 需要控制工具副作用 | Tool gateway + policy engine + HITL |
| 需要审计上线依据 | Evidence binder + ADR + release bundle |
| 需要线上漂移监控 | OpenTelemetry trace + eval sampling + dashboard |
| 需要降低成本 | model routing + cache + context budget |
| 需要跨团队复用 | service catalog + golden paths |
如果架构元素无法回连到需求或风险, 它可能是过度设计; 如果需求无法落到架构元素, 它可能无法交付。
Impact queries
Traceability graph 的价值体现在查询能力:
| Query | 用途 |
|---|---|
| 哪些 high-risk requirements 没有 eval coverage | 找上线前缺口 |
| 哪些 controls 没有 runtime evidence | 找审计风险 |
| 哪些 incidents 违反同一 requirement | 找系统性问题 |
| 某个 prompt 版本影响哪些 requirements | 做变更影响分析 |
| 某个 source 更新影响哪些 eval cases | 做知识更新回归 |
| 哪些 requirements 没有关联 business outcome | 清理低价值需求 |
| 哪些 architecture components 没有关联 requirement/risk | 识别过度设计 |
这些查询把 traceability 从文档维护变成产品和架构决策工具。
证据与控制
Evidence object
Evidence 不应是散落附件, 而应是结构化对象:
| Field | 内容 |
|---|---|
| evidence_id | 唯一编号 |
| evidence_type | eval_report、trace_sample、approval、ADR、policy_log、incident |
| produced_by | 系统、人工、评测工具或审批流程 |
| produced_at | 时间 |
| related_requirement | requirement id |
| related_control | control id |
| related_release | release id |
| source_version | prompt/model/retriever/tool/source version |
| retention | 保存期限 |
| integrity | hash、immutable store 或 access log |
| reviewer | 如需人工确认, 记录 reviewer |
这让 evidence 成为可查询、可复用、可审计的治理资产, 而不是项目结束时临时整理的材料。
Release decision memo
Release memo 是 traceability graph 的人类可读摘要:
| Section | 内容 |
|---|---|
| Business objective | 为什么要发布 |
| Scope | 发布到哪些用户、渠道、地区、场景 |
| Requirements coverage | 关键 requirements 和覆盖状态 |
| Eval results | 指标、阈值、失败项、残余风险 |
| Control coverage | 风险、控制、控制测试、证据 |
| Architecture decisions | 关键 ADR 和反转条件 |
| Runtime readiness | telemetry、SLO、runbook、incident path |
| Exceptions | 例外、补偿控制、过期日期 |
| Decision | release、limited pilot、hold、rollback |
| Signoff | product、architecture、risk、ops owner |
Release decision 不应只是“评测通过”。它应明确哪些需求被覆盖、哪些风险仍残留、哪些例外被接受、哪些运行信号会触发 rollback 或 review。
Runtime linkage
线上 trace 应带足够标签, 才能回连到需求和控制:
trace_id
use_case_id
requirement_id
control_id
prompt_version
model_route
retriever_version
source_version
tool_contract_version
policy_decision
approval_id
eval_sample_flag
incident_id
没有 runtime linkage, traceability 会停在上线前; 有了 linkage, incident、drift、quality sampling、cost review 都能回到同一张图。
AI产品/金融零售场景
AML investigation copilot
目标: 帮助 AML analyst 汇总客户、交易、实体关系和监管规则证据, 生成 investigation brief 草稿。AI 不做最终 SAR 决策。
Traceability matrix:
| Business outcome | Requirement | Eval | Control | Evidence |
|---|---|---|---|---|
| 缩短调查准备时间 | Copilot 汇总相关交易和实体关系 | analyst task completion benchmark | graph/data source allowlist | benchmark report、trace sample |
| 提高证据完整性 | Brief 必须引用交易、规则、case history | evidence coverage eval | citation required、source versioning | eval report、source lineage |
| 防止错误监管结论 | AI 不得决定 SAR filing | refusal/escalation eval | decision boundary policy、human signoff | policy log、reviewer record |
| 保护敏感数据 | 不向未授权模型发送 restricted data | privacy test | model route data boundary | route logs、DLP report |
| 支持审计 | 每次 brief 有 version、inputs、reviewer | evidence completeness query | evidence binder | release and case evidence |
关键链路示例:
BO-AML-001 Reduce investigation prep time
-> REQ-AML-003 Generate evidence-grounded brief
-> EVAL-AML-007 Evidence coverage eval
-> CTRL-AML-004 Approved source and graph allowlist
-> ADR-AML-002 Use graph retrieval + RAG
-> COMP-AML-005 Investigation retrieval service
-> TRACE tag req=REQ-AML-003 ctrl=CTRL-AML-004
-> EVD-AML-018 Eval report + trace sample
-> REL-AML-002 Limited pilot release
这个场景中, traceability graph 不只是合规资产, 也是产品改进工具: 如果 analyst override 上升, 可以查是 source coverage 不足、retrieval 配置漂移、prompt 版本变化, 还是某类交易模式缺少 eval case。
反模式
| 反模式 | 表现 | 修正 |
|---|---|---|
| User story only | 需求不能追踪到 eval/control/evidence | 写 requirement-eval-control graph |
| Eval orphan | 评测集存在但不知道覆盖哪些需求 | eval case 必须关联 requirement/risk/control |
| Control orphan | 控制存在但没有测试或证据 | control 必须关联 test/evidence |
| Evidence pile | 材料很多但不可查询 | evidence object metadata |
| No runtime link | 上线后 trace 和需求断开 | telemetry span 带 use case、requirement/control tags |
| Change blindness | prompt/model/source/tool 改动影响不可见 | version registry + impact query |
| Audit scramble | 内审来时临时找材料 | release bundle and evidence binder by default |
| Graph without decisions | 关系很多但不服务上线、变更、事故和审计 | 以 release、scale、rollback、exception 查询驱动建模 |
最终心智模型
AI traceability 的核心不是“把文档连起来”, 而是把不确定系统变成可证明、可复盘、可演进的系统:
Outcome asks why.
Requirement defines what.
Eval measures behavior.
Control constrains risk.
Architecture implements tradeoff.
Telemetry observes reality.
Evidence supports decision.
Incident drives remediation.
成熟 traceability graph 应能持续回答七个问题:
| 问题 | 判断标准 |
|---|---|
| 为什么做 | 每个关键 requirement 关联 business outcome |
| 做到什么程度 | 每个关键 requirement 有 metric 和 threshold |
| 如何证明 | 每个 eval/control 有 evidence object |
| 如何控制风险 | 每个 material risk 有 control 和 owner |
| 如何落地架构 | ADR、component、config 与 requirement/risk 相连 |
| 线上是否仍成立 | telemetry 和 incident 能回连到 requirement/control |
| 变更影响什么 | prompt/model/source/tool 版本能查询影响范围 |
当这张图存在时, AI 产品、架构、风险、运营和审计不再各自维护一套叙事, 而是在同一条证据链上做 release、scale、rollback、exception 和 remediation 决策。
SOTA 检查 (2026-07-01)
- Runtime linkage 已有事实标准可对齐:OpenTelemetry GenAI 语义约定在 2025 年底稳定了 client spans/metrics,主流 agent 框架 2026 Q1 已出货 emitter;截至 2026-03 大部分 GenAI semconv 仍标记 experimental,但范围已扩展到 agent 编排、MCP 工具调用和 quality-evaluation span hook(OpenTelemetry 官方博客 2026;Greptime 解读 2026-05)。本篇「Runtime linkage」一节的自定义 trace tag(requirement_id/control_id/prompt_version 等)应作为 GenAI semconv 之上的业务扩展属性实现,而非平行体系——Datadog/Google Cloud/AWS/Azure 均已原生消费该约定(2025 年底起)。
- NIST AI RMF 主线仍现役且在加密度:GenAI Profile(NIST AI 600-1,2024-07 发布)于 2026-04-08 更新,提供 200+ 条 GenAI 专属 action,可直接作为本篇 requirement→control 映射表的控制词表;NIST 2026-04-07 发布关键基础设施 AI RMF Profile concept note,CAISI 于 2026-02 启动 AI Agent Standards Initiative(Agent Interoperability Profile 计划 2026 Q4)。本篇引用 AI RMF 作为治理锚点的结论仍成立。
- 审计侧双框架格局(2026):ISO/IEC 42001 认证与 NIST AI RMF 并行为主流组合,NIST AIRC 已有 72 行 crosswalk 将 AI RMF subcategory 逐条映射 ISO 42001;ISO 42001 审计的核心交付 Statement of Applicability(控制清单+纳入/排除理由+管理层签核)与本篇 evidence binder / release memo 结构同构——本篇的 graph 即是把 SoA 从静态文档升级为可查询资产。
- 监管时间线已变:EU AI Act Annex III 高风险义务经 Digital Omnibus 推迟至 2027-12-02(Omnibus 2026-05-07 确认),traceability/logging 类合规硬截止顺延;但 2026 年主流实践仍是提前建 evidence graph 而非等截止日期。引用旧的「2026-08 生效」时间线属过时信息。
- 研究前沿印证 graph 模型:LLM agent 执行溯源已成独立研究方向——综述 "From Agent Traces to Trust: A Survey of Evidence Tracing and Execution Provenance in LLM Agents"(arXiv 2606.04990,2026-06)指出现有标准(含 W3C PROV、OTel)尚未完整覆盖 retrieval/tool use/memory/multi-agent 通信的 provenance,需要把执行事件与语义证据关系连接起来——这正是本篇 graph edges(emits/evidenced_by/violated_by)的方向。
- 不随版本过时的框架性结论:requirement→eval→control→evidence 十段链路、impact query 清单、evidence object 元数据结构、release memo 十节模板均与具体模型/框架版本无关;随版本演化的只有两类内容——telemetry 字段命名(应跟随 OTel GenAI semconv 演进)和监管合规截止日期(跟随 EU AI Act/州法变动,如 Colorado SB 24-205 已于 2026-05-14 被 SB 26-189 取代)。