Skip to content

fix(onboard): keep referenced provider secrets out of plaintext - #118702

Merged
steipete merged 3 commits into
mainfrom
codex/qa0803-onboard-ref-secret-no-plaintext
Aug 3, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/qa0803-onboard-ref-secret-no-plaintext

Conversation

@steipete

@steipete steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Prevent --secret-input-mode ref from persisting resolved provider-profile secrets in plaintext.
  • Preserve named existing profiles, complete account metadata/order, valid environment SecretRefs, and legitimate self-hosted keyless providers.

Root cause and authoritative secret ownership

The noninteractive custom-provider serializer and public plugin credential serializer both accepted a resolved profile or literal and wrote its actual key into provider configuration even when the operator explicitly requested references. The generic self-hosted provider owner also rewrote existing named-profile ownership as a synthetic default account.

A single existing secret serializer now fails closed unless a reference-mode credential has an explicit environment-variable identity. Existing profiles remain in their authoritative auth store with all existing descriptors, selected account order, email, and metadata unchanged. Legitimate keyless self-hosted placeholders are accepted only when the trusted bundled manifest declares the same normalized provider, its synthetic authorization owner, and that exact provider-owned marker; OAuth prefixes, environment-looking values, secret-reference markers, and markers owned by other providers cannot bypass authentication.

Actual operator/provider proof

  • The actual noninteractive configuration writer originally persisted a synthetic profile secret as plaintext and overwrote valid environment/file/exec refs; six genuine RED cases.
  • Independent owner reviews additionally reproduced three self-hosted profile-only regressions, two legitimate LM Studio/generic keyless regressions, and nine named-account/cross-provider marker security failures; all accepted findings were repaired at their canonical owners.
  • Complete focused noninteractive + public self-hosted + actual LM Studio owner suites: 147/147 passing.
  • Existing profile metadata/order remain byte-for-byte unchanged; vLLM/SGLang real credentials stay protected; valid environment refs, optional keyless flows, and explicit plaintext mode remain supported.
  • Type-aware/type-check lint, formatting, and diff checks clean.
  • Fresh independent structured Sol/high security review after all accepted findings: no findings, confidence 0.92.
  • Net production delta +5 lines, required for provider-owned synthetic authentication security.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: L maintainer Maintainer-authored PR labels Aug 3, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 11:08 AM ET / 15:08 UTC.

ClawSweeper review

What this changes

The PR changes noninteractive reference-mode onboarding so new credentials are stored as environment references, existing resolvable provider profiles remain unchanged, and self-hosted keyless providers are recognized only through their bundled provider manifest.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep this PR open for explicit maintainer review. The final documentation commit addresses the prior documentation finding, and the patch now makes reference-mode onboarding fail rather than serializing a resolved profile or literal as plaintext while preserving existing profile-owned credentials.

Priority: P1
Reviewed head: 9f266e1daf9c8942f6765fba53c43c865750a3e2
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-backed security repair with relevant behavior proof and resolved documentation follow-up; it still deserves explicit maintainer approval because it defines an authentication upgrade boundary.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body and existing proof: sufficient review state report after-fix operator/provider behavior for plaintext, environment-reference, existing-profile, and self-hosted keyless cases; the supplied proof is directly relevant to the changed CLI flow.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body and existing proof: sufficient review state report after-fix operator/provider behavior for plaintext, environment-reference, existing-profile, and self-hosted keyless cases; the supplied proof is directly relevant to the changed CLI flow.
Evidence reviewed 6 items Current-main root cause: Before this PR, reference mode returned the resolved key whenever the source was not environment-backed, so a resolved existing profile could be serialized as plaintext.
Reference-mode serializer repair: The PR accepts only an explicit environment source and variable name for a new serialized reference; all other resolved values fail with operator guidance instead of becoming a plaintext credential.
Self-hosted owner boundary: The self-hosted setup leaves profile-sourced credentials out of new auth-profile writes and accepts a keyless marker only when a bundled manifest declares the matching provider, synthetic owner, and marker.
Findings None None.
Security None None.

