Repository navigation
v1 policy: read a Windows path's backslashes as separators in the file rules (#827) - #838
Merged
Merged
Conversation
…e rules (Cygnux-Labs#827) TK-D005 and the other v1 file rules are written with '/', so a Windows path (C:\w\.env) matched none of them, and the v1 hooks let an agent edit .env and other credential files on Windows. policy.evaluate now also hands the rules each file_path and notebook_path with its backslashes read as '/'. No YAML changes, so the policy hash is the same. Signed-off-by: Khushi Jain <jainkhushibts@gmail.com>
LoopGlitch26
left a comment
Member
There was a problem hiding this comment.
Reviewed (read against main; nothing run here). This is right, and it's the smallest fix in the right place. I checked each claim in the description:
- Only adds matches.
rulediscallsplus a/copy of each backslash path, and deny, ask and flag each takeanyover it, so nothing that matched on main stops matching. - The evidence doesn't change. The copies exist only for the rule match; the recorded call keeps the path as the agent sent it, and the scope check still reads
calls. - Same policy hash. No YAML changes. And neither verifier re-runs v1's
evaluate, so old bundles aren't touched. - It also fixes TK-D009 (writes to the harness transcripts, such as
.claude\projects\…), which is written with/as well. - The test fails on main for its five deny cases (none of them has a
/before.env,.sshor.aws) and keeps two controls (app.py,.env.example).
Like the other policy PRs, this merges right after the coming release, which changes the same rules; we'll settle any conflict at merge. Nothing for you to do until then unless CI says otherwise.
Member
|
Merged now instead of after the release: this also turns main's Windows jobs green ( |
9 of 10 tasks
munjikesh
added a commit
to munjikesh/Tracekit
that referenced
this pull request
Nov 14, 2026
Brings in a14d842 (Cygnux-Labs#838), whose Windows path fix makes test_cursor_edit_tools_are_decided_as_edits pass on the Windows jobs. No pack, policy corpus or E17/E21 result changed on main, so the recorded evals stand. Signed-off-by: Munjikesh N <Munjikesh.N@iiitb.ac.in>
wanjinhao1
pushed a commit
to wanjinhao1/Tracekit
that referenced
this pull request
Nov 15, 2026
munjikesh merged main into Cygnux-Labs#828 (6c76dbe, for Cygnux-Labs#838's Windows test fix) after the train took its earlier head 3ee777e. Its pack, test and policy-doc changes are 3ee777e's, and the train already holds that main, so this merge changes no file; it puts Cygnux-Labs#828's current head in the train, so Cygnux-Labs#828 shows as merged. The review's podman-remote exception and the nice/nohup rows stay in the train's own commit on top of 3ee777e. Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #827.
TK-D005and the other v1 file rules are written with/. A Windows path (C:\w\.env) matched none of them, so on Windows the v1 hooks let an agent edit.env,.ssh\…and.aws\….policy.evaluatenow also hands thedeny,askandflagrules eachfile_pathandnotebook_pathwith its backslashes read as/.\as a separator can only add matches.Tests
tests/test_hardening.py,PolicySafety.test_a_windows_path_is_read_with_its_backslashes_as_separators:.env,.env.production,.ssh\authorized_keysand.aws\configpaths, and a.envin a patch'spaths, are denied byTK-D005;app.pyand.env.exampleare not.On my fork, ubuntu-latest and windows-latest, Python 3.13 (before rebasing onto cda2997; the rebase was clean):
tests/test_hardening.py: 64 passed on Linux; 61 passed and 3 skipped on Windows;test_cursor_edit_tools_are_decided_as_editspasses on Windows, where it fails on main;policy.py: its 5 deny cases fail on both;