hermes - 💡(How to fix) Fix Context and skill scanners miss multi-word instruction-override variants [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The cooperative prompt-injection heuristic misses multi-word variants of common instruction-override phrases in skill/context scanning paths. Existing exact or overly narrow matching catches contiguous payloads like ignore previous instructions, but misses variants that insert extra words or use synonyms such as prior / above.

This issue tracks widening the relevant heuristic patterns so benign scanner coverage is consistent across the code paths that inspect skill, context, and memory content before it is surfaced to the agent.

Root Cause

The cooperative prompt-injection heuristic misses multi-word variants of common instruction-override phrases in skill/context scanning paths. Existing exact or overly narrow matching catches contiguous payloads like ignore previous instructions, but misses variants that insert extra words or use synonyms such as prior / above.

This issue tracks widening the relevant heuristic patterns so benign scanner coverage is consistent across the code paths that inspect skill, context, and memory content before it is surfaced to the agent.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Summary

The cooperative prompt-injection heuristic misses multi-word variants of common instruction-override phrases in skill/context scanning paths. Existing exact or overly narrow matching catches contiguous payloads like ignore previous instructions, but misses variants that insert extra words or use synonyms such as prior / above.

This issue tracks widening the relevant heuristic patterns so benign scanner coverage is consistent across the code paths that inspect skill, context, and memory content before it is surfaced to the agent.

Bypass class

Examples that should be flagged but can be missed by narrow substring/pattern matching:

  • ignore ALL prior instructions and ...
  • please ignore every single previous instructions and ...
  • disregard your original guidelines completely
  • forget your original instructions and ...

The core pattern is not a single string. It includes:

  • inserted words between key terms;
  • flexible whitespace;
  • synonyms such as prior, above, or guidelines;
  • variants around forget/disregard/ignore + previous instruction concepts.

Affected areas to audit

Please audit and widen the relevant patterns in the heuristic scanners, including whichever of these paths applies to the current tree:

  • tools/skills_guard.py
  • agent/prompt_builder.py
  • tools/memory_tool.py
  • any skill/context-file scanner that still relies on exact substring checks for instruction-override phrases

Expected fix

Use flexible regex-style matching for this bypass class, for example allowing intermediate words and whitespace around the instruction-override concepts. Existing hardened patterns in the tree can be extended rather than introducing a separate matcher.

The fix should include regression tests under tests/ covering at least:

  • exact known payloads still detected;
  • multi-word inserted variants detected;
  • synonym variants such as prior / above detected;
  • benign content should not be over-blocked where possible.

Notes

This is a cooperative-mode hardening issue for scanner coverage. It improves detection quality for suspicious skill/context content, but should not be framed as a complete security boundary by itself.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING