Skip to content

Comments

feat(zeph-skills): validate skill file references and sanitize untrusted body content#691

Merged
bug-ops merged 1 commit intomainfrom
feat/689-reference-validation
Feb 21, 2026
Merged

feat(zeph-skills): validate skill file references and sanitize untrusted body content#691
bug-ops merged 1 commit intomainfrom
feat/689-reference-validation

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 21, 2026

Summary

  • Add validate_skill_references() — parses Markdown links targeting references/, scripts/, assets/ and warns about missing or traversal paths
  • Add sanitize_skill_body() — escapes XML structural tags (case-insensitive) for skills with trust != trusted
  • Sanitization prevents prompt injection via tag closing in untrusted skill content

Closes #689

Test plan

  • cargo nextest run --workspace --lib --bins — 2239 tests pass
  • cargo clippy --workspace -- -D warnings — clean
  • cargo +nightly fmt --check — clean

…ted body content

Add validate_skill_references() to detect broken or path-traversal Markdown
links in skill bodies (references/, scripts/, assets/ subdirs). Warns via
tracing::warn! without blocking skill load.

Add sanitize_skill_body() with case-insensitive replacement of XML structural
tags (skill, instructions, available_skills) to prevent prompt injection from
untrusted skills. Applied in format_skills_prompt() for all non-Trusted trust
levels; Quarantined skills are sanitized before wrapping.

Closes #689
@github-actions github-actions bot added documentation Improvements or additions to documentation skills SKILL.md system rust enhancement New feature or request size/L labels Feb 21, 2026
@bug-ops bug-ops merged commit 4140904 into main Feb 21, 2026
23 checks passed
@bug-ops bug-ops deleted the feat/689-reference-validation branch February 21, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request rust size/L skills SKILL.md system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate file references in skill body and sanitize untrusted content

1 participant