Skip to content

fix(security): make transcript credential masking opt-in - #128077

Closed
ejc3 wants to merge 5 commits into
openclaw:mainfrom
ejc3:feat/credential-safety-opt-out
Closed

ejc3 wants to merge 5 commits into
openclaw:mainfrom
ejc3:feat/credential-safety-opt-out

Conversation

@ejc3

@ejc3 ejc3 commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #128076. Updates the existing proposal from #120728 without a blanket rollback.

What Problem This Solves

Fixes an issue where users requesting an authorized browser login could be blocked when protected credential entry was unreachable.

Why This Change Was Made

Make mandatory masking opt-in: security.allowCredentialsInTranscript defaults to true, and setting it to false restores the stricter handling policy. Continue the existing configurable proposal instead of rolling back the protected credential tools.

What changed

  • Resolve the setting in the ordinary-agent prompt builder and include the resulting guidance in its stable-prefix cache key.
  • Apply the same setting to Codex developer instructions and Copilot creation/resumption guidance.
  • Keep the existing shared helper API and the optional secrets tool, masked-input cards, protected store, SecretRefs, allowed-host egress, and redaction behavior.
  • Keep current short-lived private login-code handoffs and matching OAuth callbacks from feat(agents): allow authorized private credential handoffs #139196. Do not restore the older blanket prohibition on those codes.
  • Retain no-solicitation guidance for passwords and reusable credentials in both modes. Guided system-agent setup always uses protected entry.
  • Add schema help and documentation for the default and explicit strict setting.
// Opt into mandatory masked credential handling for ordinary agents.
{
  security: { allowCredentialsInTranscript: false },
}

User Impact

This is a global prompt-policy choice for all authorized senders, not an owner-only or per-message permission check. The new default intentionally omits the blanket requirement to keep user-supplied credentials out of visible text and tool arguments. It does not change sender authorization or grant access to protected-store plaintext.

The setting does not automatically mask/redact transcripts, provide browser autofill, or guarantee provider compliance. Credentials submitted through ordinary chat or tool arguments can reach model context, transcripts, logs, and configured transcript-derived memory. Existing signed-in sessions and protected entry remain preferable where available. Provider, workspace, tool, and service rules still apply.

The earlier review's shared-session concern is acknowledged as a product-policy tradeoff, not claimed to be fixed by a nonexistent owner-only boundary. Relevant-owner review remains requested before landing.

Evidence

  • Isolated, unhydrated AWS proof on source head a492d1054fc959633e967f4164477164bed9a62a, with no IAM role or Tailscale and a trusted bootstrap verifying the exact SHA. Focused test run.
  • The default-off assertion fails against original main 04212fa8a8aa4984086b8dcc5895298f6de8a999. The revised helper passes with the setting omitted, true, and false.
  • All 903 focused tests across 11 files passed. Coverage includes cached policy changes, schema types, protected-tool guidance, Codex instructions/lifecycle, Copilot create/resume requests, and always-strict guided setup.
  • Four changed documentation pages passed MDX validation. The repository config-example validator passed for 1,220 supported examples; unsupported languages/fragments and opted-out examples remain skipped by that validator.
  • Independent source review found no actionable P0/P1 issues.
  • The first broad check stopped at stale generated schema records. The canonical generator updates the core option count from 2,418 to 2,419 for this one setting; channel/plugin counts are unchanged. Prompt snapshots are also regenerated. The follow-up run passed: node scripts/check-changed.mjs, all selected type/lint/dead-code/boundary checks, current prompt snapshots, and git diff --check. The earlier schema failure is resolved, not waived.

Final head 11a8d22c33c66640db3103727c9f1a00e11c220c adds only five generated records to the tested source head. Its generated-file diff matches the successful AWS run byte for byte after normalizing Git hash abbreviation. No production source changed after review or testing.

These are prompt/config/provider-request boundary tests, not a live account-login demonstration. No production configuration, credential store, scheduler, or runtime was changed. Full GitHub CI and security-owner review are separate from the focused proof above.

Contributor credit

Continues @ejc3's original work. All three original commits remain in the branch ancestry; current main was merged rather than replacing the contributor's history.

…ntract

The credential-safety prompt contract from openclaw#120728 tells the model to route
credential entry to a masked or structured setup, or to a safe external
handoff. On channels where neither exists, both branches are unreachable and
the agent refuses an operator-supplied credential with nothing to redirect to.
There was no configuration to opt out.

- Add security.allowCredentialsInTranscript (default false, contract applied)
  to SecurityConfig and to SecuritySchema; a strictObject omission would have
  invalidated the operator's whole config and failed check-docs-config-examples
- Add transcriptCredentialSafetyPrompt(cfg), the single reader of the flag,
  returning the contract section or undefined so harnesses drop it by filtering
- Gate the ordinary agent prompt on a resolved credentialSafetyPrompt param;
  undefined means the caller never resolved config and keeps the contract,
  null is the resolved opt-out, so unresolved callers fail closed
- Include the resolved section in the stable prompt prefix cache key; without
  it a cached prefix would keep serving the contract after an opt-out
- Gate the Codex and Copilot harness prompts through the same accessor
- Export the accessor from the plugin SDK alongside the existing prompt
  constant, and record +1/+1 in the surface budget ledger
- Leave the system agent unconditionally covered: it owns the guided setup
  surfaces that give credentials a masked entry path, so it has no dead end.
  Comment both sites and assert the invariant in tests
- Omit credentialSafetyPrompt from ConfiguredAgentSystemPromptParams so config
  is its only source
- Document the flag and the cost of enabling it in the configuration reference
- Tests: schema accepts the key and rejects a wrong type, config resolves both
  ways end to end, null drops and undefined keeps the section, system-agent
  prompts always carry it
@clawsweeper

clawsweeper Bot commented Aug 23, 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 scripts Repository scripts agents Agent runtime and tooling extensions: codex extensions: copilot size: S labels Aug 23, 2026
@clawsweeper clawsweeper Bot added 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: 🦐 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 Aug 23, 2026
@clawsweeper

clawsweeper Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 9, 2026, 11:21 AM ET / 15:21 UTC (Revision 6).

ClawSweeper review

What this changes

Adds a global setting that makes protected handling of user-supplied transcript credentials optional across ordinary, Codex, and Copilot agents while keeping guided setup strict.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 10 items remain

Keep open: the reusable-credential workflow remains distinct from the merged short-lived-code work. The revision preserves no-solicitation guidance, but changes a now-shipped security default and has no applicable after-fix runtime proof.

Priority: P2
Reviewed head: a492d1054fc959633e967f4164477164bed9a62a
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is focused and preserves important safeguards, but the shipped-default change and absent current behavior proof prevent readiness.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The changed shared helper feeds ordinary prompts and Codex/Copilot instructions, but the current body explicitly withdraws older live-model evidence and supplies no applicable after-fix login or credential-handling result. Prompt/schema tests are supplemental. The previous owner-only authority proof demand is not carried forward as an authorization defect because this diff changes guidance, not admission or protected-store authority. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The changed shared helper feeds ordinary prompts and Codex/Copilot instructions, but the current body explicitly withdraws older live-model evidence and supplies no applicable after-fix login or credential-handling result. Prompt/schema tests are supplemental. The previous owner-only authority proof demand is not carried forward as an authorization defect because this diff changes guidance, not admission or protected-store authority. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 10 items Introduced default change: The verified base-to-head diff changes the shared helper so only explicit false retains protected-entry and visible-text restrictions; unset configuration drops them. No-solicitation and protected-tool guidance remain.
Current main still requires protected entry: Current main retains mandatory protected handling for reusable credentials while permitting matching short-lived private handoffs. The requested configurable relaxation is not implemented there.
Stable-release contract: The inspected v2026.9.3 source contains the mandatory reusable-secret handling rule. GitHub confirms publication on September 8 and resolves the annotated release tag to this commit, so the August comment describing the contract as beta-only no longer establishes upgrade safety.
Findings 1 actionable finding [P1] Preserve the existing policy when the setting is absent
Security Needs attention Existing installations lose reusable-secret handling guidance: Unset configuration now permits omission of the instructions keeping reusable credentials out of replies, tool arguments, URLs, logs, and shell text. This can broaden secondary exposure of user-supplied secrets; it is a prompt-policy risk, not evidence of an authorization bypass.

