[dotnet-port-fixes] Harden file skill discovery - #833
Conversation
Port .NET file-skill discovery hardening so symlinked skill files, resources, and scripts are skipped while a symlinked configured root remains supported. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR ports the .NET “file-skill discovery hardening” behavior into the Go agent/skills/fsskills loader by adding symlink/inspection checks so discovery skips symlinked SKILL.md files, resources, and scripts while still allowing a caller-provided root that is itself a symlink.
Changes:
- Hardened skill directory discovery to avoid treating symlinked
SKILL.mdas a valid skill marker. - Hardened resource/script discovery to skip symlinked (or uninspectable) entries during scan.
- Added tests covering symlinked
SKILL.md, resources, scripts, and symlinked configured-root behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| agent/skills/fsskills/source.go | Adds symlink/inspection checks during skill, resource, and script discovery. |
| agent/skills/fsskills/source_test.go | Adds tests for symlinked SKILL.md, symlinked configured root, and symlinked resources. |
| agent/skills/fsskills/source_script_test.go | Adds a test ensuring symlinked scripts are skipped. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| skillPath := path.Join(dir, entry.Name()) | ||
| if isUnsafeDirEntry(filesystem, skillPath, entry) { | ||
| logger.Warn("Skipping skill discovery path: symbolic link or inspection failure", "path", skillPath) | ||
| return | ||
| } |
Parity Review: ✅ ApprovedThis PR ports symlink-hardening from .NET PR microsoft/agent-framework#7540 into the Go Scope: Only Upstream alignment: The Go change faithfully mirrors the .NET hardening — skip symlinked Python parity: The Python SDK does not currently expose a file-system skill loader equivalent, so there is no Python surface to compare against. No Parity review complete. No cross-repo consistency issues found.
|
Summary
Port the .NET file-skill discovery hardening from microsoft/agent-framework#7540 into the Go
agent/skills/fsskillsloader. The Go change now skips symlinkedSKILL.mdfiles, resources, and scripts during discovery while still allowing a caller-configured root path that is itself a symlink.Ported .NET PRs
94bbfb2ac8382450219afd978bbe17b7eb44efbf)Breaking Changes
No. Exported Go APIs are unchanged; the loader only rejects unsafe file-skill paths that previously could be followed through symlinks.
Tests and Examples
SKILL.md, resource, and script paths, plus configured-root symlink supportgo test ./agent/skills/fsskillsNotes
Closes #822