Skip to content

feat(utils/scanner): add SkillRunner to scan agent skill bundles#1746

Merged
paralta merged 2 commits into
mainfrom
feat/skill-scanner
Jul 3, 2026
Merged

feat(utils/scanner): add SkillRunner to scan agent skill bundles#1746
paralta merged 2 commits into
mainfrom
feat/skill-scanner

Conversation

@paralta

@paralta paralta commented Jul 3, 2026

Copy link
Copy Markdown
Member

This PR implements SkillRunner in utils/scanner, the counterpart to the existing MCPRunner, completing security scanning support for records that carry agent skill artifacts. The runner extracts the core/language_model/agentskills module from a record, unpacks it via exportfmt.ExtractSkillBundleArchive, and runs skill-scanner scan to produce a ScanResult with per-finding severity. SKILL_SCANNER_LLM_* environment variables are derived automatically from the AZURE_OPENAI_* equivalents so CI doesn't need duplicate config.

  • ExtractSkillBundleArchive is extended to transparently handle both gzip-tar bundles and plain-text SKILL.md manifests via a magic-byte check, eliminating format-detection logic from the scanner itself.
  • utils/go.mod switches from the pinned api v1.5.0 to a local replace directive so the scanner can use the updated exportfmt package before a new tag is cut.
  • trimToSkillJSON looks for either { or [ as the JSON start, unlike the MCP equivalent which only accepts arrays — skill-scanner's single-scan mode emits a top-level object.
  • Safety verdict is taken directly from the scanner's is_safe field; findings are always surfaced regardless of that verdict so callers have full context.

paralta added 2 commits July 3, 2026 10:32
Signed-off-by: Catarina Paralta <clouropa@cisco.com>
Signed-off-by: Catarina Paralta <clouropa@cisco.com>
@paralta
paralta requested a review from a team as a code owner July 3, 2026 10:55
@paralta paralta linked an issue Jul 3, 2026 that may be closed by this pull request
2 tasks
@github-actions github-actions Bot added the size/M Denotes a PR that changes 200-999 lines label Jul 3, 2026
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.46847% with 35 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
utils/scanner/skill.go 69.2% 31 Missing and 2 partials ⚠️
api/exportfmt/skill_bundle_extract.go 50.0% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@ramizpolic ramizpolic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@paralta
paralta merged commit c188976 into main Jul 3, 2026
33 checks passed
@paralta
paralta deleted the feat/skill-scanner branch July 3, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 200-999 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add skill-scanner support

2 participants