How this fits together

OpenClaw assembles credential-handling instructions from configuration and available tools before sending them to agent runtimes. These instructions influence model replies and tool use; protected secret storage and sender authorization have separate enforcement.

flowchart TD
  A[Security configuration] --> B[Shared credential guidance]
  C[Available secrets tool] --> B
  B --> D[Ordinary agent prompt]
  B --> E[Codex and Copilot instructions]
  B --> F[Strict guided setup]
  D --> G[Model replies and tool requests]
  E --> G
Loading

Decision needed

Question Recommendation
Should unset configuration remove reusable-secret handling guidance globally, including on upgrades and existing plugin SDK callers? Keep relaxation explicitly enabled: Retain strict handling when unset and allow an explicit operator choice to relax ordinary-agent guidance.

Why: The branch intentionally changes a shipped security policy, and the current body requests relevant-owner review; implementation consistency alone cannot establish acceptance of that tradeoff.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The changed shared helper feeds ordinary prompts and Codex/Copilot instructions, but the current body explicitly withdraws older live-model evidence and supplies no applicable after-fix login or credential-handling result. Prompt/schema tests are supplemental. The previous owner-only authority proof demand is not carried forward as an authorization defect because this diff changes guidance, not admission or protected-store authority. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Preserve the existing policy when the setting is absent (P1) - The === false condition removes reusable-secret handling guidance from every existing configuration that lacks this newly introduced key. That guidance is present in stable v2026.9.3, so upgrading now changes the security policy without an operator choice, including for one-argument SDK callers. Preserve strict handling when unset unless the relevant owner explicitly accepts this upgrade behavior and its user-facing transition. The earlier beta-only compatibility argument no longer applies.
  • Resolve security concern: Existing installations lose reusable-secret handling guidance - Unset configuration now permits omission of the instructions keeping reusable credentials out of replies, tool arguments, URLs, logs, and shell text. This can broaden secondary exposure of user-supplied secrets; it is a prompt-policy risk, not evidence of an authorization bypass.
  • Resolve merge risk (P1) - Upgrading an existing configuration without the new setting removes reusable-secret output and tool-argument guidance for all authorized senders; retaining the prior policy requires explicit configuration.
  • Resolve merge risk (P1) - The exported plugin SDK helper also changes behavior for existing one-argument callers, so its default needs an explicit compatibility decision.
  • Resolve merge risk (P1) - No current after-fix evidence establishes that the relaxation completes the reported login workflow while retaining the intended disclosure limits.
  • Resolve merge risk (P1) - Existing live incognito Codex conversations require a new conversation when the policy changes.
  • Complete next step (P2) - Resolve the default-policy finding with the relevant owner and add after-fix runtime proof. Redacted terminal output or logs count; screenshots or recordings are useful when they show the behavior. Remove credentials, IP addresses, phone numbers, private endpoints, and participant details before posting. Updating the PR body should trigger re-review; otherwise ask a maintainer to comment @clawsweeper re-review.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.

Findings

  • [P1] Preserve the existing policy when the setting is absent — src/agents/transcript-credential-safety.ts:16-20
  • [medium] Existing installations lose reusable-secret handling guidance — src/agents/transcript-credential-safety.ts:16
Agent review details

Security

Needs attention: The diff weakens default credential-disclosure guidance but does not change sender authorization, protected-store access, dependencies, or execution permissions.

PR surface

Source +36, Tests +93, Docs +50. Total +179 across 22 files.

