Skip to content

Guard BYOC runtimes with loopback-only isolation - #9570

Open
loopx-agent wants to merge 2 commits into
mainfrom
codex/byoc-zero-egress-domain-operator-20261129
Open

loopx-agent wants to merge 2 commits into
mainfrom
codex/byoc-zero-egress-domain-operator-20261129

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A self-hosted operator needs a way to confirm the LoopX runtime can use its local PostgreSQL deployment while denying non-loopback network access and suspending usage telemetry. Extension manifest permissions govern LoopX's managed calls. The process still depends on the operating system for network isolation.

Changes

  • LOOPX_BYOC_ZERO_EGRESS=1 makes the CLI require a loopback-only Linux network namespace, dropped capabilities, no new privileges, and no inherited sockets. Doctor explains a blocked launch or reports readiness. The supported deployment keeps its namespace isolated and excludes host sockets and relays. Docker none network · Linux no new privileges
  • The existing usage statistics owner suppresses observation and delivery in BYOC mode. Settings shows the effective suspension while the deployment sets the policy. Relaunch with the setting absent or 0 to return to ordinary behavior.
  • The standalone Domain Operator example uses an external installation path and the existing extension lifecycle. It evaluates shape, configured PostgreSQL identity, and allocation as three checks. Setup, diagnosis, and recovery are in the operator guide.

Validation

  • Tested signed commit on main 811c1a1f6665. Standard premerge passed all 19 selected checks. Focused Ruff, CLI regression, telemetry, and the RemoteAuthority client and gateway suites passed.
  • Installed the candidate wheel offline in an isolated Linux container. Doctor returned success with loopback-only readiness. A real PostgreSQL 16.15 server supplied a synthetic row over loopback. A listening canary on a separate test bridge received exactly one control request. The guarded process had no route to the canary, and the CLI refused admission when placed on the bridge.
  • With saved telemetry consent and a local collector, ordinary mode delivered three requests. BYOC delivered zero and preserved the saved state.
  • Installed the example from an independent directory via loopx extension. The accepted state passed all three checks; mismatched identity, over-allocation, and malformed state each produced the expected rejection. Missing executable and restoration were verified through Extension Doctor.
  • The packaged settings view was exercised against the real usage API in the isolated Linux runtime with synthetic state. Saved consent was enabled, sending was false, and the deployment-controlled checkbox was disabled at both viewports.

Review follow-up

The signed follow-up addresses the collapsed settings finding. Capability Center shows Paused by BYOC in the existing Usage Statistics entry when the usage API reports the deployment pause. The entry shows its title while the status loads. Opening it still shows the saved consent and the deployment-controlled checkbox.

The follow-up passed all six direct checks and 19 selected premerge checks. We built the desktop and Chat bundles, installed the candidate wheel offline, and checked the packaged Capability Center against the real usage API in isolated Linux. At desktop and 390 px, BYOC mode showed a paused summary and a checked, disabled control. With BYOC off, the ordinary summary and checked, editable control were visible. Keyboard expansion and collapse worked at 390 px with reduced motion. Wheel comparison isolated the change to packaged Chat assets.

Visual evidence

Capability Center with Usage Statistics collapsed. The screenshots use synthetic settings on the installed candidate wheel.

Deployment Desktop 390 px
BYOC on Desktop Capability Center showing usage reporting paused by BYOC 390 px Capability Center showing usage reporting paused by BYOC
BYOC off Desktop Capability Center showing the ordinary usage statistics label 390 px Capability Center showing the ordinary usage statistics label
Before the follow-up, with BYOC on Before the follow-up, desktop Usage Statistics still describes default reporting with BYOC on Before the follow-up, narrow Usage Statistics still describes default reporting with BYOC on

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

动机 / Motivation

自托管操作者需要在可继续读取本机 PostgreSQL 的同时,验证部署内的 LoopX 进程不会发送遥测。 旧 CLI 即使运行在普通网络中也继续运行,已有统计同意仍可触发发送。 已同意统计的测试实例从普通网络切到隔离部署。操作者希望原同意可在回退时恢复,但当前请求应该为零。 独立构建并安装的 Linux wheel 在真实环回环境通过;切入 BYOC 后本地收集器从三次请求降到零次新增,保存状态逐字节一致。 验证使用一次性 Linux namespace、合成状态以及独立的 PostgreSQL 16.15。系统启动隔离、主机 socket 和转发器由部署者负责。 本轮 PostgreSQL 直连以 psql 验证,TLS gateway 另用契约测试。视觉范围包括作者录制的两图与独立打包 API,未重新录制界面交互。任意主机挂载、转发器和运行中对命名空间的更改仍由部署治理。

改动思路 / Approach

在现有 CLI 及 Doctor 入口共用只读的进程准入检查,Python 提前停止采集,既有 TypeScript owner 阻止观察与发送。 操作系统持有隔离,Core 校验启动事实,遥测 owner 持有同意与状态。仓外扩展不改变数据库授权或 Core schema。 进程隔离、无观察或发送、保留同意与仓外扩展诊断。 入口挂载、Doctor、使用状态、App 展示和外部扩展为这次共享的本地路径。

具体改动 / Changes

精确提交 97dc735。目标基线 811c1a1,复审对照 811c1a1。15 个文件,增加 321 行、删除 5 行。评审条件 LOCAL-ENTRYPOINT、DISABLED-PARITY、TELEMETRY-MACHINE-CONSENT、EFFECTIVE-SETTING-STATUS、EXTERNAL-OPERATOR-RECOVERY。 原始契约

关键代码讲解

  • inspect_byoc_zero_egress。显式启用才校验 Linux 接口、环回类型、能力位、NoNewPrivs 和继承 socket。任一证据失败时拒绝。 源码
  • main。普通 CLI 在进入业务处理前应用同一检查,Doctor 保留可读诊断。 源码
  • blockedBy。TypeScript 遥测 owner 在同意、观测和发送边界保留部署优先级。 源码
  • UsageStatisticsSettings。保留保存的勾选状态,禁用修改控件并说明当前暂停。 源码
  • evaluate。仓外进程检查状态形状、与配置的 store identity 一致、分配未超限,原扩展 owner 负责加载和诊断。 源码

对主干的风险 / Risks

仅有环回接口的 Linux 进程运行该 wheel 后 返回 ready,真实 PostgreSQL 16.15 在同一命名空间用 127.0.0.1 读回合成行。打包 Chat HTTP 返回已同意、sending=false 和 byoc_zero_egress,并成功提供 HTML。作者附的 1280×840 和 430×850 两图均显示保存勾选、禁用和暂停原因。仓外扩展通过三项检查,入口文件恢复后 Doctor 回到 ready。 本机通过 1 项 CLI、11 项遥测、3 项 gateway 和 7 项 client 定向检查。Quick premerge 6 项直接检查及 4 项选定检查通过。基线与候选在变量缺省和 0 时,版本 JSON 全等且 Doctor 结果键一致。

失败与恢复

另一个内部 bridge 上装同一 wheel,Doctor 拒绝且普通命令退出 2。环回中继承本地 socket 或提供非法模式均被拒绝。合成状态超额时返回 allocation=failed;暂移入口时 Doctor 明确返回 entrypoint_missing、available=false、verified=false。

  • [P2] 部署已启用 BYOC,用户进入能力中心并查看默认折叠的使用统计设置。 打包服务的真实 HTTP 已返回 sending=false 和 byoc_zero_egress。组件默认闭合时,唯一可见的 summary 仍读告知后默认开启、可关闭。暂停提示与禁用的勾选框都在折叠区内,部署者必须展开才能确认关键的隐私状态。 源码

我的整体评价 / Verdict

REQUEST_CHANGES。 后端的隔离与遥测验证通过。默认折叠时,设置仍只显示告知后默认开启和可关闭,生效的 BYOC 暂停状态需要展开才能看到。 用已有 blocked_by 字段给折叠的标题提供生效状态;在展开项继续保留用户同意和部署暂停的详情。 在启用与关闭两种状态重新打开能力中心,留桌面和窄屏折叠态图,并核对展开后存量同意仍可读。

折叠标签需反映部署的生效状态;展开视图里的暂停说明及禁用控件已经可见。 默认折叠标签由精确源码对照打包 HTTP 核实,本轮只逐图查看了作者的两张展开态截图。

English verdict: REQUEST_CHANGES at 97dc735. The wheel passes the loopback, PostgreSQL, telemetry and external extension checks. The collapsed Usage Statistics entry still says reporting is on after notice and hides the active BYOC suspension.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

在本地 Capability Center 验证自托管部署和统计隐私状态的操作者。 已同意使用统计的设备启用了 BYOC。旧提交的 GET 已显示发送暂停,但默认折叠标题仍表示告知后默认开启。 独立重建并离线安装新 wheel。旧头和新头在 1200×888 英文与 390×844 中文均实际复验。BYOC 启用时旧头标题保留普通说明,新头标题显示暂停,展开仍显示勾选的禁用统计开关。 整条 PR 为 15 文件 +327/-6。相对上一独评头,变化限一个 TSX 文件 +8/-3。 此次在无网络、无额外权限的 Linux 容器使用合成设备状态,通过本机只读桥连接实际 Chat HTTP。PostgreSQL、收集器和仓外扩展使用上一独评头的验证,已对照包内实现一致。 旧头 P2 已关闭。两 wheel 的文件内容差异限 Chat 资源和包索引,运行时和外部 operator 的源码也没有相对旧头改动。

改动思路 / Approach

部署启用 BYOC 后,现有 usage API 返回 blocked_by=byoc_zero_egress。前端复用这一状态更新折叠标题,展开后继续显示已保存偏好。 Linux 持有实际边界。Doctor 和 CLI 读启动事实。原 usage owner 持有同意、统计和发送。设置只显示其回报。 整条 PR 为 15 文件 +327/-6。相对上一独评头,变化限一个 TSX 文件 +8/-3。

上一轮独评

具体改动 / Changes

精确提交 2d2193fdd455bd3f819a4f7c2d359c0ddd46137b,基线 811c1a1f66652d3fc3b9830d467e14b45b7423c1。整条 PR 为 15 文件 +327/-6。相对上一独评头,变化限一个 TSX 文件 +8/-3。

  • BYOC-COLLAPSED-STATE。独立重建并离线安装新 wheel。旧头和新头在 1200×888 英文与 390×844 中文均实际复验。BYOC 启用时旧头标题保留普通说明,新头标题显示暂停,展开仍显示勾选的禁用统计开关。 验收契约
  • BYOC-DISABLED-PARITY。同一打包版本在 BYOC=0 下返回 sending=true,显示普通标题与已勾选可编辑的开关。三个环境均实测键盘 Enter 展开收起,使用 reduced motion。API 状态加载前只显示标题。 验收契约
  • UNCHANGED-ISOLATION。旧头 P2 已关闭。两 wheel 的文件内容差异限 Chat 资源和包索引,运行时和外部 operator 的源码也没有相对旧头改动。 新头完整标准预合并 19 项和定向 invalid-mode CLI 用例通过。上轮独立 Linux/PostgreSQL 16.15、遥测收集器基线 3 次对照 BYOC 新增 0 次及仓外扩展恢复证据按相同后端文件归因。 验收契约

关键代码讲解

  • 显式配置时检查 Linux 环回接口、权限和继承 socket;没有合格事实则拒绝普通入口。 inspect_byoc_zero_egress
  • 给缺少隔离的部署返回 typed readiness 与失败原因。 handle_doctor_command
  • 部署级 BYOC 状态优先于设备统计偏好,发送和观测由原 usage owner 决定。 blockedBy
  • 读现有 blocked_by,在默认折叠标题中显示暂停;展开项保留同意及部署状态。 UsageStatisticsSettings
  • 仓外扩展比较合成 Domain State 的形状、已配置身份和配额。 evaluate

对主干的风险 / Risks

新头完整标准预合并 19 项和定向 invalid-mode CLI 用例通过。上轮独立 Linux/PostgreSQL 16.15、遥测收集器基线 3 次对照 BYOC 新增 0 次及仓外扩展恢复证据按相同后端文件归因。 旧头 P2 已关闭。两 wheel 的文件内容差异限 Chat 资源和包索引,运行时和外部 operator 的源码也没有相对旧头改动。 此次在无网络、无额外权限的 Linux 容器使用合成设备状态,通过本机只读桥连接实际 Chat HTTP。PostgreSQL、收集器和仓外扩展使用上一独评头的验证,已对照包内实现一致。
同一打包版本在 BYOC=0 下返回 sending=true,显示普通标题与已勾选可编辑的开关。三个环境均实测键盘 Enter 展开收起,使用 reduced motion。API 状态加载前只显示标题。

我的整体评价 / Verdict

APPROVE。 通过。上一轮 P2 在精确新头关闭,BYOC 开关两态均有独立打包证据。 维持 PR 开放供维护者终审。 能力中心首屏的暂停标题在桌面与窄屏都可直接找到。展开后,桌面同屏显示禁用状态,390 px 滚动可读同意、暂停原因、接收地址和预览。 此次在无网络、无额外权限的 Linux 容器使用合成设备状态,通过本机只读桥连接实际 Chat HTTP。PostgreSQL、收集器和仓外扩展使用上一独评头的验证,已对照包内实现一致。

English verdict: APPROVE at 2d2193f. The old collapsed-state finding is resolved. Independent installed Linux wheels confirmed the paused summary in English and Chinese at desktop and narrow widths. Saved consent stays available, with editing restored when BYOC is off. The runtime files match the previously verified revision.

This branch has not been deployed

No deployments
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.

1 participant