Skip to content

feat(benchmark): authorize exact runner task services - #7845

Merged
huangruiteng merged 2 commits into
mainfrom
codex/benchmark-task-service-access-20261102
Nov 1, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/benchmark-task-service-access-20261102

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

Container-isolated benchmarks may expose their only task endpoint through a container-host alias. Integrity qualification currently treats every such request as external access even when the runner has independently attested a single isolated task service, which makes otherwise isolated runs uncountable.

This change adds an exact runner-owned task_service_access contract. It accepts only explicit HTTP(S) origins on the two container-host aliases with a fixed port, classifies only exact matches as loopback-scoped, fails closed on undeclared/wrong-port/lookalike/userinfo/mixed-external requests, and emits a public receipt containing counts and digests without raw origins. Qualification-time access is excluded from the frozen evaluation-policy digest, matching the existing task-environment contract.

Validation:

  • 425 passed across benchmark-toolkit and digest-owner suites.
  • focused task-service/catalog/digest cases: 37 passed.
  • full risk-based premerge checks passed: 10 catalog canaries, 8 risk-profile smokes, Python compile, diff checks, RFC pairing, and public-boundary scan.
  • premerge correctly reports manual_review_required because this changes benchmark evidence policy; this PR is left for maintainer review and merge.

Signed-off-by: huangruiteng <huangrt01@163.com>
Signed-off-by: huangruiteng <huangrt01@163.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: actor_kind=model_agent; model=gpt-6.1-sol; provider=OpenAI; reasoning_effort=max; declaration_source=runtime_reported

动机 / Motivation

运行隔离容器任务并审计结果的 benchmark runner,需要区分任务服务请求和真正的外网访问。 同一条访问已声明宿主别名与固定端口的轨迹:基线判为外网违规,新 head 在 runner 显式提供精确授权和隔离证明后允许;换端口、伪装域名或混入外网仍拒绝。 真实 qualification CLI 的同输入对照验证了精确 origin 的判定变化、外网及凭据拒绝和无授权时的完整回执兼容。

这里的 origin 指协议、主机与端口的组合。请求指向容器宿主并不等于可以信任整个宿主;需要表达 runner 为这一任务服务作出的精确授权。本次不修改实验评分、任务或冻结 evaluation policy,不启动 benchmark,不据声明证明真实网络隔离,也不宣称 runner 已自动生成授权或真实运行已具备计分资格。 仓库现有容器 runner 尚未自动从可信 launch record 产出该授权;本 PR 交付的是可通过既有 CLI 使用的显式 qualification 输入契约,真实 runner 接入、隔离证明和实际计分资格仍需各自验收。

改动思路 / Approach

精确授权放在现有 Python integrity provider 内,沿用网络分类、隔离 attestation 和公私回执边界;授权意图由 runner 显式提供,分类器不能从 agent 文本或一个域名自动推导许可。 本 PR 交付既有 CLI 可消费的 qualification-time 精确许可与最小公开回执;自动 runner 生成、真实隔离和分数验收没有被这个接口或测试替代。

当前生产入口是已有 benchmark integrity-qualification --policy-json,CLI 读取私有轨迹、attestation 与策略,交给同一个 integrity provider。task_service_access 是 runner/operator 显式作出的许可;端点事实来自可信 launch record,但端点存在本身不能推导授权。现有 edgebench/sforge 的 host mapping 和 task endpoint 说明这一输入有实际来源,尚未自动生成此新声明;本审查没有把手填 fixture 当作 runner 接入证明。

已有 loopback_only 及独立隔离检查继续使用;精确 task service 只增加一种网络分类,不能覆盖其他 credential、external 或 attestation blocker。公开回执是扫描结果投影,authorized 仅表示存在匹配请求,不等于整体运行 qualified。采用已有离线 CLI 的显式策略输入,不要求新的界面、确认轮次或通用权限框架。

具体改动 / Changes

完整审查 6 文件 +425/-10,包括现有 provider、exports/catalog、README,以及 toolkit 与 digest-owner 测试。新建两个 schema id 并扩展既有 NetworkRequestScope;没有新 provider、CLI 命令、持久状态或实验启动入口。

关键代码讲解

  • _validated_task_service_access:闭合六字段,验证 runner/purpose、授权 id/digest、1–8 个排序去重 origin;只接受两种精确容器宿主别名、HTTP(S) 与明确端口。
  • _task_service_origin 与 request helper:声明不能带 userinfo、业务路径、query 或 fragment;请求可以访问资源路径,匹配仍落在精确协议、主机和端口,不能借 lookalike 或其他端口越界。
  • build_benchmark_integrity_qualification:沿用现有网络扫描及其他拒绝条件,混入任一 external URL 仍违规;新回执只含授权标识、计数和 origin-set digest,不复制原始 origin。
  • _validated_policy:像既有 task-environment permission 一样,把 qualification-time 许可排除于冻结 evaluation-policy digest;没有改变 network mode、评分或 evaluation protocol。

