Skip to content

fix(secrets): skip unnecessary managed proxy injection for zero-binding runs - #143231

Draft
roboclaw-bot wants to merge 1 commit into
mainfrom
openclaw/autoreview-proxy-provenance-20260909
Draft

roboclaw-bot wants to merge 1 commit into
mainfrom
openclaw/autoreview-proxy-provenance-20260909

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Gateway exec currently injects managed authenticated proxy settings even when its run has no secret bindings and the running proxy has no traffic or bypass-routing policy. That can replace inherited networking settings unnecessarily.

Why This Change Was Made

The running proxy owns the captured policy. Its handle now exposes whether routing is required without bindings; the registry omits managed settings only for zero bindings with an explicit false result. A later configuration snapshot cannot weaken the active policy.

User Impact

Empty-binding runs without traffic/bypass policy retain their inherited network settings. Explicit allowlists (including [] lockdown), configured bypass hosts, and nonempty bindings keep managed routing. Existing admission, authentication, CA, destination-binding, and revocation code is unchanged. Autoreview is unchanged. This is not a universal fix for authenticated-proxy consumer compatibility.

Evidence

  • Original production bytes were restored and verified against base 14c5ab4 before testing the new regressions. Two core cases and two real-proxy cases failed for the expected over-injection.
  • Final focused validation: 81 tests passed across five files / three shards: 6 cron cases, 42 proxy/lifecycle cases, and 33 core-exec/admission cases. The final lint-only cron table rewrite was followed by another passing six-case cron run.
  • Test fixtures now isolate the Gateway owner from their parent exec lease and send local proxy-client traffic to the loopback proxy under test rather than an ambient second proxy; TLS verification and all refusal/revocation assertions remain intact.
  • Assertion predicates are preserved but sensitive environment checks now report booleans instead of serializing environment values into a failure.
  • Formatting and the complete changed-check gate passed (exit 0), including core/core-test typechecking, lint, dead exports, import cycles, and safety guards.
  • Mandatory precommit autoreview could not complete on this host. The canonical helper rejected the managed authenticated proxy before review; that is fixed in the companion openclaw/agent-skills PR. After that fix, the Codex engine turn fails through the managed proxy WebSocket transport (trivial calls succeed via HTTPS fallback; the high-reasoning review turn does not). Three review attempts failed identically at codex engine failed (1). No review verdict exists. Human review is requested on this draft.

Scope / Related Work

Related #140609 handles lowercase proxy aliases; this change addresses whether zero-binding injection is necessary, not alias precedence. No live proxy/configuration, credential, TLS, approval, or egress-host changes.

Co-author trailers on the commit: steipete and Kimiyu-186.

Worked on by:

@clawsweeper

clawsweeper Bot commented Sep 9, 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 gateway Gateway runtime agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Sep 9, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 4, 2026, 9:40 AM ET / 13:40 UTC (Revision 2).

ClawSweeper review

What this changes

The PR preserves inherited proxy and certificate settings for Gateway commands with no secret bindings or explicit routing policy, with regression coverage and documentation.

Merge readiness

⛔ Blocked before merge - 2 items remain

This remains a useful, distinct repair, and no blocking defect was found in the pinned patch. Current main still injects managed settings for empty bindings, but its process-owned, worker-backed implementation requires refreshing this conflicted draft. The protected maintainer label also prevents cleanup closure.

Priority: P2
Reviewed head: 76c5a6abf94981cbe51cb0232e5c01b8c992f70b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The pinned patch is focused and has meaningful regression coverage; draft status and merge conflicts do not reduce its implementation rating.
Proof confidence 🌊 off-meta tidepool Not applicable: The recorded automation-account exemption applies. The body reports exec environment regressions and real-loopback proxy refusal coverage, but those results are supplemental and were not independently executed here; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The recorded automation-account exemption applies. The body reports exec environment regressions and real-loopback proxy refusal coverage, but those results are supplemental and were not independently executed here; no stored-data contract changes.
Evidence reviewed 10 items Pinned introduction boundary: Reviewed the merge-base-to-head delta, excluding endpoint drift and base-branch changes. No pinned test merge is available, so no claim is made that merging would remove current-main behavior.
Routing decision belongs to the active owner: The registry omits managed settings only for empty bindings without captured routing requirements. The server derives that requirement from a defined traffic allowlist, including lockdown [], or nonempty bypass hosts.
Admission and protected routing remain intact: Gateway exec still requires an admitted run and checks active source authority before registration. Nonempty bindings and explicit routing policies retain authentication, destination checks, and revocation. The omission creates no credential or cross-principal grant; documentation already states that raw sockets can bypass cooperating-client proxy routing.
Findings None None.
Security None None.

