Skip to content

fix(ingest): extract commands across nested and alternative MCP input shapes - #467

Closed
NSudeep-Rust wants to merge 1 commit into
blitzcrieg1:masterfrom
NSudeep-Rust:fix/mcp-command-extraction
Closed

NSudeep-Rust wants to merge 1 commit into
blitzcrieg1:masterfrom
NSudeep-Rust:fix/mcp-command-extraction

Conversation

@NSudeep-Rust

Copy link
Copy Markdown
Contributor

Closes #433

Summary

  • Extracts shell command candidates across all 8 MCP input shapes (command, argv, program+args, cmd+argv, commands, code with language awareness, nested containers like input, and JSON-encoded string payloads).
  • Enforces depth, JSON decode, and byte bounds aligned with CLASSIFY_MAX_LEN (Block mode should ask on input too large or opaque to classify #348) and emits classification: partial when a bound is hit.
  • Excludes prose and non-command fields (query, file content alongside path).
  • Adds unit tests and attack/benign corpus fixtures.

Verification

  • python -m ruff check agentmetry tests passed
  • python -m pytest -q passed (2,948 passed, 83.43% coverage)
  • agentmetry benchmark passed (0 misses, 0 false positives)
  • Frozen detection files and ruleset fingerprint remain unchanged.

@NSudeep-Rust

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@blitzcrieg1

Copy link
Copy Markdown
Owner

Landed as rebased PR #470 (README/corpus conflicts with #468/#469 resolved). Thanks @NSudeep-Rust.

blitzcrieg1 added a commit that referenced this pull request Nov 25, 2026
… shapes (rebased #467, fixes #433) (#470)

* fix(ingest): extract commands across nested and alternative MCP input shapes (#433)

* docs: changelog entry for MCP input-shape extraction (#433), corpus.yaml rebase fix

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>

---------

Co-authored-by: Your Name <[email protected]>
Co-authored-by: Mistral Vibe <[email protected]>
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.

ingest: commands inside MCP inputs are invisible to detection unless under a top-level command key

2 participants