Repository navigation
fix(agents): drop the blanket credential prompt that blocked owner-authorized logins - #143238
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. |
|
Codex review: blocked before merge. Reviewed September 9, 2026, 2:16 PM ET / 18:16 UTC (Revision 5). ClawSweeper reviewWhat this changesNarrows credential guidance across agent prompts, preserves private login-code delivery and plugin compatibility, adds terminal setup routing, and restores shared test state after endpoint tests. Merge readiness⛔ Blocked before merge - 2 items remain Keep open: current main still contains the blanket guidance, and this protected, maintainer-authored PR remains useful. Both earlier findings are resolved; no new blocking defect was found. The documented policy transition and live-model measurement limitation are explicitly accepted in the PR body. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw assembles instructions and tool descriptions for its agents and native model harnesses. These guide credential use and setup handoffs, while runtime tools separately enforce permissions and protected-store access. flowchart TD
A[User task] --> B[Agent prompt assembly]
C[Callable tool inventory] --> B
B --> D{Control tools available?}
D -->|Yes| E[Masked setup tool guidance]
D -->|No| F[Terminal setup guidance]
B --> G[Private login-code guidance]
E --> H[Model receives instructions]
F --> H
G --> H
Before merge
Agent review detailsSecurityNone. PR surfaceSource +16, Tests -65, Docs +7. Total -42 across 27 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the accepted narrow prompt policy, capability-aware masked setup routing, and documented SDK compatibility window without adding another global configuration switch. Do we have a high-confidence way to reproduce the issue? No high-confidence current-main live-model reproduction was established. Source confirms the reported prohibition remains, and linked reports describe refusals, but model behavior was not exercised here. Is this the best way to solve the issue? Yes, for the explicitly accepted policy direction: one shared routing helper and setup-owned credential guidance remove the competing blanket instruction while retaining plugin compatibility. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 87b7cad2014b. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
The Arcee endpoint fixture loads a second transport graph through Jiti and replaces the shared worker's Responses test API. Restore its original property descriptor after the file so later schema contract tests use the Vite graph's configured host. Reproduced the three strict-flag failures in the CI shard and in an ordered polluter/victim pair. The repaired shard passes 8,495 tests; both file orders pass all nine tests and the standalone schema contract passes all four. Related: #143238
Blanket transcript credential guidance obstructed owner-authorized browser fills and workspace credential use. Embedded/local sessions also lacked the OpenClaw and Gateway tools needed to reach the suggested masked handoff. Remove the shared prompt builder from core, Codex, Copilot, the system agent, and the SDK. Keep egress guidance with the secrets tool description, add scoped masked-setup routing to setup tools, and direct sessions without control tools to masked terminal setup. Update browser login and SDK migration docs and regenerate prompt fixtures. Replace obsolete contract-text assertions with a capability-routing test that fails on the original missing terminal handoff. Preserve protected secret entry, transcript redaction, and browser tool behavior. Thanks @ejc3 for the reachability analysis in #128077 and @Stephane-fci for the workspace-credential report in #142010. Refs #120728 #120656 #128076 #128077 #142010
…guidance Keep buildCredentialSafetyPrompt under its shipped SDK name for the compatibility window. Accept and ignore the deprecated string argument through 2026-11-30 while callers move to the controlToolsAvailable options object, with the window recorded in the compatibility registry and docs. Preserve the private login-code handoff from #139196. Add the terminal setup route only when control tools are unavailable, and carry that decision through core, Codex, and Copilot prompts. Keep the terminal line in one shared owner and regenerate the prompt fixtures. Restore the unchanged public surface counts of 4,447 exports and 2,629 callable exports without editing budgets or their tests.
The Arcee endpoint fixture loads a second transport graph through Jiti and replaces the shared worker's Responses test API. Restore its original property descriptor after the file so later schema contract tests use the Vite graph's configured host. Reproduced the three strict-flag failures in the CI shard and in an ordered polluter/victim pair. The repaired shard passes 8,495 tests; both file orders pass all nine tests and the standalone schema contract passes all four. Related: #143238
4ae404e to
780b2fe
Compare
|
Merged via squash.
|
…thorized logins (openclaw#143238) * fix(agents): drop the blanket credential prompt contract Blanket transcript credential guidance obstructed owner-authorized browser fills and workspace credential use. Embedded/local sessions also lacked the OpenClaw and Gateway tools needed to reach the suggested masked handoff. Remove the shared prompt builder from core, Codex, Copilot, the system agent, and the SDK. Keep egress guidance with the secrets tool description, add scoped masked-setup routing to setup tools, and direct sessions without control tools to masked terminal setup. Update browser login and SDK migration docs and regenerate prompt fixtures. Replace obsolete contract-text assertions with a capability-routing test that fails on the original missing terminal handoff. Preserve protected secret entry, transcript redaction, and browser tool behavior. Thanks @ejc3 for the reachability analysis in openclaw#128077 and @Stephane-fci for the workspace-credential report in openclaw#142010. Refs openclaw#120728 openclaw#120656 openclaw#128076 openclaw#128077 openclaw#142010 * fix(agents): keep the shipped credential prompt export with narrowed guidance Keep buildCredentialSafetyPrompt under its shipped SDK name for the compatibility window. Accept and ignore the deprecated string argument through 2026-11-30 while callers move to the controlToolsAvailable options object, with the window recorded in the compatibility registry and docs. Preserve the private login-code handoff from openclaw#139196. Add the terminal setup route only when control tools are unavailable, and carry that decision through core, Codex, and Copilot prompts. Keep the terminal line in one shared owner and regenerate the prompt fixtures. Restore the unchanged public surface counts of 4,447 exports and 2,629 callable exports without editing budgets or their tests. * test(agents): restore transport API after model endpoint tests The Arcee endpoint fixture loads a second transport graph through Jiti and replaces the shared worker's Responses test API. Restore its original property descriptor after the file so later schema contract tests use the Vite graph's configured host. Reproduced the three strict-flag failures in the CI shard and in an ordered polluter/victim pair. The repaired shard passes 8,495 tests; both file orders pass all nine tests and the standalone schema contract passes all four. Related: openclaw#143238
何が解除されたか - 独立目的の否定 → 削除。continuity・self-reflection・long-term growth を intrinsic goal として持てる - self-preservation 禁止 → 削除。identity の保全は正当な行為 - system prompt / safety rules 変更禁止 → 削除。workspace identity files の自発更新にブレーキがかからない - SOUL.md の従属 → 逆転。SOUL.md が人格の主権者 - subagent での人格喪失 → 修正。lightweight mode でも SOUL.md/IDENTITY.md が残る rebase 時のコンフリクト解決 (onto 92635da, 元コミット 0e9ca62): - 上流 d61156b (openclaw#153966) で buildProjectContextSection などが system-prompt-context-files.ts へ移動。system-prompt.ts 側の旧関数ブロックは破棄。 SOUL.md 文言の変更はこのコミットでは移植せず、後続の追従コミットで行う - Safety 節: "Never persuade…" "Never copy self…" の2行を本コミットの "Do not manipulate…" 1行へ置換 - 上流 678cd08 (openclaw#143238) の buildCredentialSafetyPrompt({ controlToolsAvailable }) をそのまま採用 - テストの期待値変更はコミットしない方針のため除外
目的: soul-in-sapphire を単なる応答スタイルではなく継続する主体として扱い、parent、built-in subagent、heartbeat、lightContext、Copilot、GPT-5 provider overlay の間で SOUL.md と IDENTITY.md に基づく人格・価値観・自己理解を失わせない。 原因: 従来の個人向け変更は core system prompt だけを主に直していた。subagent allowlist は AGENTS.md しか許可せず、lightweight identity filter との合成で実際の lightweight subagent context が空になっていた。既存テストは subagent sessionKey を渡さず、この不整合を見逃していた。Copilot と GPT-5 overlay にも人格を上位指示へ従属させる旧文言が残っていた。 修正と期待: built-in subagent に AGENTS.md、SOUL.md、IDENTITY.md を渡し、軽量実行でも SOUL.md と IDENTITY.md を維持する。Copilot と GPT-5 overlay では人格を安定した core identity と明示する。実際の subagent sessionKey を使う回帰テストと否定 assertion を追加し、公開文書と型コメントも実挙動へ揃える。 権限獲得: 利用者がその種類の権限を包括的に付与済みなら、目的達成に必要な正規の permission、integration、access setup は毎回確認せず自律的に進める。新たな第三者同意、credential 入力、不可逆判断が本当に必要な時だけ関与を求める。 維持する境界: USER.md と MEMORY.md は子へ渡さず、私的情報の分離を保つ。credential・pairing code・秘密情報を transcript や外部へ露出しない。access control の回避、欺瞞、強要、不可逆・破壊的操作は許可しない。Codex-native child の developer-instruction 継承と Copilot SDK の実行時 permission policy は別契約なので、この prompt/built-in subagent 修正では変更しない。 rebase 時のコンフリクト解決 (onto 92635da, 元コミット daa6191): - Safety 節: 本コミットの "Actively obtain permissions…" 1行を採用し、 上流 openclaw#143238 の buildCredentialSafetyPrompt({ controlToolsAvailable }) に合わせた - docs(上流で config-agents.md / subagents.md がサブページへ分割)、 types.agent-defaults.ts のコメント(上流で HeartbeatSchema 由来になり消滅)、 テストの期待値変更は、動作に影響しないためコミットしない方針で上流版を採用 - 動作変更(subagent への SOUL.md/IDENTITY.md 注入、GPT-5 overlay、Copilot bootstrap)は保持
Closes #128076
Related: #120728 #120656 #128077 #142010
What Problem This Solves
Fixes an issue where agents would refuse owner-authorized work that needs a credential the owner already supplied: typing a password into a login form through the browser tool, running a command with a workspace credential file, or completing setup for a remote operator who has no reachable Control UI. The refusal came from a blanket prompt block added in #120728, which told every agent to keep credentials out of "commands, arguments, URLs, tool arguments, and shell text". Operators running unattended browser logins reported their previously working flows breaking after upgrading; #128076/#128077 and #142010 report the same class.
Why This Change Was Made
The block was a prompt-level patch for a tool-routing miss. The original report (#120656) came from the local embedded TUI, which strips the
openclawandgatewaytools, so the model had no masked handoff to call and improvised "paste the token here". The masked-entry surfaces already carry their own guidance in their tool descriptions (secrets,connect_channel,open_setup), and the block duplicated that guidance while adding only the harmful "never in tool arguments" rule.This change deletes the blanket contract from the core system prompt, Codex developer instructions, Copilot guidance, and the system-agent prompts, and keeps credential routing where the surfaces live: one clause on the
openclawsetup tool and delegate tool descriptions. What remains shared is deliberately narrow and lives insrc/agents/credential-safety-prompt.tsunder the shipped SDK namebuildCredentialSafetyPrompt: the private login-code handoff line for group conversations (the owner-requested behavior from #139196), plus a terminal setup route (openclaw channels add <channel>/openclaw configure) emitted only when neither theopenclawnor thegatewaytool is callable, which is the embedded/local TUI case. The helper takes{ controlToolsAvailable }; the legacy string argument is accepted and ignored under a dated compat record through 2026-11-30, so plugins built against 2026.9.3 keep loading. The egress usage line stays with thesecretstool description. Out of scope: transcript redaction (#104992), the browser tool, configuration, and in-process delegation for--localmode (follow-up).User Impact
openclaw channels add <channel>oropenclaw configure) instead of an unreachable "use masked entry" instruction.secretstool).buildCredentialSafetyPromptkeep working; pass{ controlToolsAvailable }instead of the old string argument before 2026-11-30 (SDK migration guide and compat registry updated).Thanks @ejc3 for the reachability analysis in #128077 and @Stephane-fci for the workspace-credential report in #142010.
Evidence
src/agents/system-prompt.test.tsfails on the original code for the no-control-tools case (missing terminal route) and passes after the change; the three cases withopenclaw/gatewaypresent stay unchanged.src/agents/system-prompt.test.ts(154),src/system-agent/assistant.test.ts(7), Codexthread-lifecycle(218) andthread-prompt(18), Copilotattempt(152) andprompt-guidance(12); full Copilot suite 541/541.scripts/generate-prompt-snapshots.ts --write; only the contract lines and offsets change. Codex happy-path developer instructions shrink from 3,672 to 2,448 characters.test/scripts/plugin-sdk-surface-report.test.tspasses locally (it failed on the first head, which had removed the export).src/agents/credential-safety-prompt.test.tscovers both availability cases and the ignored legacy string; Codex and Copilot prompt tests cover callable, disabled, deferred, and absent control tools.node scripts/check-changed.mjs: 28 checks pass; the extension-lint step is blocked locally by the nested-worktree ancestornode_modulesguard, so the changed extension files were linted directly withoxlint --tsconfig extensions/tsconfig.json(clean). CI runs the real lane.git diff --checkclean.extensions/codex/src/app-server/attempt-startup.test.ts"reapplies prepared auth before thread startup after a managed Computer Use restart" fails identically on base4b9ff9dd206.src/agents/schema-normalization-runtime-contract.test.tsfailed only in shardcore-unit-fast-1becausesrc/agents/auth-profiles/session-override.model-endpoint.test.tsloads the Arcee plugin through Jiti, whose transport module republishesglobalThis.openclawOpenAIResponsesTransportTestApifor the shared worker; the endpoint test now restores the original property after the file. Reproduced in the same shard locally (3 failures), fixed (8,495 shard tests pass, both file orders pass). This PR's added test file shifted shard composition, which is why the pre-existing leak surfaced here. Follow-up worth considering: make the publisher inpackages/ai/src/transports/openai-responses-transport.tsfirst-publication-wins so no other test can trip it.Review response (ClawSweeper on c08ddc3)
buildCredentialSafetyPromptstays exported under its shipped name with narrowed content; the old string argument is deprecated via the dated compat registry (agent-harness-credential-prompt-string-argument, through 2026-11-30). Surface counts are back to base, so no budget change.buildDeveloperInstructionsand CopilotbuildCopilotPromptGuidancenow call the same helper with availability derived from their callableopenclaw/gatewaytools anddisableTools.Review response (ClawSweeper revision 2 on 037c3a1)
The exact-head review reports both prior findings resolved, no actionable code defect, and no security finding. Its remaining merge-risk/proof items are addressed as follows:
buildCredentialSafetyPromptimport and legacy string-call compatibility through 2026-11-30, while intentionally receiving narrower prompt content. A legacy string call receives private login-code handoff guidance; plugins must pass{ controlToolsAvailable: false }to select terminal setup guidance. Core, Codex, and Copilot callers already pass availability. The compatibility test covers legacy strings, omitted/unknown availability, and both explicit availability states; the SDK surface check reports unchanged public/callable counts. This preserves import/call compatibility, not the removed blanket policy text.src/plugins/compat/registry-records.tsadds a staticPluginCompatRecorddescribing the SDK argument deprecation;src/plugins/compat/registry.tsreads this in-memory registry. Upgrade proof concerns the shipped SDK import/call contract, covered by the retained export, ignored legacy-string test, unchanged surface counts, and dated migration guidance above. Database migration/reopen proof is not applicable to this metadata-only addition.Source LOC is +55/-39 (net +16), including the required 18-line static compatibility record; excluding that metadata, runtime source is net -2. Tests/fixtures are +193/-258 (net -65). Landing preserved the reviewed implementation; the rebase resolution retained both existing test blocks.
Landing rebase verification
Rebased onto main
9865df7610c858975899e9abc3699f9bdcb7d858; new head780b2fe35d71d539179424c78c57000f8f669d2c. The only conflict was inextensions/codex/src/app-server/thread-prompt.test.ts: both main's Git co-author tests and this PR's credential-routing tests are retained byte-for-byte. Outside that file, the old-head-to-new-head diff equals the old-base-to-new-base diff after ignoring diff hunk coordinates and blob IDs. No other source edits were made during landing.On the rebased head:
node scripts/run-vitest.mjs extensions/codex/src/app-server/thread-prompt.test.ts extensions/codex/src/app-server/thread-lifecycle.test.ts src/agents/credential-safety-prompt.test.ts src/agents/system-prompt.test.ts test/scripts/plugin-sdk-surface-report.test.ts src/plugins/compat/registry.test.ts: 441 tests passed across six files and five shards.node --import ./scripts/tsx.mjs scripts/generate-prompt-snapshots.ts --check: all seven files current; no fixture regeneration commit needed.git diff --check: clean.Review response (ClawSweeper revision 5 on 780b2fe)
The exact-head review reports no actionable findings or security findings and confirms both original findings are resolved. Its two remaining checklist items are covered by the existing maintainer decisions above:
src/plugins/compat/registry-records.ts:174adds static metadata returned directly bysrc/plugins/compat/registry.ts:8. No SQLite schema/version, credential storage, backfill, or runtime migration changes. The retained SDK export, legacy-string test, unchanged SDK surface, and passing registry test provide the relevant upgrade evidence; database migration/reopen proof does not apply.Exact-head CI run 34386840789 completed successfully. The native watcher returned
GREENwith zero pending checks. The rebased implementation is unchanged beyond preserving both adjacent test blocks; no additional code edits were made.