How this fits together

Gateway exec prepares and launches agent subprocesses. Secret Egress supplies managed proxy settings that let those subprocesses use protected credentials at permitted destinations.

flowchart TD
  A[Gateway exec request] --> B[Validate run admission]
  B --> C[Read secret bindings]
  C --> D{Bindings or captured routing policy?}
  D -->|Yes| E[Supply managed proxy settings]
  D -->|No| F[Preserve inherited network settings]
  E --> G[Launch subprocess]
  F --> G
Loading

Before merge

  • Resolve merge risk (P1) - The draft conflicts with current main; its run-registration guard must be refreshed for process-owned grants and the worker-backed proxy, then reviewed and validated on the resulting head.
  • Complete next step (P2) - Refresh the patch for current process and worker registration, resolve merge conflicts, obtain the listed secops-owner review, and mark the draft ready before landing.
Agent review details

Security

None.

PR surface

Source +8, Tests +176, Docs +2. Total +186 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 8 0 +8
Tests 4 203 27 +176
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 213 27 +186

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the omission decision with the active proxy's captured policy across server and worker paths, while preserving process-grant revocation and explicit routing requirements.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the omission decision with the active proxy's captured policy across server and worker paths, while preserving process-grant revocation and explicit routing requirements.

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

Yes, from source: current Gateway spawn registers empty bindings and overlays managed proxy and CA settings even without routing policy. No runtime reproduction was executed during this read-only review.

Is this the best way to solve the issue?

Yes, the captured-policy guard is a focused repair that preserves lockdown and secret-bearing behavior; it must now be carried into current main's process and worker owners.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1e5bfe69a8b6.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The recorded automation-account exemption applies. The body reports exec environment regressions and real-loopback proxy refusal coverage, but those results are supplemental and were not independently executed here; no stored-data contract changes.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded networking compatibility repair for Gateway exec when the optional Secret Egress proxy is enabled.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The recorded automation-account exemption applies. The body reports exec environment regressions and real-loopback proxy refusal coverage, but those results are supplemental and were not independently executed here; no stored-data contract changes.

Evidence

What I checked:

  • Pinned introduction boundary: Reviewed the merge-base-to-head delta, excluding endpoint drift and base-branch changes. No pinned test merge is available, so no claim is made that merging would remove current-main behavior. (76c5a6abf949)
  • Routing decision belongs to the active owner: The registry omits managed settings only for empty bindings without captured routing requirements. The server derives that requirement from a defined traffic allowlist, including lockdown [], or nonempty bypass hosts. (src/secrets/egress-proxy/registry.ts:49, 76c5a6abf949)
  • Admission and protected routing remain intact: Gateway exec still requires an admitted run and checks active source authority before registration. Nonempty bindings and explicit routing policies retain authentication, destination checks, and revocation. The omission creates no credential or cross-principal grant; documentation already states that raw sockets can bypass cooperating-client proxy routing. (src/agents/bash-tools.exec-run.ts:435, 76c5a6abf949)
  • Current main still exhibits over-injection: An empty binding array is truthy, so the current spawn owner registers a process grant and overlays its environment. The current registry delegates without an empty-binding exception, and the server returns managed proxy and CA variables for its default empty bindings. (src/agents/bash-tools.exec-runtime.ts:815, 1e5bfe69a8b6)
  • Release comparison: The verified v2026.9.8 tag resolves to the supplied release SHA, and its registry delegates unconditionally to process registration. Further release runtime/server blob inspection failed because those objects were unavailable and retrieval returned HTTP 403; no shipped fix is established. (src/secrets/egress-proxy/registry.ts:46, fc23bc864e45)
  • Current ownership and lifecycle history: Git history identifies process-owned grants in merged fix: preserve background command proxy access across turns #152557 and worker forwarding in merged perf(secrets): move egress forwarding off the main thread #156354. Both were verified through GitHub. Source-line blame failed on an unavailable historical blob, so no introducing-author claim or history pointer is supplied. (src/secrets/egress-proxy/registry.ts, 872ede176ba5)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • openclaw/openclaw-secops: 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.

  • Refresh the repair against process-owned grants and worker-backed routing, then validate environment preservation and retained routing-policy cases on the updated head.

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 (1 earlier review cycle)
  • reviewed 2026-09-09T15:46:52.073Z sha 76c5a6a :: needs real behavior proof before merge. :: none

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

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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