Repository navigation
feat: use protected model credentials in Crabbox applications - #156207
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
15c14e9 to
904c091
Compare
|
@clawsweeper re-review The exact synthetic-URI qualification is now merged in openclaw/clawsweeper#1656. The current PR body contains the completed live AWS proof, focused tests, and the lazy-facade contract correction. Please review the current head with the updated host scanner policy. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
|
Codex review: needs maintainer review before merge. Reviewed September 23, 2026, 3:10 AM ET / 07:10 UTC (Revision 2). ClawSweeper reviewWhat this changesAdds a Crabbox command that lets remote applications use host-held model credentials through protected egress, and shares improved streaming secret redaction with fleet output. Merge readiness✅ Ready for maintainer review This remains a distinct implementation candidate. The updated live evidence resolves the prior proof blocker, and the review found no blocking correctness or security defects. Priority: P2 Review scores
Verification
How this fits togetherCrabbox runs applications on temporary remote machines. This command connects their model requests to OpenClaw’s host-side credential proxy, which substitutes credentials only through an active, destination-bound grant. flowchart LR
A[Operator command] --> B[Crabbox CLI adapter]
C[Configured credential reference] --> D[Host credential scope]
D --> E[Revocable secret proxy]
B --> F[Native Crabbox bridge]
G[Remote application with sentinel] --> F
F --> E
E --> H[Allowed model provider]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +390, Tests +365, Docs +177, Config +7, Other +2. Total +941 across 23 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep credential authorization in the existing secret-proxy owner and bridge execution and cleanup in native Crabbox, with the documented foreground-only scope. Do we have a high-confidence way to reproduce the issue? Not applicable to the primary feature request; source confirms the workflow is absent from main, and the supplied live transcript exercises the added command. Is this the best way to solve the issue? Yes. The adapter reuses the existing credential and native lifecycle owners, adds no competing credential store, and preserves existing workflows. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 78e3b5cc97eb. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review The main PR body now has an explicit Real Behavior Proof section with the executed public CLI command, tested source revisions, synthetic probe, observed stdout, cleanup readback, and limits. The prior review found no code/security defects but recorded a not-applicable proof assessment; this is a runtime integration with completed live AWS proof. The current head also repairs the CI persistence fixture by awaiting its existing exact-claim completion callback, with passing focused tests, lint, type checking, and independent review. Please assess the current head and complete proof package. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
03d2dae to
f7547a6
Compare
f7547a6 to
c50d2f3
Compare
|
Merged via squash auto-merge.
|
…aw#156207) * feat: use protected model credentials in Crabbox applications * refactor: use the shared model egress lazy runtime owner
Backport #156166: b6b4524 Selected backport #156207: 741a1c8 Retain request-local response-head failure handling and use the shared stream writer for Fleet output. Remove the retired Fleet-local owner. The unrelated Crabbox protected-credential feature is not included. Targeted transport/registered-handler proof and independent review pass. Full release qualification remains separate. Co-authored-by: siri1410 <[email protected]> Co-authored-by: Ayaan Zaidi <[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]>
Closes #156177
What Problem This Solves
Applications and tests inside a Crabbox lease cannot use a configured model credential without copying its plaintext away from the credential-owning host.
User Impact
openclaw crabbox run --id <lease> --model <provider/model> -- <command>runs a foreground application with a protected API-key sentinel, public CA trust, and an endpoint-bound proxy. The key remains on its original host. This requires a coordinator-backed Linux lease and Crabbox's nativeegress run; OAuth/personal accounts, custom transports, and detached applications are unsupported. No persistent Gateway configuration change or restart is required.Why This Change Was Made
Crabbox now owns bridge startup, execution, cancellation, and exact-session cleanup. The OpenClaw plugin is a thin adapter around the existing SecretRef and secret-proxy owners, with no added model-facing core tool or second credential store. Documentation covers binary capabilities, workspace ownership, preparation, proxy-aware clients, lifetime, and recovery.
Foreground output streams immediately through a shared redactor. Its preexisting overlapping-secret bug was reproduced and fixed while moving the private implementation from fleet to logging; fleet uses that same owner. Native command tests own bridge lifecycle coverage; OpenClaw tests cover credential admission, redaction, and the CLI adapter.
Real Behavior Proof
Claim and surface: A foreground application on an owned AWS Linux lease can make ordinary and streaming model requests through the public
openclaw crabbox runcommand using the host's configured SecretRef, while receiving only a sentinel credential.Environment and revisions: Isolated source build and state/config directories on the credential-owning Linux host, OpenClaw
15c14e982fd7640a77b0c2b9bab6e5b4b168f705, and native Crabbox4af894b76456978b2a96a435b4468f3e0776d65c. The configuration referenced the existing SecretRef; no plaintext key was copied into the worker. No serving Gateway was changed or restarted.Command: The run used
pnpm openclaw crabbox run --id <owned-AWS-lease> --provider aws --binary <candidate-crabbox> --model openai/gpt-5.6-sol --timeout 600 -- python3 -c <synthetic-probe-below>, with isolatedOPENCLAW_CONFIG_PATHandOPENCLAW_STATE_DIR. Lease identifiers and host-local paths are omitted here.Observed trace: Exit status 0 in 20.18 seconds. Both Responses requests returned HTTP 200 and exactly the synthetic marker
NATIVE_EGRESS_LIVE_OK_20260922; the streaming response includedresponse.completed. The worker asserted that the credential was a sentinel and the host-proxy credential variable was absent. A request to an unbound host was refused.Cleanup: Native status showed
host=falseandclient=falseafter command completion. The lease was then released and provider inspection confirmedcleanupStatus=complete,hasHost=false, andprovisioningResourceMayExist=false. The isolated proof directory was removed.Limits: This live proof covers AWS Linux, the configured API-key Responses route, ordinary/streaming output, endpoint refusal, and normal completion cleanup. Cancellation and failure cleanup have focused boundary tests. Subsequent feature changes consist of metadata conflict reconciliation and the shared lazy SDK loader correction; no model-request or bridge protocol changed. The base also incorporates the persistence-fixture fix linked below. The lazy-loader correction passed the model-egress and adapter suites before publication.
Synthetic probe executed inside the lease
Evidence
pnpm test <file> --maxWorkers=1): model egress 25.64s, Crabbox adapter 16.15s, shared redactor 3.55s, fleet runtime 11.33s. Hosted CI timing will come from the final prepared head.The native CLI dependency is merged in openclaw/crabbox#2506. These changes do not publish a release or deploy a Gateway.
Merged hosted review prerequisite: openclaw/clawsweeper#1656 qualifies the three exact synthetic URI fixtures in these tests; scanning and verification remain enabled. CI exposed a duplicate policy check in the lazy SDK facade; the facade now uses the shared lazy runtime owner and forwards admission to its canonical owner. The export-contract guard, core type check, 18 focused tests, and fresh independent P2 review pass after that correction.
CI exposed a pre-existing race in the terminal-persistence ownership fixture: the session-status write was visible while its failure-receipt write was still pending, but the test imposed a separate one-second polling deadline. Main commit 897b8e9 fixes it through the existing exact-claim completion callback, with reproduced failure and stress proof recorded in the commit. This PR incorporates that owning fix through its updated base; final CI runs against the rebased head.
The rebased candidate also incorporates the red-main UI typing repair 813a10e. That owning fix carries the existing route-resolution callback through cached/revalidated results, resolving the TS2322 shared by five core-test type stripes and production UI typing. The exact UI test graph passed after integration, and the repair has82 passing route tests and independent P2 review. Both feature commits remain patch-identical across this rebase.