How this fits together

Noninteractive onboarding resolves a provider credential and then writes model and authentication configuration. The changed serializers decide whether a credential becomes a persisted SecretRef, remains in the authoritative auth-profile store, or is rejected before configuration is saved.

flowchart LR
  A[Noninteractive onboarding flags] --> B[Credential resolution]
  B --> C{Credential source and mode}
  C -->|New environment credential| D[Persist environment SecretRef]
  C -->|Existing auth profile| E[Reuse authoritative profile]
  C -->|Literal or unowned marker in ref mode| F[Fail with remediation]
  E --> G[Provider and model configuration]
  D --> G
  F --> H[No configuration write]
Loading

Decision needed

Question Recommendation
Should noninteractive reference mode formally preserve a resolvable existing provider profile as the authoritative credential owner rather than creating or rewriting a default profile from its resolved value? Approve profile ownership preservation: Accept the documented behavior that reference mode reuses existing resolvable profiles unchanged and writes a SecretRef only for newly supplied environment credentials.

Why: This is a deliberate authentication and upgrade-contract decision: the patch removes a plaintext-secret exposure but also changes what an existing profile is allowed to control during onboarding.

Before merge

  • Resolve merge risk (P1) - This is an authentication and persisted-configuration boundary: merging intentionally changes --secret-input-mode ref from rewriting resolved profile material to preserving profile ownership, so a maintainer should explicitly confirm that upgrade behavior is the desired contract.
  • Resolve merge risk (P1) - The PR is currently behind main; review and merge gates should evaluate the exact resulting head, especially because this change touches onboarding, provider profiles, and SecretRef persistence.
  • Complete next step (P2) - The repair is concrete and appears correct, but the protected maintainer label and security-sensitive authentication ownership contract require explicit human approval rather than an automated follow-up patch.
Agent review details

Security

None.

PR surface

Source +10, Tests +492, Docs +5. Total +507 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 2 90 80 +10
Tests 3 492 0 +492
Docs 4 13 8 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 595 88 +507

Review metrics

Metric Value Why it matters
Production versus regression coverage runtime +10/-80; tests +492; docs +13/-8 The code simplifies the two credential-writing paths while adding focused coverage for profile ownership, SecretRefs, keyless providers, and marker isolation.

Stored data model

Persistent data-model change detected: migration/backfill/repair: docs/start/wizard-cli-reference.md, serialized state: src/commands/onboard-non-interactive/local/auth-choice.test.ts, serialized state: src/plugins/provider-self-hosted-setup.test.ts, vector/embedding metadata: src/plugins/provider-self-hosted-setup.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Approve the preserved-profile contract (recommended)
    Merge after exact-head checks and maintainer review confirm that existing named-profile ownership, ordering, and SecretRefs must remain untouched in noninteractive reference mode.
  2. Pause for a different upgrade contract
    Keep the PR open only if maintainers intend onboarding to replace an existing profile rather than reuse it, then define a secure migration or explicit operator choice.

Technical review

Best possible solution:

Adopt the single owner-boundary rule: serialize only newly supplied environment-backed credentials as SecretRefs, preserve existing profile-owned credentials and their metadata, and reject every other reference-mode serialization path before it can persist plaintext.

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

Yes, from source: on current main, --secret-input-mode ref returns a resolved non-environment credential as a string, and downstream serializers can persist it. The proposed focused regression tests cover that path, although this read-only review did not execute them.

Is this the best way to solve the issue?

Yes. The repair is at the serialization and provider-owner boundaries, where the resolved secret becomes persisted state, rather than masking it after configuration is written. Preserving existing profiles is safer than reconstructing them from a resolved key.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: Reference-mode onboarding could otherwise persist provider credentials in plaintext during a core setup workflow.
  • merge-risk: 🚨 compatibility: Existing onboarding runs with named auth profiles now preserve those profiles instead of rewriting a synthetic default credential.
  • merge-risk: 🚨 auth-provider: The patch changes provider-profile selection and SecretRef serialization in noninteractive authentication setup.
  • merge-risk: 🚨 security-boundary: The changed decision determines whether resolved provider secrets can cross into persisted plaintext configuration.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body and existing proof: sufficient review state report after-fix operator/provider behavior for plaintext, environment-reference, existing-profile, and self-hosted keyless cases; the supplied proof is directly relevant to the changed CLI flow.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and existing proof: sufficient review state report after-fix operator/provider behavior for plaintext, environment-reference, existing-profile, and self-hosted keyless cases; the supplied proof is directly relevant to the changed CLI flow.

Evidence

What I checked:

  • Current-main root cause: Before this PR, reference mode returned the resolved key whenever the source was not environment-backed, so a resolved existing profile could be serialized as plaintext. (src/commands/onboard-non-interactive/local/auth-choice.ts:71, 0e1a3220ea6e)
  • Reference-mode serializer repair: The PR accepts only an explicit environment source and variable name for a new serialized reference; all other resolved values fail with operator guidance instead of becoming a plaintext credential. (src/commands/onboard-non-interactive/local/auth-choice.ts:71, c055a0113bc7)
  • Self-hosted owner boundary: The self-hosted setup leaves profile-sourced credentials out of new auth-profile writes and accepts a keyless marker only when a bundled manifest declares the matching provider, synthetic owner, and marker. (src/plugins/provider-self-hosted-setup.ts:512, c055a0113bc7)
  • Regression coverage: Focused tests cover profile reuse without persisted plaintext, preserved environment SecretRefs, legitimate keyless self-hosted providers, and rejection of cross-provider or non-secret marker misuse. (src/plugins/provider-self-hosted-setup.test.ts:866, c055a0113bc7)
  • Prior finding resolved: The final commit updates all affected onboarding docs to say that existing resolvable named profiles and env/file/exec references are reused unchanged, rather than promising a new reference write. Public docs: docs/cli/onboard.md. (docs/cli/onboard.md:265, 9f266e1daf9c)
  • Branch and release status: The reviewed head is not contained by a local release tag or current main; this remains an open, unshipped change rather than an implemented-on-main candidate. (9f266e1daf9c)

Likely related people:

  • steipete: Peter Steinberger authored the current-main serializer and self-hosted setup code implicated by the regression, then authored all three commits in this repair series. (role: current owner of the onboarding and provider-auth path; confidence: high; commits: 0e1a3220ea6e, c055a0113bc7, b0f98c24acea; files: src/commands/onboard-non-interactive/local/auth-choice.ts, src/plugins/provider-self-hosted-setup.ts, docs/cli/onboard.md)

