Skip to content

fix(tier3): mask skill and home paths and keep more text in feedback chat evidence - #364

Merged
rng1995 merged 8 commits into
mainfrom
naren/followup-341-feedback-scrub
Nov 6, 2026
Merged

rng1995 merged 8 commits into
mainfrom
naren/followup-341-feedback-scrub

Conversation

@rng1995

@rng1995 rng1995 commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #341, which merged before its last review round. #341's tier3 feedback chat replaces absolute paths that end in the run directory with the run ID, and redacts credentials before shortening each field. Four gaps remained.

  • Skill and home directories. Only the run directory was masked. With a run at /Users/alice/work/acme-skill/evals/results/<id>, the error Skill validation failed: /Users/alice/work/acme-skill/SKILL.md missing name reached the provider unchanged. Now the evaluated skill's directory is written as its name (acme-skill/SKILL.md) and the home directory as ~ (~/.codex/config.toml), matched only as whole paths, so /home/alice2 is not read as ~2. The skill directory comes from an explicit --skill, or from a run kept in <skill>/evals/results, because an inferred skill is otherwise only a name.
  • Home spellings of a copied run's path. Only ~/ counted as a home root, so see ~alice/work/acme-skill/evals/results/<id>/jobs was sent unchanged. ~user/, $HOME/, ${HOME}/ and %USERPROFILE%\ now start a path too.
  • Joined paths. The replacement started at the first root after the preceding whitespace or quote, so tried /opt/tool/bin,/home/alice/results/<id>/jobs became tried <id>/jobs. A root right after ,;:=([{ (other than a drive letter's colon) now starts a path of its own: the same text becomes tried /opt/tool/bin,<id>/jobs, and PATH=/usr/bin: and log:/var/log/x( are kept as well. A separator that is not followed by a root stays part of the path, so /home/alice/my(project),v2/<id> is still masked whole. The trade-off: a directory name that ends in one of those characters right before a /, such as /home/alice/proj:/<id>, is read as two paths, so only the second is replaced. The CLI reference says so.
  • Long unbroken fields. A field with no whitespace in the 65,536 characters after its limit was cut back to its last whitespace, so Error: plus a 125,000-character minified JSON body became Error: ...<truncated>. It is now cut at its last whitespace or punctuation that no credential pattern takes inside a token (, " } and similar), and keeps a masked prefix up to its limit. A cut inside a URL's user info would leave part of it unredacted, so the cut moves in front of a :// that only user-info characters follow. The helper, credential_safe_cut, sits in utils/redaction.py next to the patterns it depends on.
  • docs/cli-reference.mdx and the feat(tier3): add tier3 feedback chat over a completed run #341 CHANGELOG entry (Unreleased / Added) now say that the skill directory is written as its name and the home directory as ~. The CLI reference also covers the home spellings (including ${HOME}/) and joined paths.

Why

#341 aims to send the run ID, not the host path. The skill path and other paths under the home directory still carried the user name and directory layout. The joined-path and long-field cases leaked nothing, but removed evidence the model could cite, such as which tool path failed or how a provider error starts.

Kept from public

  • feat(tier3): add tier3 feedback chat over a completed run #341's order is unchanged: each field is masked whole before it is shortened. The 65,536-character window, the ...<truncated> marker and dropping the token cut at the window's edge are unchanged too. The new cut only moves to characters no token pattern contains, and never into URL user info. A field whose first 65,536 characters have no such character, such as z repeated 100,000 times, is still sent as ...<truncated>.
  • The run directory is still replaced wherever it occurs, also as a prefix of a longer name. A path from another machine that contains a space is still not recognized, as the docs say.
  • https://host.example/alice/<id> is still masked to https:<id>, as on main.
  • The path scan stays linear. On the same 680,000-character inputs that are worst for main, it runs in about the same time as main.

Tests

  • tests/evaluation/test_tier3_feedback_chat.py:
    • new: the skill and home directories are replaced as whole paths only (1 case);
    • new: open_feedback_session replaces them for an inferred skill in <skill>/evals/results and for an explicit --skill (2 cases);
    • extended: the copied-run test now covers the ~builder/, $HOME/, ${HOME}/ and %USERPROFILE%\ spellings, paths joined by , ; : ( and a drive-letter ;, and a path with ( and , masked whole;
    • extended: the long-text test now covers a minified body longer than 65,536 characters, which keeps its prefix, and URL user info at the cut point, which is not left behind.
    • These 5 tests fail on main and pass with this change.
  • tests/test_redaction_assignments.py: 7 credential_safe_cut cut-point cases, plus 8 cases checking that no cut leaves part of a GitHub, GitHub stateless, AWS, sk-, JWT, Bearer, URL user-info or quoted-assignment credential.
  • The two touched files: 124 passed.
  • tests/evaluation, tests/test_redaction_assignments.py, tests/test_safety_boundaries.py, tests/inference/test_llm_client.py, tests/tier3/test_plugin_signals.py, tests/test_cli.py and tests/test_oss_packaging.py, run on current main plus this change: 858 passed.
  • ruff check and ruff format --check are clean on the changed files, and scripts/check_oss_boundary.py passes.

🤖 Generated with Claude Code

rng1995 and others added 3 commits November 5, 2026 19:50
…ence

The feedback chat only replaced paths that end in the run directory. An
error naming the evaluated skill, such as `<skill>/SKILL.md missing name`,
or any other file under the home directory still reached the provider
with the user name and directory layout.

- The skill directory is written as its name and the home directory as
  `~`, matched only as whole paths. The skill directory comes from an
  explicit `--skill`, or from a run kept in `<skill>/evals/results`.
- A copied run's path is also found when it starts with `~user/`,
  `$HOME/`, `${HOME}/` or `%USERPROFILE%\`.
- A path joined to a copied run's path by `,;:=([{` (other than a drive
  letter's colon) starts a path of its own, so `PATH=/usr/bin:/home/a/<id>`
  keeps `/usr/bin`. A separator not followed by a root stays part of the
  path, so `/home/a/my(project)/<id>` is still masked whole.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A field with no whitespace in the 65,536 characters after its limit was
cut back to its last whitespace before masking, so `Error: ` plus a long
minified JSON body reached the chat as `Error: ...<truncated>`.

Such a field is now cut at its last whitespace or punctuation that no
credential pattern takes inside a token (`,` `"` `}` and similar), so it
keeps a masked prefix up to its limit. A cut inside a URL's user info
would leave part of it unredacted, so the cut moves in front of a `://`
that only user-info characters follow. `credential_safe_cut` lives next
to the redaction patterns it depends on, and a test checks that no cut
point leaves part of a known credential behind.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…chat masking

The CLI reference listed ~user/, $HOME/ and %USERPROFILE% but not ${HOME}/,
which the masking also accepts. It now also says that a root right after one of
, ; : = ( [ { starts a new path, so a directory name ending in one of those
characters before a / is read as two paths and only the second is replaced.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@chrisknvidia chrisknvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the path scrubbing: skill, home, ~user/, $HOME/, ${HOME}/ and %USERPROFILE%\ forms are all redacted, and joined paths after separators are covered. I left one inline finding and will push the fix to this branch.

@rng1995
rng1995 marked this pull request as ready for review November 6, 2026 12:19
@rng1995
rng1995 enabled auto-merge (squash) November 6, 2026 12:20
@rng1995
rng1995 merged commit 4fd19a8 into main Nov 6, 2026
22 checks passed
@rng1995
rng1995 deleted the naren/followup-341-feedback-scrub branch November 6, 2026 12:51
rng1995 added a commit that referenced this pull request Nov 6, 2026
…Unreleased

Nine PRs merged after the v0.8.0 tag (8149356). Four of them rewrote
bullets inside the 0.8.0 section and one added a new bullet there, so
main's 0.8.0 notes described behavior that 0.8.0 does not have. Two
fixes to 0.8.0 features added no entry.

- Restore the 0.8.0 section and everything below it to the tagged text,
  byte for byte.
- Move the agent skill entry (#366) to Unreleased, Added.
- Add Documentation entries for the 0.8.0 wording that #360, #361 and
  #363 corrected (refusal coverage error, inline short texts, capitalized
  HTTP prose that still warns).
- Add Fixed entries for #361, #365, #359, #364 and #363 that describe
  only what changed after 0.8.0. The #364 entry states that path masking
  skips text after a non-file: URL up to the next whitespace, which is
  how main behaves today.
- Move the #348 entry to Fixed and say what 0.8.0 did: a CI-redacted PII
  finding kept the digest of its unmasked value.
- The refusal docs test now reads the Documentation correction, which
  matches the docs, and still requires the switch's entry in 0.8.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995 added a commit that referenced this pull request Nov 6, 2026
…Unreleased

Nine PRs merged after the v0.8.0 tag (8149356). Four of them rewrote
bullets inside the 0.8.0 section and one added a new bullet there, so
main's 0.8.0 notes described behavior that 0.8.0 does not have. Two
fixes to 0.8.0 features added no entry.

- Restore the 0.8.0 section and everything below it to the tagged text,
  byte for byte.
- Move the agent skill entry (#366) to Unreleased, Added.
- Add Documentation entries for the 0.8.0 wording that #360, #361 and
  #363 corrected (refusal coverage error, inline short texts, capitalized
  HTTP prose that still warns).
- Add Fixed entries for #361, #365, #359, #364 and #363 that describe
  only what changed after 0.8.0. The #364 entry states that path masking
  skips text after a non-file: URL up to the next whitespace, which is
  how main behaves today.
- Move the #348 entry to Fixed and say what 0.8.0 did: a CI-redacted PII
  finding kept the digest of its unmasked value.
- The refusal docs test now reads the Documentation correction, which
  matches the docs, and still requires the switch's entry in 0.8.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995 added a commit that referenced this pull request Nov 6, 2026
…Unreleased (#371)

Nine PRs merged after the v0.8.0 tag (8149356). Four of them rewrote
bullets inside the 0.8.0 section and one added a new bullet there, so
main's 0.8.0 notes described behavior that 0.8.0 does not have. Two
fixes to 0.8.0 features added no entry.

- Restore the 0.8.0 section and everything below it to the tagged text,
  byte for byte.
- Move the agent skill entry (#366) to Unreleased, Added.
- Add Documentation entries for the 0.8.0 wording that #360, #361 and
  #363 corrected (refusal coverage error, inline short texts, capitalized
  HTTP prose that still warns).
- Add Fixed entries for #361, #365, #359, #364 and #363 that describe
  only what changed after 0.8.0. The #364 entry states that path masking
  skips text after a non-file: URL up to the next whitespace, which is
  how main behaves today.
- Move the #348 entry to Fixed and say what 0.8.0 did: a CI-redacted PII
  finding kept the digest of its unmasked value.
- The refusal docs test now reads the Documentation correction, which
  matches the docs, and still requires the switch's entry in 0.8.0.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
rng1995 added a commit that referenced this pull request Nov 9, 2026
…tart (#389)

* fix(tier3): end feedback chat URL spans where a path after them can start

The feedback chat leaves a URL other than a file: URL unchanged while it
masks local paths (#364). Its URL pattern ran to the next whitespace, so
in minified JSON such as

  {"doc":"https://host/e","log":"/home/alice/skill/evals/results/<id>/a.log"}

everything after the URL, including the run's, the skill's and the home
directory's local paths, reached the provider unmasked. 0.8.0 replaced
the run's path there with the run ID.

A URL now ends:
- at whitespace, at a character a URL never holds unencoded
  (" < > ` ^ { | }), and at a single quote;
- at a \n \r or \t escape (JSON or repr text), so the next line of an
  escaped env dump or stderr (HOME=..., ERROR:..., --log=..., file://...)
  is masked;
- before an absolute-path root or another scheme that follows a , or ;
  (a list), a , or ; with an option or variable name and =
  (DOC=https://h/e;LOG=/x, ,--find-links=file:///x), or a Markdown ](,
  so a file: URL listed after one is masked.
Commas, semicolons, parentheses, = and other backslashes inside a URL
still belong to it, so a Windows path in a URL is kept, and a local path
in its query or fragment stays unchanged, as #364 intended.

A backslash, n, r or t is an escape even when its backslash is doubled,
as in JSON inside JSON. It is a Windows folder instead when a name and
as many backslashes follow: C:\Users\bob\t\runs\<id> has a folder t,
and so does its JSON spelling with doubled backslashes. So a copied
Windows or UNC run path with such a folder is masked whole, as in 0.8.0,
and a URL holding one is kept. A scheme starts after an escape, not
inside it, so \nfile:///x is a file: URL and is masked, not an nfile:
URL that is kept.

A +file: scheme such as git+file: names a local path, so it is masked
like file: instead of being kept as a remote URL; 0.8.0 masked the run
path there.

A skill or home path right after a \n, \r or \t escape counts as a whole
path and is masked. A copied run's path after one, or after a path-list
separator and one, keeps the escape and the earlier list item.

The scheme is now at most 64 characters. Unbounded, it was rescanned
from every word boundary, so 300,000 characters of a.a.a took minutes;
it now takes well under a second.

The CLI reference now says what a URL keeps and where it ends, and the
Unreleased #364 entry describes the fixed behavior.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>

* fix(tier3): address #389 review: escape, ANSI and UNC path starts

- The backslash of a \n, \r or \t escape or of an escaped ANSI code is
  never an absolute-path root, and only the first backslash of a run can
  be one, so a relative path after an escape stays relative (also in
  JSON, evals\\results) and long runs are scanned once.
- A root right after an ANSI code (any CSI sequence: colors, erase line,
  cursor moves; up to 64 parameter characters) starts a path. ANSI codes
  after a line escape or separator, escaped at the same level, split
  paths, so /opt/a.py\r\x1b[K/srv/<id> keeps the earlier path; a path
  colored in parts is masked whole; a drive letter after a code is a
  drive.
- An even run of backslashes, a name, half as many backslashes and a
  share name is a UNC server (\\nas01\share, \\tsclient\C), not a doubled
  escape, unless the server is named only n, r or t and an escaped
  character follows (\\n\u201c from JSON around repr text).
- Folders named only n, r or t in a row (\r\n), and folders named like
  escapes after one (\t\x64\x86, \n\x64@2), are read together, up to
  eight steps; any \uXXXX or \xNN after such a folder is an escape unless
  it is a folder itself. In JSON a folder may start with an escaped
  letter (\\t\\\u00e9cole). The URL pattern mirrors the folder check.
- A URL ends at an ANSI escape; the URL's escape checks are
  case-sensitive and linear on long backslash runs.
- file://localhost may start right after an escape.
- Docs and the Unreleased CHANGELOG entry describe the rules.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>

---------

Signed-off-by: Narendran Raghavan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

2 participants