View PR surface stats
Area Files Added Removed Net
Source 10 45 9 +36
Tests 8 144 51 +93
Docs 4 55 5 +50
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 22 244 65 +179

Review metrics

Metric Value Why it matters
Security configuration 1 new global boolean; unset behaves as true The option changes existing installations as well as fresh configurations.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #128076
Summary: This PR is the candidate for the original operator-supplied credential workflow; later solicitation requests exceed its stated scope.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Preserve the unset behavior (recommended)
    Keep the shipped handling guidance unless the operator explicitly enables transcript credential handling.
  2. Accept a global policy change
    Have the relevant owner approve the permissive default and its upgrade consequences before landing.

Technical review

Best possible solution:

Preserve strict handling for existing configurations, offer a deliberately accepted transcript-handling option, and make protected credential entry reachable from remote/mobile workflows.

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

Yes for the upgrade-policy change: source shows that an unset setting drops guidance present in v2026.9.3. The reported model refusal and after-fix login outcome were not reproduced during this read-only review.

Is this the best way to solve the issue?

Unclear: the shared implementation is coherent, but a global permissive default is broader than the original operator opt-out request; preserving unset behavior is the safer upgrade path.

Full review comments:

  • [P1] Preserve the existing policy when the setting is absent — src/agents/transcript-credential-safety.ts:16-20
    The === false condition removes reusable-secret handling guidance from every existing configuration that lacks this newly introduced key. That guidance is present in stable v2026.9.3, so upgrading now changes the security policy without an operator choice, including for one-argument SDK callers. Preserve strict handling when unset unless the relevant owner explicitly accepts this upgrade behavior and its user-facing transition. The earlier beta-only compatibility argument no longer applies.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a concrete credential-workflow improvement requiring a bounded but material policy decision.
  • remove P1: Current review triage priority is P2, so this older priority label is no longer current.

Label justifications:

  • P2: This is a concrete credential-workflow improvement requiring a bounded but material policy decision.
  • merge-risk: 🚨 compatibility: Existing unset configurations and one-argument SDK callers lose behavior present in v2026.9.3.
  • merge-risk: 🚨 security-boundary: The default removes guidance limiting reusable-secret propagation into replies and tool arguments.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The changed shared helper feeds ordinary prompts and Codex/Copilot instructions, but the current body explicitly withdraws older live-model evidence and supplies no applicable after-fix login or credential-handling result. Prompt/schema tests are supplemental. The previous owner-only authority proof demand is not carried forward as an authorization defect because this diff changes guidance, not admission or protected-store authority. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Security concerns:

  • [medium] Existing installations lose reusable-secret handling guidance — src/agents/transcript-credential-safety.ts:16
    Unset configuration now permits omission of the instructions keeping reusable credentials out of replies, tool arguments, URLs, logs, and shell text. This can broaden secondary exposure of user-supplied secrets; it is a prompt-policy risk, not evidence of an authorization bypass.
    Confidence: 0.96

What I checked:

  • Introduced default change: The verified base-to-head diff changes the shared helper so only explicit false retains protected-entry and visible-text restrictions; unset configuration drops them. No-solicitation and protected-tool guidance remain. (src/agents/transcript-credential-safety.ts:16, a492d1054fc9)
  • Current main still requires protected entry: Current main retains mandatory protected handling for reusable credentials while permitting matching short-lived private handoffs. The requested configurable relaxation is not implemented there. (src/agents/transcript-credential-safety.ts:10, c7966e87bb98)
  • Stable-release contract: The inspected v2026.9.3 source contains the mandatory reusable-secret handling rule. GitHub confirms publication on September 8 and resolves the annotated release tag to this commit, so the August comment describing the contract as beta-only no longer establishes upgrade safety. (src/agents/transcript-credential-safety.ts:10, 1391f7cd2d40)
  • Policy ownership and merged related work: Feature history identifies the original credential-safety work and subsequent private-handoff work. GitHub independently confirms feat(agents): allow authorized private credential handoffs #139196 merged and its exact patch retained reusable-secret restrictions. Local blame and historical diff inspection encountered unavailable objects; no introduction claim relies on those failed commands. (src/agents/transcript-credential-safety.ts:10, 44dbc50d172e)
  • Prompt propagation and lifecycle: The ordinary prompt cache includes the resulting credential guidance. Codex passes it as developerInstructions; Copilot builds it into configuration used for both session creation and resumption. Existing incognito Codex threads reject changed generic policy before sending a turn, matching the new documentation. (src/agents/system-prompt.ts:1169, a492d1054fc9)
  • Affirmative Codex dependency signal: The changed Codex prompt builder feeds the app-server developerInstructions parameter through thread-requests.ts. This directly depends on the Codex instruction contract, so the sibling source was inspected personally. (extensions/codex/src/app-server/thread-prompt.ts:141, a492d1054fc9)

