You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tool output scrubbing (added in #833) does not cover Raven's own OAuth token files, so a turn that reads one hands the access and refresh tokens to the model.
Two passes scrub a tool result before a model sees it (raven/config/held_secrets.pyscrub_tool_output):
scrub_held_secrets -- exact match on the values in config.json only;
redact_home_config_read (raven/security/redact.py) -- pattern redaction when the call reaches into a dot-directory of the home.
The fix for the workspace false positive in #833 made _home_config() skip all of Raven's home (~/.raven), on the grounds that Raven's own keys are covered by pass 1. That holds for config.json, but not for the sign-in tokens under get_oauth_dir() (~/.raven/oauth/<provider>/...: chatgpt/auth.json, github_copilot/, MiniMax, litellm). They are in neither pass.
A refresh token is a long-lived account credential; once in a tool result it is in the session record and the provider's logs. The self-config skill tells the agent not to open credential stores, but #833's own measurement is that a model diagnosing an agent reads its settings anyway.
Suggested fix
Narrow the exclusion in _home_config() from Raven's whole home to the directories where a coding turn reads its own source: <raven home>/workspace and <raven home>/tmp (and the bound workdir). ~/.raven/oauth/... and the rest of Raven's home then stay under the pattern pass. Correct the _home_config() docstring, which says Raven's own keys are covered by the exact-match pass.
Verify: in tests/test_security_untrusted_context.py, assert a read of ~/.raven/oauth/<provider>/auth.json is redacted, next to the existing case that ~/.raven/workspace/... and ~/.raven/tmp/... stay unchanged; uv run pytest -q tests/test_security_untrusted_context.py.
Not a regression against the release before #833 (there was no scrubbing then); a gap in the new protection.
Confirmed the gap at HEAD (4acc63c): raven/security/redact.py:112-129_home_config() exempts all of ~/.raven from the pattern pass on the assumption that Raven's own keys are covered by the exact-match pass, but raven/config/held_secrets.py:66-87held_secrets() only collects values from config.json (get_config_path()) — nothing under get_oauth_dir() (raven/config/paths.py:86). So scrub_tool_output (held_secrets.py:111-119) lets ~/.raven/oauth/<provider>/auth.json contents through untouched, while ~/.codex/auth.json is redacted. Reproduced locally with the token JSON from this issue: oauth path unchanged, codex path [redacted].
Taking this. Plan: follow the suggested fix — keep the _home_config() exemption only for the directories a coding turn legitimately reads/writes (Raven's workspace, tmp, and the bound workdir), so oauth token files fall back under the pattern pass; correct the docstring; add regression cases in tests/test_security_untrusted_context.py for both the newly redacted oauth path and the still-exempt workspace/tmp paths.
This fix was produced with AI assistance (Claude / GLM), disclosed per repo convention.
Opened #917 with the suggested fix: _home_config() now exempts only the workspace and scratch directories, so a read of ~/.raven/oauth/<provider>/... is redacted like another program's settings read, and the docstring no longer claims the exact-match pass covers the token store.
Verified: the repro script redacts both files; uv run --frozen --all-extras pytest tests/test_security_untrusted_context.py -q gives 25 passed (new oauth test next to the #833 exemption tests); full suite pytest tests -q --ignore=tests/manual gives 28194 passed / 4 failed / 118 skipped, the 4 failing with the change stashed on a clean main too.
Activity
akushonkamen commentedon Oct 11, 2026
Confirmed the gap at HEAD (4acc63c):
raven/security/redact.py:112-129_home_config()exempts all of~/.ravenfrom the pattern pass on the assumption that Raven's own keys are covered by the exact-match pass, butraven/config/held_secrets.py:66-87held_secrets()only collects values fromconfig.json(get_config_path()) — nothing underget_oauth_dir()(raven/config/paths.py:86). Soscrub_tool_output(held_secrets.py:111-119) lets~/.raven/oauth/<provider>/auth.jsoncontents through untouched, while~/.codex/auth.jsonis redacted. Reproduced locally with the token JSON from this issue: oauth path unchanged, codex path[redacted].Taking this. Plan: follow the suggested fix — keep the
_home_config()exemption only for the directories a coding turn legitimately reads/writes (Raven'sworkspace,tmp, and the bound workdir), so oauth token files fall back under the pattern pass; correct the docstring; add regression cases intests/test_security_untrusted_context.pyfor both the newly redacted oauth path and the still-exempt workspace/tmp paths.This fix was produced with AI assistance (Claude / GLM), disclosed per repo convention.
akushonkamen commentedon Oct 11, 2026
Opened #917 with the suggested fix:
_home_config()now exempts only the workspace and scratch directories, so a read of~/.raven/oauth/<provider>/...is redacted like another program's settings read, and the docstring no longer claims the exact-match pass covers the token store.Verified: the repro script redacts both files;
uv run --frozen --all-extras pytest tests/test_security_untrusted_context.py -qgives 25 passed (new oauth test next to the #833 exemption tests); full suitepytest tests -q --ignore=tests/manualgives 28194 passed / 4 failed / 118 skipped, the 4 failing with the change stashed on a clean main too.