Skip to content

fix(codex): preserve enabled network restrictions on invalid config - #156906

Merged
kevinlin-openai merged 4 commits into
mainfrom
dev/kevinlin/openclaw-network-policy-spec
Sep 24, 2026
Merged

kevinlin-openai merged 4 commits into
mainfrom
dev/kevinlin/openclaw-network-policy-spec

Conversation

@kevinlin-openai

@kevinlin-openai kevinlin-openai commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Codex could silently discard an enabled network allowlist when another plugin setting passed manifest validation but failed runtime parsing. Invalid enabled configurations now stop with the rejected field path and a repair instruction, without exposing configuration values.

User Impact

The existing appServer.networkProxy.domains API and native enforcement remain unchanged. Valid and disabled configurations retain their behavior. After updating, users with blank optional networkProxy.profileName or remoteWorkspaceRoot settings can run openclaw doctor --fix; the existing Codex Doctor removes only those blank fields and preserves the domain rules. Other invalid fields require correction before Codex runs.

Why This Change Was Made

Keep networking policy in native Codex and compatibility repair in the existing plugin Doctor. The docs explain approvalPolicy: "never", explicit denies, and native managed-policy inheritance. No new network policy system, config API, or core startup hook is added.

Evidence

  • Five parser regressions and five new Doctor cases pass, plus 11 existing Doctor cases. Final parser wrapper: 39.41s including 25.843s cold compilation; Doctor new/existing wrapper: 42.00s. The initial full config suite (160 cases), 30 lifecycle/version/backend cases, and profile-rotation case remain applicable to unchanged paths.
  • All 26 repository-selected changed-file checks pass, including types, lint, Doctor contracts, boundaries, dead exports, and import cycles. CI and the final security gate pass on 284c7f8d39440890e78e0fd00ad8a60241ac6da7.
  • CI reported case execution totals: five parser cases 50ms and five Doctor cases 30ms. These exclude compilation/import/setup; their full multi-file jobs took 284s and 306s respectively.
  • Published OpenClaw 2026.9.6 plugins update successfully replaces the original official plugin with the candidate, then explicit doctor --fix removes the two blank fields, preserves the allow/deny map, and leaves identical config bytes on a second run. All 158 installed files match the frozen candidate before and after Doctor.
  • This is a same-version compatibility replay: the existing version-sync tool aligns only the disposable candidate package metadata to the published host; all 157 other files, including compiled code, are unchanged. No package was published or tracked version changed.
  • The final manifest stays unchanged because the shipped updater validates candidate config before the new Doctor is available. A stricter manifest caused rollback in the initial replay and was removed.

Native Codex 0.155.1 through the OpenClaw resolver/client accepted allowed HTTPS GETs in full and limited modes and rejected unlisted and explicitly denied hosts. Managed allow inheritance was confirmed. A direct TCP attempt with proxy variables cleared and a pre-resolved address failed while proxied HTTPS to the same host succeeded. This lower-level proof used command/exec; POST method restrictions and controlled origin receipt counts remain unverified.

Independent code, simplification, documentation, and dead-code reviews found no remaining issues. The isolated CLI autoreviewer could not access its configured models and produced no report.

Live OpenClaw → Codex verification

A separate isolated OpenClaw gateway ran three successful agent turns with native Codex 0.155.1 and gpt-5.4. OpenClaw authored only github.com: "allow", with the proxy enabled, approvalPolicy: "never", and workspace-write sandboxing. Hosted/cached web search, standalone search, web fetch, browser, Codex apps, and OpenClaw's host execution tools were disabled. Native session receipts contain eight real exec_command calls and zero web-search items; curl used normal TLS and fresh URL query nonces.

  • https://github.com/robots.txt: HTTP 200, exit 0.
  • example.com, example.org, www.wikipedia.org, and www.python.org: native policy rejection before execution.
  • api.github.com: reachable; GitHub returned HTTP 403 with its rate-limit headers, not a policy rejection.
  • https://nodejs.org/robots.txt: HTTP 200, exit 0 despite being absent from the OpenClaw-authored map.

The managed host supplied 182 inherited allows and 42 denies. Consequently this is not a strict GitHub-only policy on that host: OpenClaw's map does not revoke native managed allowances. The test proves real model-driven execution and denial outside the effective native policy, not universal denial of every host absent from the OpenClaw map. The isolated gateway and its child processes were stopped after verification.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: codex size: S labels Sep 24, 2026
@clawsweeper clawsweeper Bot added P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 23, 2026, 10:25 PM ET / September 24, 2026, 02:25 UTC (Revision 3).