规格依据:loopx/capabilities/benchmark_toolkit/README.md,不可变修订 035f7ac666cef390676c00b6fb0537ede3c9cf44。benchmark_integrity_qualification_v0 — implemented:独立 runner attestation、私有输入与最小公开回执;由 425 项测试和真实 CLI 输出扫描覆盖。loopback_only — implemented:新增显式精确许可后,外网/混合 URL 与缺失隔离证明仍拒绝。task_environment_access — implemented:复用其 qualification-time 输入与冻结 digest 边界,新增网络许可按扩展评估;没有把新段落当作它自身的独立规格。

对主干的风险 / Risks

最强反例是把容器别名当作整机 localhost,或一条合法 URL 掩盖同一命令的外网/凭据行为。精确匹配和 external 优先级保留拒绝;真实 CLI 验证 wrong port、scheme、undeclared alias、lookalike、userinfo、mixed external 均失败,缺失隔离与泄露凭据即使 service receipt 为 authorized 也仍 unqualified。authority=runner 是输入约束,不是可信签名;源记录真实性和实际网络隔离由已有 runner owner 证明,不能以本回执替代。

PASS:425 项 toolkit/digest-owner 测试;同一 18 组私有输入在 base/head 共执行 36 次真实源码 CLI。精确 origin 在基线 exit1/external、本 head exit0/qualified;其余安全边界符合预期。输入 fixture SHA-256 为 dcf6e025d25d3f0490c2e93223242e2a4cd2a05930674f94cf81eb64b3d0865d。无声明的 4 类完整 JSON 回执在两修订完全一致,无归一化;加入新服务端口时,旧授权拒绝、新精确授权才允许。公开输出不含原始 alias、私有输入路径或测试凭据值。

PASS:Ruff、compile、premerge 6 项直接检查与 19 项选中检查,0 个命令失败。首个基线探测因未指定隔离 fixture route,在 qualifier 前被两个默认 root 的路由检查拒绝;该失败保留,随后两修订使用同一明确隔离 route 完整执行。没有在生产状态或真实实验上试探。

语义与 CI 对齐

该变更属于 extend_vocabulary:既有 Enum 扩展一个值,两 schema 已登记;按 typed 字段和 exact origin 判断,不从自然语言推断权限。目录/README 的条件化可用性说明会增加,这是有意披露的变化;未声明许可时的运行回执兼容已独立验证,不能把它夸大为所有文案未变。wait_for_ci=false,CI 保留为 UNVERIFIED/unknown 诊断项,没有查询、等待或猜测其原因。

标准 premerge 总退出码仍为 1:当前审查工作区 quality_stale_receipt,另有 benchmark_sensitive maintainer manual-review hold。它们独立于以上通过的代码检查,均未绕过、补造或继承 receipt。合并仍需当前范围质量依据、维护者授权与原生 readiness;本次不执行 merge 或 dismiss。

我的整体评价 / Verdict

APPROVE,作为 justified increment:已有公共 CLI 能独立使用并读回精确分类结果,这比空 schema 多交付了完整可验证行为。长期工作边界 preserved;用户的精确 qualification 路径 improved,但没有宣称自动 runner 接入、真实隔离或分数收益。新增机制留在现有领域 provider,和默认拒绝的边界相称;局部复用 loopback 类别与 digest owner 已完成,无需为该输入建立新控制平面。

检查的是既有 benchmark integrity-qualification CLI、策略 JSON 和能力目录说明,未改变任何渲染页面或产品首屏。 未运行真实 benchmark、容器防火墙或自动 runner 授权生成;未验证任何实际分数的可计入资格。 这一边界与仓库既有“可用入口不等于实际收益/采纳”的经验一致。精确审查 head 为 7d7eda6322223582dd4197253f822325aa28163a,发布前须再次核对 head/action;无当前阻塞 finding,独立合并门禁继续保留。

English verdict: APPROVE — the existing qualification CLI enforces exact optional runner task-service scope while preserving other integrity guards and disabled receipts. Live runner adoption and merge gates remain separate.

@huangruiteng
huangruiteng merged commit cda3ef7 into main Nov 1, 2026
33 of 39 checks passed
@huangruiteng
huangruiteng deleted the codex/benchmark-task-service-access-20261102 branch November 1, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants