Python: Add windows junction detection for skills - #7507
Open
westey-m wants to merge 2 commits into
Open
Conversation
westey-m
temporarily deployed
to
github-app-auth
August 4, 2026 14:55 — with
GitHub Actions
Inactive
westey-m
temporarily deployed
to
github-app-auth
August 4, 2026 14:55 — with
GitHub Actions
Inactive
westey-m
temporarily deployed
to
github-app-auth
August 4, 2026 14:55 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟡 Not ready to approve
A newly added test (test_link_probe_detects_windows_reparse_attribute) will fail on non-Windows platforms because it asserts a Windows-only stat constant without skipping.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
This PR hardens Python skill and file-access path handling on Windows by treating directory junctions (and other reparse points) as disallowed “link-like” path segments, closing an escape vector similar to symlinks.
Changes:
- Added a shared private helper (
is_link_or_reparse_point) for detecting symlinks, junctions, and Windows reparse points. - Updated file-based skills discovery/validation to reject any path containing a symlink or reparse point segment (fail-closed on probe errors).
- Consolidated junction creation helpers in tests and added coverage for junction/reparse-point detection.
File summaries
| File | Description |
|---|---|
| python/packages/core/agent_framework/_filesystem.py | Introduces shared link/reparse-point detection helper used by security checks. |
| python/packages/core/agent_framework/_skills.py | Extends skill resource/script scanning and resource validation to treat reparse points like symlinks (and fail closed on probe errors). |
| python/packages/core/agent_framework/_harness/_file_access.py | Reuses the shared helper to consistently filter/deny link-like filesystem entries. |
| python/packages/core/tests/core/conftest.py | Adds a reusable create_junction_or_skip test helper for Windows junction creation. |
| python/packages/core/tests/core/test_skills.py | Updates symlink tests to new API name and adds a junction guard test. |
| python/packages/core/tests/core/test_harness_file_access.py | Switches to shared junction helper and adds a unit test for the Windows reparse-attribute fallback. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
|||||||||||||||||||||||||||||||||||||||||||||
westey-m
enabled auto-merge
August 4, 2026 15:15
SergeyMenshykh
approved these changes
Aug 4, 2026
moonbox3
reviewed
Aug 5, 2026
westey-m
temporarily deployed
to
github-app-auth
August 5, 2026 18:06 — with
GitHub Actions
Inactive
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.
Motivation & Context
Description & Review Guide
Related Issue
Fixes #
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.