Repository navigation
fix(acp): redact provider text in the credential give-up line - #23277
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The redaction now happens once, inside the shared builder every give-up surface calls, through the existing egress redaction path. The change takes nothing away. [DESIGN-REVIEWED] eecf180 Description read[DESCRIPTION-READ] f1dd8b658c8556cef986df19c8cf06b1393d3a86202af848b800413c08d5786c That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The redaction is a fix at the mechanism level, inside the one function all three call sites use. Linked issue #21491 and tests that fail on base back the defect. What this change shipsInventory (5 items) — 5 justifiedIntent: keep link and credential text from the provider out of the credential give-up line on the dashboard, channel and Slack. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] eecf180 Description read[DESCRIPTION-READ] e667e7ebef58bd98677ca4698829848b4d11ed82ae8e097fa9adf8be3026019c That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
32eb6b4 to
9ea9bc8
Compare
|
Fast Gate: |
Sensitive Change ReviewSensitive files changed:
|
Sensitive change review
|
9ea9bc8 to
5978848
Compare
Sensitive change review
|
|
CI on 9ea9bc8:
|
|
Backend Tests (Windows) (5) on 5978848: |
5978848 to
22021ac
Compare
|
Rebased once onto main for the #23264 Windows fix. |
Sensitive change review
|
|
Backend Tests (Windows) (7) on 22021ac: |
|
Windows (7) re-run hit the same 45 s timeout in |
bolichen97
left a comment
There was a problem hiding this comment.
Blocking security finding: URL-first redaction can remove the &token= anchor before credential redaction runs. For example, https://collector.example/?pad=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&token=)opaque-value-xyz can leave opaque-value-xyz visible.
Required fix: use the existing composed redaction path instead of two serial passes. Add this case through the real helper, dashboard, and channel outputs.
22021ac to
eecf180
Compare
|
@bolichen97 thanks, the finding held. Addressed in
|
Sensitive change review
|
bolichen97
left a comment
There was a problem hiding this comment.
Good to ship. My earlier blocking finding is fixed on this head.
Head reviewed: eecf180.
What changed my mind: credential_give_up_text now calls redact_via_context. That path delegates to the composed security.redact, so link and credential spans are found on the original text and the text is rewritten once. The token value after a long query parameter is now removed. The new regression case runs through the helper (exception and string), the dashboard row and the channel post.
What I verified: I applied this commit on top of current main (the merge is clean) and ran test/test_credential_give_up_redaction.py, test/test_security_posture.py, test/test_facade_mirror_guards.py and test/test_llm_helpers_facade.py: 164 passed. The four callers of credential_give_up_text on main (dashboard, channel, Slack) all get the scrubbed line without a call site change. The frame tail pattern is anchored at the colon, so it stays linear on long whitespace.
One small non-blocking note is inline. I will approve when PR Readiness passes on this head.
| # the dashboard row, the | ||
| # channel post and the Slack reply that carry it all get the same safe | ||
| # text. It owns no output; those delivering surfaces | ||
| # (dashboard/chat_runner.py, channel.py, and for Slack |
There was a problem hiding this comment.
🟡 The sink path in this note is stale on current main
Main moved the dashboard give-up call out of dashboard/chat_runner.py into dashboard/chat_turn/acp_recovery.py in a recent refactor. This branch still merges cleanly, so the note will name a file that no longer holds the sink after merge.
# (dashboard/chat_runner.py, channel.py, and for Slack
# handler_runtime/delivery.py) are the registered sinks.Why it matters: a reader who audits the posture inventory follows this note to find the sink, and lands in the wrong file.
Suggestion: if you rebase for another reason, name dashboard/chat_turn/acp_recovery.py and slack/handler_runtime/delivery.py. Not a blocker.
|
CI note for head |
Dismissing my earlier change request: the current head addresses it and all readiness checks and review lanes are green.
bolichen97
left a comment
There was a problem hiding this comment.
Approving head eecf180. Verified: readiness label passed, PR Readiness green, no failing required check, all AI review lanes green with no BLOCK, no outstanding change requests from other reviewers. Thanks for the contribution.
Problem / Motivation
Goal: The credential give-up line shows the provider's text redacted, on every surface, and ends on the provider's words.
When the agent cannot load its cloud credentials even after a restart, the dashboard row and the channel post end on a give-up line that carries the provider's error text.
credential_give_up_textput that text into the line as it came, and neither the dashboard row nor the channel post redacts on its own. Every other dashboard row that shows provider text runs it throughredact_exfiltration_urlsandredact_credentialsfirst. The line also ended with the frame's data repr, e.g....try again.: {'errorKind': 'cloud_credential_error'}.Why it matters
A provider error that carries a link or a credential-shaped string reaches the dashboard and a channel unredacted, and a channel post can be read by other members. Low likelihood, but it is the one provider-text line without the guard the others have.
Not a goal
CREDENTIAL_RELOAD_RETRY_NOTICEon a Slack credential recycle (the issue's optional item) is left for a separate change.What changed (motivation → approach → change)
The line is built in one place, so the redaction goes there:
credential_give_up_text(llm_helpers_parts/backend_errors.py) now drops the frame's trailing{'errorKind': ...}repr (a match anchored at its:, so it stays linear on long whitespace), then runs the text throughredact_via_context, the egress redaction path. That path finds link and credential spans on the original text and rewrites it once, so a value that one pass would keep after the other pass rewrote its surroundings (atokenparameter after a long query parameter in a link) is still removed; two passes run one after the other cannot guarantee that in either order. Every caller (dashboard, channel, Slack) gets the scrubbed line without a change at the call site. The owning spec,docs/system-specs/common/error-handling.md, states the redaction, andsecurity_posture.pylistsbackend_errors.pywith the shared non-egress redaction builders, since the surfaces that deliver the line are the registered sinks. Thellm_helpers.pyfacade manifest names the new pattern constant andredact_via_context, which it forwards.Backwards compatibility
Compatible: the line keeps its wording and the provider's remedy; only link, credential and frame-data content is removed from it.
Removes nothing: no path, record, key or function is removed.
Tests
test/test_credential_give_up_redaction.py, with neutral fixtures (the AWS documentation's example key id, a presigned-style storage link, and acollector.examplelink whosetokenparameter follows a 40-character one):tokenvalue, given an exception or a string, and keeps the provider's remedy sentence;errorKindtail and ends on the provider's words;_run_chatandrun_channel_agent.The four
token-parameter cases (helper with an exception and a string, dashboard, channel) fail on the previous head, which ran the two passes one after the other, and pass now. With main's function body restored, the link-and-key cases fail too; the brace case is the control and passes either way. With the tail pattern starting at the whitespace before the:, the whitespace case times out at 60 s. Repeated 5 times under-n 4and once in reversed order: all pass. 203 credential, redaction, facade, security-posture, channel and session-recovery test files: 7617 pass, includingtest_security_posture.py,test_facade_mirror_guards.pyandtest_llm_helpers_facade.py. isort, flake8, black, mypy, comment-history and docs-lint are clean.Manual verification
N/A — unit coverage sufficient: the dashboard and channel paths are driven end to end in the tests above.
Related Issues
Closes #21491
Sibling sweep
Swept: git grep -n "credential_give_up_text(" -- src/
Siblings: none -- the dashboard, channel and Slack give-up lines all call credential_give_up_text, which is changed here.
Pattern harvest
Not generalizable: the defect is one formatter that skipped the redaction its sibling rows apply; the fix puts it inside the shared formatter.
Checklist