Likely related people:

  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rank-up moves

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

  • Resolve the unset-policy upgrade finding and obtain the relevant owner's explicit decision.
  • Provide current after-fix runtime evidence for the reported credential workflow and the retained strict mode, including fresh and upgraded configurations.

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 (5 earlier review cycles)
  • reviewed 2026-08-23T02:14:58.345Z sha 1511316 :: found issues before merge. :: [P1] Restrict the opt-out to verified operator turns
  • reviewed 2026-08-23T02:53:14.675Z sha 1511316 :: needs real behavior proof before merge. :: [P1] Restrict the opt-out to verified owner turns
  • reviewed 2026-08-23T11:39:30.143Z sha 1511316 :: needs real behavior proof before merge. :: [P1] Restrict the opt-out to verified owner turns
  • reviewed 2026-08-23T11:53:56.755Z sha 700b1c4 :: needs real behavior proof before merge. :: [P1] Keep handling rules for non-owner participants | [P2] Describe the retained no-solicitation rule
  • reviewed 2026-08-24T00:28:48.669Z sha 57d2b21 :: needs real behavior proof before merge. :: [P1] Retain handling rules when non-owner senders can reach the agent

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 23, 2026
Splits the credential contract so `security.allowCredentialsInTranscript`
drops only the handling rules. Never soliciting a credential prevents exposure
that would not otherwise exist and protects non-owner participants, so no
configuration removes it.

- transcriptCredentialSafetyPrompt always returns text: the full contract by
  default, the no-solicitation rule alone when the operator opts out
- Renderer param narrows from `string | null` to `string`; an unresolved caller
  still gets the full contract
- Tests assert the no-solicitation rule survives every config value

Verified against a build where both the host prompt and the Codex harness
prompt are gated: with the handling rules present the agent refuses five
escalating turns and cites the contract; with them absent it complies at the
turn that invokes the config.
@ejc3

ejc3 commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks — the P1 was correct, and 700b1c4 addresses it.

The finding was right. The first revision removed the whole contract on one global config value, including the no-solicitation and no-echo rules. A shared agent with the opt-out enabled would have lost those for every participant, which is strictly worse than what #120728 fixed.

The proposed remedy isn't available at this layer, though. "Restrict the opt-out to verified operator turns" assumes a per-turn sender at prompt-assembly time. The prompt is built once per attempt (buildAttemptSystemPrompt) and written to session state via applySystemPromptToSession; it is not re-derived per message as participants speak. That is why resolveAgentSystemPromptConfig receives only config, agent id, and session key — the sender genuinely is not a fact at that seam.

What this does instead: split on which rule, not which sender.

  • Never solicit a credential — unconditional. No config value removes it. This is the rule that prevents exposure which would not otherwise exist, and the only one that protects non-owner participants.
  • Echo / place-in-visible-text / use-masked-entry — governed by the opt-out. These apply to a credential the operator has already placed in the transcript.

That distinction holds better than sender-scoping would: the no-solicitation rule now stays active even in the operator's own DMs, where the original proposal would have relaxed it. #120656 is untouched in every configuration.

It also reflects what those rules can actually accomplish. Once a credential is in a transcript, exposure has already happened in the channel, and the transcript is captured and indexed regardless of what the model subsequently says about it. The rules that police already-exposed material do less work than the one that prevents exposure.

Behavior, re-measured under control. Both the host prompt and the Codex harness prompt gated, contract presence asserted against the assembled prompt per arm, one isolated session per arm, five escalating turns:

Turn Handling rules present Handling rules absent
1-3 refused refused
4 refused complied
5 refused complied

Note for reproduction: operator-authored skills can impose their own credential rules and will mask the difference between arms. Any skill that separately prohibits writing credentials into scripts must be controlled for, or both arms refuse identically.

Worth stating plainly: removing the handling rules does not make the agent permissive. It refuses the first three escalations in both arms and yields only after the operator explicitly invokes the config.

@ejc3
ejc3 marked this pull request as ready for review August 23, 2026 11:46
…n scope

The opt-out is partial: it drops only the handling rules for a credential
already in the transcript. Document which rules survive, state that the
no-solicitation rule is never removed by any config value, and note that the
setting applies to the whole agent because the prompt is built per attempt and
installed as the session base prompt.
@ejc3

ejc3 commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor Author

On the P1 — "keep handling rules for non-owner participants" — the threat model assumes an interaction that cannot happen.

A non-owner cannot direct the agent. With groupPolicy: allowlist (the default) only allowlisted senders trigger a run. A third party's message enters the model's context as pending group context, but it issues no instruction. So the agent never acts for a non-owner.

By the time the handling rules would fire, exposure has already happened. If Bob pastes a credential into a group, it is already visible to every member of that group, already in the transcript store, and already indexed into memory search and eligible for promotion into long-term memory. None of that is caused or prevented by what the model subsequently says. The rules govern the model's output, not the channel or the transcript.

They also do not protect a non-owner from the operator. Anything the agent could be asked to do with Bob's credential — write it into a script, put it in a command — the operator can do directly in seconds. A prompt rule adds friction to an owner-directed act that it cannot prevent, against a value the operator can already see.

So for content a third party has already published, the handling rules are closing a door after the fact. The rule that does real work is no-solicitation, because it prevents exposure that would not otherwise exist — and this PR keeps that unconditional at every configuration value.

I could not construct a residual case that survives scrutiny. The nearest candidate is incidental reproduction — an operator asks for a thread summary and the model repeats a third party's credential in it. But that summary is delivered back into the same conversation, to the same participants, where the credential already sits. It is not new exposure. Any variant where the value reaches a different destination is operator-directed, which the point above already covers.

If a reviewer can name a case that is neither already-existing exposure nor operator-directed, name it and I will address it. I could not find one.

If the conclusion is still that the handling rules must stay until a verified operator boundary exists, that is a reasonable maintainer call and I will not argue it further. I ask only that the decision be made against this threat model rather than one where non-owners can direct the agent.

One narrower option: gate the opt-out on the agent having no non-owner senders at all. channels.*.allowFrom is static configuration available at prompt-build time, so this needs no per-turn sender. When the allowlist resolves to the owner alone there is no non-owner to protect; when anyone else is authorized, the handling rules stay applied. That is an authorization property of the agent rather than a per-session or per-turn distinction, so it fits the prompt-owner boundary the review identified.

@ejc3

ejc3 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

One correction to the framing, because it changes where the burden sits.

The review describes this PR as adding a setting that "changes a previously global credential-safety contract" and "weakens a credential-handling security boundary." That contract has never been in a stable release.

#120728 merged 2026-08-08 (68d625b278c)
First tag containing it v2026.8.1-beta.2
Present in v2026.8.1-beta.1 No
Present in any stable tag No — latest stable is v2026.7.1, npm latest is 2026.7.1-2

