Skip to content

fix(security): redact tool-command intel and reject non-http gbrain URLs - #1302

Open
siliangchen-amd wants to merge 2 commits into
mainfrom
bugfix/siliang/redact-tool-commands-gbrain-scheme
Open

fix(security): redact tool-command intel and reject non-http gbrain URLs#1302
siliangchen-amd wants to merge 2 commits into
mainfrom
bugfix/siliang/redact-tool-commands-gbrain-scheme

Conversation

@siliangchen-amd

@siliangchen-amd siliangchen-amd commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Description

Two independent fixes.

  1. Specialist tool summaries (Bash / WebSearch) were clipped into the intel ledger without redacting credentials, so Bearer tokens and API_KEY= assignments were stored verbatim. _summarize_tool_input() now runs redact_secret_values() on the full string and then clips. Claude and Codex both go through this helper.
  2. GbrainPageClient documented that urlopen was only reached after a scheme check, but the check was never called. __init__ now uses the existing require_http_url(). A bad GBRAIN_BASE_URL (file://, ftp://) is logged and explore skips GBrain (the env builder returns None); constructing the client directly still raises.

Linked issue(s)

None.

Tests

  • Bearer tokens and OPENAI_API_KEY= values are redacted in tool summaries, and redaction runs before clipping
  • Non-http GBrain URLs raise; the env builder returns None for file://
    201 passed on the targeted tests. ruff check / ruff format --check on the changed files passed.

Breaking changes

No. Intel query strings may now contain [REDACTED] in place of credential values. A non-http GBRAIN_BASE_URL skips GBrain instead of calling urlopen.

Specialist Bash summaries were clipped into the intel ledger without
redact_secret_values, so bearer tokens and KEY= assignments landed in
specialist_intel.jsonl. GbrainPageClient claimed to check the URL
scheme before urlopen but never did.

Redact before clipping. Construct-time require_http_url rejects
file://; a bad GBRAIN_BASE_URL logs and returns None so explore
still degrades.

Co-authored-by: Cursor <cursoragent@cursor.com>
@siliangchen-amd
siliangchen-amd requested a review from a team as a code owner August 27, 2026 03:29
The Bearer redaction case used `curl -H 'Authorization: ...'`, which
matches gitleaks curl-auth-header. Keep the same Bearer string without
the curl wrapper so secret-scan can pass.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown

CI E2E report — ✅ Succeeded

item value
result ✅ Succeeded
model Qwen/Qwen3-0.6B (dense)
resources 1× GPU, TP=1
PR branch bugfix/siliang/redact-tool-commands-gbrain-scheme
commit 72c476b3b99fa7348735afed48052efdaf059cc0
session_id 39995b96-a630-4509-a7f7-31ccdd99e4b9
queue → dispatch 0s
run time 195m 22s
total 195m 22s

details

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