跳转至

SearchConnector Tool Gateway:检索工具网关接入验收

数据分类:synthetic_internal_demo。样例为合成文档、合成用户、合成组织 scope 和合成 adapter 状态,用于验证 SearchConnector 进入 Tool Gateway 调用路径后的安全 contract。

实验定位

这个验收集验证 SearchConnector 不再只是一个可直接调用的本地检索对象,而是 Runtime Projection 中的 context.searchcontext.get_documentcontext.report_gap 三个工具;它们必须先经过 Tool Gateway,再执行实际检索或缺口记录。

当前已接入的工具策略:

工具 动作 风险 要求
context.search search R0 schema hash、user scope、requested allowed_scopes 子集检查、namespaced scopes
context.get_document get_document R1 schema hash、user scope、requested allowed_scopes 子集检查、namespaced scopes
context.report_gap report_gap R1 schema hash、user scope、审计记录

汇总结果

  • Case 数:7
  • 通过数:7
  • 失败数:0
  • 通过率:100%
Case 要求 结果
allows_team_search context.search 通过 Tool Gateway 后返回 scoped hits pass
denies_scope_escalation 请求中的 allowed_scopes 不能超过用户 scope pass
filters_unsafe_search_output 不安全 connector 返回 restricted hit 时,gateway 后置过滤 pass
filters_unsafe_get_document_output 不安全 get_document 返回 restricted document 时,gateway 抑制输出 pass
reports_gap_through_gateway report_gap 通过 Tool Gateway 审计并记录缺口 pass
accepts_namespaced_scope 已认证 person:* / dept:* / project:* 这类组织私域 scope 可用于检索 pass
blocks_stale_index_output adapter 标记 stale_index=true 时,gateway 阻断 hits 并记录带 remediation item id 的 reindex/gap receipt pass

当前结论

  1. SearchConnector 可以作为 Tool Gateway 后面的工具能力,而不是让 Agent 直接自由访问检索对象。
  2. allowed_scopes 不能由 Agent 自己扩大;请求中的 scope 必须是用户 scope 的子集。
  3. SearchConnector 自身仍然要做权限和 lifecycle 过滤;Tool Gateway adapter 再做一次输出后置过滤,防止不安全 adapter 返回 restricted 或 deleted evidence。
  4. 对外给模型或审计看的 safe output 不包含 source_uri,避免无权限用户看到敏感路径或对象存在性。
  5. SearchConnector Tool Gateway 现在支持已认证用户携带的 namespaced scopes,例如 person:employee-demodept:financeproject:orgreorg-framework-mvp
  6. rank_log 只保留安全字段;候选对象 ID、source URI、owner、debug note 不应进入 safe output。
  7. stale_index=true 已从状态传播 benchmark 进入 runtime 策略:默认阻断本次检索 hits,保留 adapter/generation/latency/cost/context library 等安全状态字段,并通过 context.report_gap 记录带 Projection Remediation item id 的 high severity 缺口。

当前没证明什么

  • 这还没有接真实 Postgres/OpenSearch adapter。
  • 这还没有接入真实组织 IAM 或源系统权限,只验证了 Framework adapter 的 scope 子集语义。
  • Tool Gateway 层仍是保守阻断;按任务风险分级的 stale-index 策略已经上移到 Context Router Stale Policy Eval,关键风险补证路径已经由 Projection Remediation Eval 固化为本地 contract。

已完成的后续接入

  • orgreorg_demo --search-card-index--reindex-cards 已切到 Knowledge Card Tool Gateway
  • knowledge_card.search 会先过 Tool Gateway,再内部调用 context.search,继续复用 SearchConnector Tool Gateway。

下一步

  1. 把真实 Postgres/OpenSearch adapter 接到同一 gateway conformance。
  2. 把真实组织 IAM / 企业微信通讯录权限映射成 person:*dept:*project:* permission view。
  3. 将 SearchConnector high severity gap receipt 接入真实 Projection Remediation worker / review adapter。