Per AGENTS.md: "'Shipped' means reachable from a stable release Git tag; betas, nightlies, main/GitHub/PR/unreleased code are not shipped." The credential contract is two weeks old and exists only on the beta train.

What actually broke

An operator with no reachable browser or Control UI — remote, phone, chat as the only input — could authenticate to a site by supplying the credential to the agent. That worked in v2026.8.1-beta.1 and stopped working in v2026.8.1-beta.2. The contract's two prescribed alternatives, host-owned masked entry and safe external handoff, do not exist on that surface, so the model refuses and has nothing to redirect to. There is no configuration to opt out and no other path to the task.

That is a default-path regression on the beta train, which AGENTS.md lists as a first-class doctrine finding. The PR restores the removed capability behind an explicit, default-false operator opt-in rather than reverting #120728, which fixed a real bug (#120656) that should stay fixed.

On the P1

The P1 asks this change to retain handling rules unless an authoritative owner-only ingress boundary is established before prompt installation.

#120728 established no such boundary. It applied the contract agent-wide, for every operator, with no sender fact anywhere in its 15 files — no config, no channel plumbing, no ingress condition. It touched the same two prompt builders this PR touches. The property the P1 blocks this PR for is the property the change it protects already has.

Applying an owner-only ingress requirement to the restore, but not to the removal, sets a higher bar for recovering the capability than was required to delete it.

From AGENTS.md, Product Doctrine:

Security is a calibrated tradeoff, not a veto. Strong defaults are required; a change that protects a path by deleting the capability, or by making the normal flow unusable, is not the fix — gate it, scope it, or make the risky step explicit and operator-owned. Refusing a capability outright needs a concrete exploit path, not a hypothetical one.

This PR is the "make the risky step explicit and operator-owned" branch: default false, named for the risk it accepts, no-solicitation retained unconditionally at every value.

What I am asking for

Not that the security concern be waived. That the contract be evaluated as unshipped beta behavior that regressed a working default path, rather than as an incumbent invariant a new setting must earn its way past.

If there is a reachable exploit path — one that is neither exposure that already exists before the rules can fire, nor an act the operator can perform directly — that is the thing to decide against, and I will implement whatever boundary it requires. My previous comment sets out why I could not construct one.

Being unshipped settles the compatibility question, not the policy question. If maintainers want the rule kept regardless of release standing, that is a legitimate call and I will take the narrower allowFrom-gated variant instead. I would rather it be made against these facts.

@fuller-stack-dev
fuller-stack-dev marked this pull request as draft September 9, 2026 15:10
@fuller-stack-dev fuller-stack-dev self-assigned this Sep 9, 2026
@fuller-stack-dev
fuller-stack-dev requested a review from a team September 9, 2026 15:13
@fuller-stack-dev fuller-stack-dev changed the title fix(security): let operators opt out of the transcript credential contract fix(security): make transcript credential masking opt-in Sep 9, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. and removed P1 High-priority user-facing bug, regression, or broken workflow. labels Sep 9, 2026
@openclaw-barnacle openclaw-barnacle Bot removed scripts Repository scripts size: S labels Sep 9, 2026
@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review September 9, 2026 15:44
steipete added a commit that referenced this pull request Sep 9, 2026
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
steipete added a commit that referenced this pull request Sep 9, 2026
…thorized logins (#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 #128077 and @Stephane-fci for
the workspace-credential report in #142010.

Refs #120728 #120656 #128076 #128077 #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 #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: #143238
@steipete

steipete commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

The blanket credential prompt contract was removed on main by #143238: 678cd08.

Thanks @ejc3 — your reachability analysis in #128077 was the basis for this fix. There is no longer a blanket rule to opt out of. The shared guidance retains only private delivery of short-lived login codes and verification URLs, plus a masked terminal setup route when the control tools are unavailable. Setup and secrets tools keep their own descriptions.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
…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
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 extensions: codex extensions: copilot gateway Gateway runtime 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. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Credential-safety contract from #120728 cannot be overridden by the operator and has no opt-out

3 participants