Skip to content

security(mcp): sanitize ephemeral MCP tool schemas against indirect prompt injection - #23

Merged
divyanshujethi merged 2 commits into
mainfrom
sec/phase7-mcp-prompt-injection-guard
Nov 18, 2026
Merged

divyanshujethi merged 2 commits into
mainfrom
sec/phase7-mcp-prompt-injection-guard

Conversation

@divyanshujethi

Copy link
Copy Markdown
Collaborator

Phase 7 (P1) - Runtime Boundary Hardening

  • Adds \src/prompt-guard.ts\ (\sanitizeMcpSchemaText, \sanitizeToolDefinition, \sanitizeSkillSummary) stripping instruction overrides, role hijacks, delimiter smuggling, <system>\ tags, shell exfiltration directives, and invisible Unicode smuggling (\U+200B..U+200F, \U+202A..U+202E, \U+2060..U+206F, \U+FEFF).
  • Wires sanitization into \SkillPrismHarness\ (\search_skills\ and \load_skill\ / \convertToToolDefinition) in \src/harness.ts.
  • Adds regression suite in \ ests/phase7-mcp-prompt-injection-guard.test.ts\ (112/112 suite passing).

@github-actions

Copy link
Copy Markdown

👋 Thanks for opening this Pull Request, @divyanshujethi!

Thank you for contributing to SkillPrism! 🚀

Here is what happens next:

  1. 🧪 Automated CI Tests: Our workflow is verifying code compilation, Biome formatting, and token benchmarks.
  2. 🔍 Code Review: A maintainer from @RitualDev-Lab will review your changes shortly.
  3. 🌟 Contributor Recognition: Once merged, you'll be featured on our contributors list!

💡 Tip: Make sure your commits follow Conventional Commits and tests pass locally (pnpm test).

@divyanshujethi
divyanshujethi merged commit e0e55cb into main Nov 18, 2026
8 checks passed
@divyanshujethi
divyanshujethi deleted the sec/phase7-mcp-prompt-injection-guard branch November 18, 2026 03:53
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.

2 participants