Skip to content

[dotnet-port-fixes] Harden file skill discovery - #833

Open
Michelle Clayton (michelle-clayton-work) wants to merge 1 commit into
mainfrom
copilot/dotnet-port-fsskills-hardening-20260811-2d23946e974262e7
Open

[dotnet-port-fixes] Harden file skill discovery#833
Michelle Clayton (michelle-clayton-work) wants to merge 1 commit into
mainfrom
copilot/dotnet-port-fsskills-hardening-20260811-2d23946e974262e7

Conversation

@michelle-clayton-work

Copy link
Copy Markdown
Contributor

Summary

Port the .NET file-skill discovery hardening from microsoft/agent-framework#7540 into the Go agent/skills/fsskills loader. The Go change now skips symlinked SKILL.md files, resources, and scripts during discovery while still allowing a caller-configured root path that is itself a symlink.

Ported .NET PRs

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

  • Added parity tests for symlinked SKILL.md, resource, and script paths, plus configured-root symlink support
  • Ran go test ./agent/skills/fsskills

Notes

  • This PR keeps the scope to the file-skill symlink hardening that maps cleanly to the existing Go API surface.
  • The existing Go discovery logic already continues past unreadable directories without aborting sibling skill discovery, so no additional API-safe change was needed there.
  • Upstream commit: microsoft/agent-framework@94bbfb2

Generated by .NET to Go Fixes and Test Porting Agent · gpt54 · 215.2 AIC · ⌖ 13.2 AIC · ⊞ 24.2K ·

Closes #822

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.md as 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.

Comment on lines +217 to +221
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
}
@github-actions

Copy link
Copy Markdown
Contributor

Parity Review: ✅ Approved

This PR ports symlink-hardening from .NET PR microsoft/agent-framework#7540 into the Go agent/skills/fsskills loader.

Scope: Only agent/skills/fsskills/source.go (internal discovery logic) and tests are changed. No exported Go APIs are added, removed, or modified.

Upstream alignment: The Go change faithfully mirrors the .NET hardening — skip symlinked SKILL.md files, resources, and scripts during discovery while still allowing a caller-configured root that is itself a symlink. Semantics are consistent with upstream commit 94bbfb2.

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 public-api-change label applied — exported API surface is unchanged.

Parity review complete. No cross-repo consistency issues found.

Generated by Go API Consistency Review Agent for #833 · sonnet46 · 14.8 AIC · ⌖ 5.61 AIC · ⊞ 5.7K ·

@github-actions github-actions Bot added the parity-approved Go API consistency review found no parity issues label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parity-approved Go API consistency review found no parity issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dotnet-port-fixes] Harden file skill discovery

2 participants