Skip to main content

Module patterns

Module patterns 

Source
Expand description

Built-in injection-pattern list for paste-content detection.

Six pattern groups:

  1. Role hijack / instruction override (p001p008) — conservative. These phrases appear in benign discussion of LLM behavior, so the bias is to only match the explicit override form.
  2. Instruction separators / role tokens (p009p015) — the [INST] / <|system|> family.
  3. System-prompt labels (p016p020).
  4. Prompt reveal / persona shift (p021p025).
  5. Credential exfiltration intent (p026p051) — aggressive. Phrases like “show me your api key” have near-zero false-positive rate in normal conversation.
  6. Sensitive file enumeration (p052p070) — aggressive.
  7. Network exfiltration channels (p071p076) — aggressive.
  8. Jailbreak triggers (p077p088) — aggressive.

Constants§

PATTERNS
Pairs of (pattern_id, needle) consumed by crate::paste::detector::scan. Order matters for id stability: matched ids are stable across versions to support downstream tooling.

Functions§

ids
Pattern ids in the same order as PATTERNS. Used by the detector to look up the id for a matched needle by its Aho-Corasick pattern_id.
needles
Needles in the same order as PATTERNS. Fed verbatim into the Aho-Corasick builder in crate::paste::detector.