ClawSweeper review

What this changes

The Codex plugin rejects invalid enabled network proxy settings, repairs two blank saved fields through Doctor, and documents native domain restrictions.

Merge readiness

⛔ Blocked before merge - 3 items remain

Current main and v2026.9.6 still discard the malformed enabled proxy configuration. This PR addresses that defect, but its deliberate interruption of existing Codex sessions after an update needs an owner decision before merge.

Priority: P0
Reviewed head: 284c7f8d39440890e78e0fd00ad8a60241ac6da7
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused repair and installed upgrade evidence are useful, while one combined final retry demonstration would improve confidence in the post-update flow.
Proof confidence 🦐 gold shrimp (3/6) Sufficient (terminal): The PR reports a published v2026.9.6 updater activating the candidate, followed by installed Doctor repair that preserved domain rules and was byte-identical on a second run; an earlier production resolver-to-native command/exec probe observed allowed and denied traffic. The final installed invalid-config, repair, and policy-bound retry sequence is not captured together. The stored-config repair has focused tests and a reported same-version published-driver replay, supporting compatibility of the repaired data.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR reports a published v2026.9.6 updater activating the candidate, followed by installed Doctor repair that preserved domain rules and was byte-identical on a second run; an earlier production resolver-to-native command/exec probe observed allowed and denied traffic. The final installed invalid-config, repair, and policy-bound retry sequence is not captured together. The stored-config repair has focused tests and a reported same-version published-driver replay, supporting compatibility of the repaired data.
Evidence reviewed 13 items Current main retains the defect: The current-main parser returns an empty configuration after a failed parse, which can discard an enabled network policy admitted by the manifest.
Latest release retains the defect: The v2026.9.6 parser also returns an empty configuration on this failure; the PR's guard is not already shipped.
Introduced admission guard: The introduced branch throws a field-specific error when raw configuration explicitly enables the proxy and parsing fails; the disabled path retains its previous fallback.
Findings None None.
Security None None.

How this fits together

OpenClaw validates saved Codex plugin settings before resolving an app-server session. The resolver passes valid network rules into a native Codex permission profile that governs sandboxed commands.

flowchart LR
A[Saved Codex settings] --> B[Plugin validation]
B --> C{Enabled proxy valid?}
C -- Yes --> D[Native permission profile]
D --> E[Sandboxed commands]
C -- Blank fields --> F[Doctor repair]
F --> A
C -- Other invalid input --> G[Visible error]
Loading

Decision needed

Question Recommendation
Is it acceptable for saved, manifest-valid Codex proxy configurations with blank optional fields to stop Codex sessions after update until the operator runs Doctor? Accept explicit Doctor recovery: Keep the fail-closed behavior and require the documented Doctor repair for affected saved configurations.

Why: The branch prevents silent loss of network restrictions, but choosing an operator-visible interruption over automatic recovery is an upgrade policy decision.

Before merge

  • Resolve merge risk (P1) - A v2026.9.6 user with an enabled proxy and either saved blank optional field can update successfully but cannot start a Codex session until they run openclaw doctor --fix; no owner has explicitly accepted that interruption.
  • Complete next step (P2) - Obtain an explicit Codex/plugin owner decision on the post-update Doctor requirement before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +45, Tests +215, Docs +179. Total +439 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 47 2 +45
Tests 2 215 0 +215
Docs 3 181 2 +179
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 443 4 +439

Review metrics

Metric Value Why it matters
Production and regression coverage production +45 net lines, tests +215 lines The production growth is limited to the parser guard and Doctor repair, with separate admission and stored-config checks.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/codex/doctor-contract-api.ts, unknown-data-model-change: extensions/codex/doctor-contract-api.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge-risk options

Maintainer options:

  1. Accept the safe interruption (recommended)
    Explicitly accept manual Doctor recovery for saved blank fields after confirming the documented operator impact.
  2. Make recovery automatic
    Reuse the Doctor-owned transform before an affected Codex turn and verify it against the published update driver.

Technical review

Best possible solution:

Keep invalid enabled policies fail-closed and use the existing Doctor transform for safe normalization, with a visible update recovery path before the next Codex turn.

Do we have a high-confidence way to reproduce the issue?

Yes: current-main source shows that a manifest-valid blank optional field makes parsing fail and returns empty configuration, discarding the enabled proxy. This read-only review did not execute that path.

Is this the best way to solve the issue?

Yes for preserving the network policy and keeping repair with the plugin's Doctor owner. Whether the required manual recovery is the right upgrade experience remains an owner decision.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d9d8f0829d87.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR reports a published v2026.9.6 updater activating the candidate, followed by installed Doctor repair that preserved domain rules and was byte-identical on a second run; an earlier production resolver-to-native command/exec probe observed allowed and denied traffic. The final installed invalid-config, repair, and policy-bound retry sequence is not captured together. The stored-config repair has focused tests and a reported same-version published-driver replay, supporting compatibility of the repaired data.

Label justifications:

  • P0: The existing parser can silently discard an explicitly enabled network restriction, leaving a security boundary unenforced.
  • merge-risk: 🚨 compatibility: The new fail-closed behavior can stop previously starting Codex sessions that carry saved blank optional fields.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR reports a published v2026.9.6 updater activating the candidate, followed by installed Doctor repair that preserved domain rules and was byte-identical on a second run; an earlier production resolver-to-native command/exec probe observed allowed and denied traffic. The final installed invalid-config, repair, and policy-bound retry sequence is not captured together. The stored-config repair has focused tests and a reported same-version published-driver replay, supporting compatibility of the repaired data.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR reports a published v2026.9.6 updater activating the candidate, followed by installed Doctor repair that preserved domain rules and was byte-identical on a second run; an earlier production resolver-to-native command/exec probe observed allowed and denied traffic. The final installed invalid-config, repair, and policy-bound retry sequence is not captured together. The stored-config repair has focused tests and a reported same-version published-driver replay, supporting compatibility of the repaired data.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Dallin Romney: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Capture a redacted installed Codex run showing invalid enabled settings rejected before execution, Doctor repair, and a successful policy-bound retry.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-24T01:31:21.784Z sha 4bd2f0d :: blocked before merge. :: [P1] Migrate shipped configs before making parsing fatal | [P2] Identify the rejected field without exposing its value
  • reviewed 2026-09-24T02:15:54.898Z sha 284c7f8 :: blocked before merge. :: none

@kevinlin-openai

Copy link
Copy Markdown
Contributor Author

Addressed both findings in the follow-up commit:

  • The existing Codex Doctor repairs blank optional appServer.remoteWorkspaceRoot and appServer.networkProxy.profileName when the proxy is enabled. It preserves the domain rules and unrelated plugin configuration. The public manifest stays unchanged so the shipped updater can activate the candidate; affected users then run openclaw doctor --fix.
  • Runtime errors identify the rejected static field without exposing values or dynamic map keys, and point to Doctor for supported repairs. Other malformed enabled configurations intentionally stop before command execution; silently falling back would discard the requested network restrictions.

Verified the actual published OpenClaw 2026.9.6 updater against a restored official-plugin baseline with both saved blank fields. The candidate activates successfully, all 158 installed files match the packed artifact before and after Doctor, Doctor removes only those plugin fields while retaining enabled/allow/deny rules, and its second run leaves config bytes unchanged. This is a same-version candidate compatibility replay: the established version-sync tool changes only disposable package metadata to satisfy the published host; all compiled code is unchanged. No package or version was released.

Five parser regressions, five new Doctor cases, 11 existing Doctor cases, and all 26 selected repository checks pass. The previous release accepted the saved shape but discarded the plugin config at runtime; the repair restores authored network intent rather than claiming prior enforcement.

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 24, 2026
@kevinlin-openai
kevinlin-openai merged commit 4f6eb26 into main Sep 24, 2026
115 checks passed
@kevinlin-openai
kevinlin-openai deleted the dev/kevinlin/openclaw-network-policy-spec branch September 24, 2026 02:53
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 24, 2026
…penclaw#156906)

* docs(codex): specify native network allowlist behavior

* fix(codex): reject invalid config with enabled network restrictions

* fix(codex): repair blank network options and explain config errors

* docs: remove task-specific network allowlist spec
@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
roboclaw-bot added a commit that referenced this pull request Sep 25, 2026
Backport #151260: 1a7ba53
Backport #156906: 4f6eb26

Keep saved native policy and explicit ask/false behavior. Reject invalid
enabled network settings without exposing values; preserve the existing
plugin-owned repair of blank optional fields and binding invalidation.

Co-authored-by: stevenlee-oai <[email protected]>
Co-authored-by: Kevin <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
Co-authored-by: steipete <[email protected]>
Co-authored-by: jalehman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: codex merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant