Skip to content

docs: Simplify logs in example - #386

Merged
benbrandt merged 2 commits into
mainfrom
alert-autofix-6
Oct 2, 2026
Merged

benbrandt merged 2 commits into
mainfrom
alert-autofix-6

Conversation

@benbrandt

Copy link
Copy Markdown
Member

Potential fix for https://github.com/agentclientprotocol/rust-sdk/security/code-scanning/6

General fix: avoid logging sensitive or untrusted dynamic values directly. Prefer constant log messages or redact/anonymize values before logging.

Best fix here (without changing behavior): keep the cancellation log, but remove request.session_id interpolation from the eprintln! call. The request handling and response remain unchanged; only the logged content is sanitized.
Edit in src/agent-client-protocol/examples/v2_one_shot_client.rs, around lines 56–59, replacing the formatted message that includes {} and request.session_id with a static message.

No new imports, helper methods, or dependencies are required.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@benbrandt benbrandt changed the title Potential fix for code scanning alert no. 6: Cleartext logging of sensitive information docs: Simplify logs in example Oct 2, 2026
@benbrandt
benbrandt marked this pull request as ready for review October 2, 2026 14:59
@benbrandt
benbrandt enabled auto-merge (squash) October 2, 2026 14:59
@benbrandt
benbrandt disabled auto-merge October 2, 2026 14:59
@benbrandt
benbrandt enabled auto-merge (squash) October 2, 2026 14:59
@benbrandt
benbrandt merged commit 65347cf into main Oct 2, 2026
14 checks passed
@benbrandt
benbrandt deleted the alert-autofix-6 branch October 2, 2026 15:11
@acp-release-bot acp-release-bot Bot mentioned this pull request Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant