Skip to content

feat(skills): threat scan, lockfile pinning, manifest hardening - #256

Merged
Patel230 merged 3 commits into
mainfrom
feat/skill-threat-scan-lockfile
Aug 24, 2026
Merged

feat(skills): threat scan, lockfile pinning, manifest hardening#256
Patel230 merged 3 commits into
mainfrom
feat/skill-threat-scan-lockfile

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

Ports three hardening mechanisms from autohandai/code-cli (Apache-2.0).

Changes

  • Threat scanner (internal/plugin/threatscan.go): 20 pattern rules across command-injection / data-exfiltration / encoded-payload / network-calls, scored 0-100. Installs scoring <30 are refused; warning-band installs report findings.
  • Skills lockfile (internal/plugin/skillslock.go): per-scope skills-lock.json pinning source repo, cloned commit sha, skill path, and SHA-256 of installed content; maintained on install and remove.
  • Manifest hardening (internal/plugin/manifest_hardening.go wired into ParseManifestV2/ValidateV2): 64 KiB cap, symlink refusal, UTF-8 check, duplicate-JSON-key rejection, strict name pattern + semver version. One test fixture updated 1.0 -> 1.0.0 (intentional tightening).
  • Docs: install-time security + lockfile section in docs/user-guide/08-skills.md.

Verification

  • New tests: 9 threat-scan/lockfile + 3 hardening funcs, all passing
  • go test ./internal/plugin ./cmd ok; go build ./... clean
  • make lint 0 issues; lefthook hooks green

- internal/plugin/threatscan.go: threat-pattern scanner (command injection,
  data exfiltration, encoded payloads, network calls) with 0-100 scoring;
  installs are refused below the block threshold
- internal/plugin/skillslock.go: per-scope skills-lock.json pinning source
  repo, cloned commit, and content SHA-256; maintained on install and remove
- internal/plugin/manifest_hardening.go: bounded symlink-refusing manifest
  reads with duplicate-JSON-key rejection and strict name and semver
  patterns, wired into ParseManifestV2 and ValidateV2
- docs: install-time security and lockfile section in user guide
@Patel230
Patel230 enabled auto-merge (squash) August 24, 2026 16:15
@Patel230
Patel230 merged commit 8fdb3d9 into main Aug 24, 2026
26 checks passed
@Patel230
Patel230 deleted the feat/skill-threat-scan-lockfile branch August 24, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant