Uh oh!
There was an error while loading. Please reload this page.
.NET: Harden file skill discovery - #7540
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ff072fa-42d6-44b0-b226-2182cfc7639c
There was a problem hiding this comment.
Pull request overview
This PR hardens .NET file-based skill discovery by treating symlinks/reparse points (and now certain inspection failures) as unsafe during directory traversal, aligning discovery behavior with the intent to avoid escaping configured roots. It also expands unit test coverage for symlink/junction edge cases across platforms.
Changes:
- Add discovery-time validation to skip skill directories/files that are symlinks/reparse points or otherwise unsafe to inspect.
- Update symlink/path inspection logic to treat inspection failures as unsafe (fail-closed) and improve related log messaging.
- Add new unit tests covering symlinked skill directories, symlinked SKILL.md, symlinked configured roots, and Windows junctions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI/Skills/File/AgentFileSkillsSource.cs | Adds defensive checks during skill discovery and tightens symlink/reparse-point handling + logging. |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/FileAgentSkillLoaderTests.cs | Adds regression tests for symlink/junction cases and configured-root behavior. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Agent Framework Review — Iteration 1
Completed passes: 5 | Result: No high-severity findings
Scope: full PR (1 commit(s)): 59cfbd087aba
Review passes
- Correctness (
gpt-5.6-sol) — No issues found in this pass. - Security Reliability (
claude-opus-4.8) — No issues found in this pass. - Test Coverage (
gpt-5.6-sol) — No issues found in this pass. - Failure Modes (
claude-opus-4.8) — No issues found in this pass. - Design Approach (
claude-opus-4.8) — No issues found in this pass.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ff072fa-42d6-44b0-b226-2182cfc7639c
Uh oh!
There was an error while loading. Please reload this page.
Motivation & Context
File-based skill discovery should handle filesystem entries consistently and safely across supported platforms. This change aligns the .NET discovery behavior with the corresponding implementation in other languages and makes discovery more robust when entries cannot be safely classified.
Description & Review Guide
Related Issue
N/A — no public issue is linked.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and the title prefix in sync automatically.