Rank-up moves

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

  • Obtain the owning maintainer’s explicit approval of preserved existing-profile ownership and let required checks evaluate the exact merge 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 (2 earlier review cycles)
  • reviewed 2026-08-03T14:17:34.792Z sha c055a01 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-03T14:29:02.561Z sha b0f98c2 :: needs changes before merge. :: [P3] Document preserved existing profiles in reference mode

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Aug 3, 2026
@steipete
steipete merged commit 7fafaf5 into main Aug 3, 2026
121 of 123 checks passed
@steipete
steipete deleted the codex/qa0803-onboard-ref-secret-no-plaintext branch August 3, 2026 15:34
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 3, 2026
* origin/main:
  fix(onboard): keep referenced provider secrets out of plaintext (#118702)
  docs: show canonical agent roster configuration (#118722)
  fix(channels): generate catalog from package manifests (#118097)
  fix(zalouser): distinguish probe timeout from auth failure (#111336)
  improve(ui): cut E2E shard runtime by reusing the bundle (#118697)
  fix(cli): publish completion caches atomically (#118715)
  fix(whatsapp): honor disabled self-chat without widening group access (#118711)
  fix(voice-call): terminate carrier calls after realtime startup failures (#118699)
  fix(slack): isolate GovSlack media trust and delivery (#118695)
  fix(browser): wrap page-controlled action results (#118691)
  fix(security): sanitize JSON-escaped forged content boundaries (#118698)
  test(qa): prove real yielded-child completion and channel delivery (#118707)
  fix(doctor): honor explicit plugin-only migration authority (#118700)
  fix(security): detect child_process calls through aliases and computed members (#116304)
  test(gateway): avoid async facade mock race (#118708)
  fix(gateway): preserve final speech during transcription shutdown (#118693)
  fix(gateway): resume durable outbound delivery retries (#118694)
  fix(plugins): reject external public-artifact hardlinks (#118689)
vincentkoc added a commit that referenced this pull request Aug 3, 2026
* origin/main: (78 commits)
  fix(parallels): recover Windows poll transport failures (#118479)
  fix(channels): deny unauthorized Discord and Telegram binding access (#118704)
  fix(test): bound shared git inventory lookup (#111171)
  fix(onboard): keep referenced provider secrets out of plaintext (#118702)
  docs: show canonical agent roster configuration (#118722)
  fix(channels): generate catalog from package manifests (#118097)
  fix(zalouser): distinguish probe timeout from auth failure (#111336)
  improve(ui): cut E2E shard runtime by reusing the bundle (#118697)
  fix(cli): publish completion caches atomically (#118715)
  fix(whatsapp): honor disabled self-chat without widening group access (#118711)
  fix(voice-call): terminate carrier calls after realtime startup failures (#118699)
  fix(slack): isolate GovSlack media trust and delivery (#118695)
  fix(browser): wrap page-controlled action results (#118691)
  fix(security): sanitize JSON-escaped forged content boundaries (#118698)
  test(qa): prove real yielded-child completion and channel delivery (#118707)
  fix(doctor): honor explicit plugin-only migration authority (#118700)
  fix(security): detect child_process calls through aliases and computed members (#116304)
  test(gateway): avoid async facade mock race (#118708)
  fix(gateway): preserve final speech during transcription shutdown (#118693)
  fix(gateway): resume durable outbound delivery retries (#118694)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
…claw#118702)

* fix(onboard): keep referenced provider secrets out of plaintext

* fix(onboard): retain public credential owner type usage

* docs(onboarding): explain preserved credential profiles in reference mode
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
* origin/main:
  fix(onboard): keep referenced provider secrets out of plaintext (openclaw#118702)
  docs: show canonical agent roster configuration (openclaw#118722)
  fix(channels): generate catalog from package manifests (openclaw#118097)
  fix(zalouser): distinguish probe timeout from auth failure (openclaw#111336)
  improve(ui): cut E2E shard runtime by reusing the bundle (openclaw#118697)
  fix(cli): publish completion caches atomically (openclaw#118715)
  fix(whatsapp): honor disabled self-chat without widening group access (openclaw#118711)
  fix(voice-call): terminate carrier calls after realtime startup failures (openclaw#118699)
  fix(slack): isolate GovSlack media trust and delivery (openclaw#118695)
  fix(browser): wrap page-controlled action results (openclaw#118691)
  fix(security): sanitize JSON-escaped forged content boundaries (openclaw#118698)
  test(qa): prove real yielded-child completion and channel delivery (openclaw#118707)
  fix(doctor): honor explicit plugin-only migration authority (openclaw#118700)
  fix(security): detect child_process calls through aliases and computed members (openclaw#116304)
  test(gateway): avoid async facade mock race (openclaw#118708)
  fix(gateway): preserve final speech during transcription shutdown (openclaw#118693)
  fix(gateway): resume durable outbound delivery retries (openclaw#118694)
  fix(plugins): reject external public-artifact hardlinks (openclaw#118689)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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