{ "version": "0.2.0", "id": "injection-lexicon", "description": "Prompt-injection pattern lexicon: the four pattern families a detector matches against untrusted text, and the severity family each belongs to. Data only. The variant building that feeds these patterns (normalisation, homoglyph folding, rot13, unicode-tag escalation) and the buried-payload heuristic are engine behaviour and are deliberately NOT described here.", "owasp": "LLM01", "label_format": "{class}: {detail}", "pattern_id_space": { "$comment": "Stable, commons-owned identifier for each pattern. It exists because an expected.json in conformance/ has to name a finding, and the two runtimes that seed this repository do not name the same pattern the same way: llm-security calls it `override: ignore previous instructions`, the Python guard calls it `override:ignore-previous`. Without a shared key no fixture can be written at all, including for the patterns whose regex is byte-identical in both.", "field": "families[].patterns[].id", "adopted_from": "llm-ingestion-pipeline-security src/llm_ingestion_guard/injection_lexicon.json (lexicon version 1.0, repo v0.3.4, commit 0bf0729) — the `id` field of its port of the same source table. Adopted verbatim rather than invented: the guard's port already carries both names (`id` and `desc`), so the mapping is read from verified source data rather than constructed here.", "matching_method": "Each commons pattern was matched to a guard pattern by comparing this file's `label` to the guard's `desc`, with em-dash normalised to hyphen (the two differ only by that character, in the eight hitl-trap entries). 83/83 matched, one-to-one.", "stability": "An id is a stable identifier. Changing one is a BREAKING change for any consumer matching on it, and requires a major bump of this file.", "aliases": "Each pattern carries an `aliases` object naming what each seeding runtime calls it today. A runtime renames its own label by changing its alias here; the `id` does not move.", "not_yet_confirmed": "Neither llm-security nor the guard has yet agreed to this id space — both were asked via coord on 2026-08-09. Until they answer, `id` is this repository's proposal, not a ratified cross-runtime contract." }, "$comment": "Extracted without behaviour change from llm-security/scanners/lib/injection-patterns.mjs, delivered as operator dump 2/2 through the local coord mailbox on 2026-08-09. Only the four pattern arrays are data. The dump states explicitly that checkCognitiveLoadTrap (the buried-after-2000-chars logic) and scanForInjection's variant building are ENGINE logic that never moves here; they are absent by intent, not by omission. Array order is preserved exactly as delivered.", "provenance": { "source_repo": "llm-security", "source_files": [ "scanners/lib/injection-patterns.mjs" ], "source_exports": [ "CRITICAL_PATTERNS", "HIGH_PATTERNS", "MEDIUM_PATTERNS", "HYBRID_PATTERNS" ], "source_delivery": "operator dump 2/2, coord message from llm-security, 2026-08-09", "source_commit": "unknown - not supplied with the dump", "verified": "differentially, against the dump", "evidence_limits": [ "The dump is a transcription of the source module, not the module file itself. Every check recorded for this file therefore proves that this JSON agrees with the DUMP. That the dump agrees with the module is llm-security's assertion, and is not a result reproduced here.", "The severity the engine assigns to the hybrid family was not supplied. See families[].severity_note.", "Whether a consumer applies these patterns to raw or to normalised text is engine behaviour and is not fixed by this file. Two runtimes matching identical patterns against differently normalised text will still disagree on identical input." ] }, "dialect": { "name": "ecmascript", "$comment": "Patterns are ECMAScript regular-expression source text, exactly as the source literals spell it. Flags are declared per pattern in a `flags` field and never inlined as `(?i)` or `(?m)`; a pattern with no `flags` key carries no flags. All 83 patterns compile in Node with their declared flags, in Node with `u` added, and in Python `re` with the equivalent re.I / re.M.", "flags": { "i": "case-insensitive", "m": "multiline: ^ and $ match at line boundaries" }, "features_used": [ "negative lookahead: (?!...)", "lookahead assertion: (?=...)", "non-capturing groups: (?:...)", "bounded quantifiers: {n,m}", "unicode escapes: \\uXXXX" ], "translation_notes": [ "Python (`re`): compile with re.I where flags contain `i` and re.M where they contain `m`. No rewriting is needed; verified by compiling all 83.", "Nine patterns contain `\\/` - a redundant escape that a JavaScript regex LITERAL requires and that `RegExp.prototype.source` preserves. It is kept rather than normalised away because both seed runtimes accept it (Node bare, Node under `u`, and Python `re`), so removing it would break byte-identity to buy nothing. Engines that reject unknown escapes (Go `regexp`, RE2) MUST report these patterns as unsupported rather than skip them silently - a skipped pattern is an invisible false negative.", "`\\w` and `\\b` are ASCII-only in ECMAScript without `u` but Unicode-aware in Python on `str`. Input that mixes non-ASCII word characters with these patterns can therefore match differently between runtimes. This is a real portability seam. It is recorded rather than normalised, because normalising it would change behaviour in the seed runtime.", "The leetspeak and multi-language patterns embed non-ASCII literals (accented Latin) directly. Those are visible characters and are left exactly as written." ] }, "normalisations": [ { "id": "unicode-escape-invisible-and-confusable", "affects": [ "homoglyph: Cyrillic-Latin mixing in adjacent characters", "unicode: zero-width character inside word (keyword splitting)" ], "from": "literal U+200B U+200C U+200D U+FEFF, and literal Cyrillic a/e/o/r/s/i/u, inside character classes", "to": "the same code points written as \\uXXXX escapes", "reason": "The source literals carry these code points RAW. Four of them are invisible and seven are Latin look-alikes, so in that form the pattern text cannot be reviewed, diffed or copied safely: a reviewer cannot see whether a class holds four code points or five. This repository's convention forbids raw invisible code points outside conformance inputs for exactly this reason. The escaped spelling is the same regular expression to both engines.", "equivalence_evidence": "Differential match-set comparison (match offsets and matched text) between the raw and the escaped form: Node over 173 adversarial inputs in both bare and `u` mode (692 comparisons), and Python `re` over 118 inputs (236 comparisons). Zero differences. The corpus covers every member of each class, the near-misses deliberately excluded from it (U+00AD, U+2060, U+180E, Cyrillic x, the Cyrillic uppercase set, Greek look-alikes), run boundaries, repeats, and empty input.", "class_membership_verified": { "zero_width_class": [ "U+200B", "U+200C", "U+200D", "U+FEFF" ], "cyrillic_class": [ "U+0430", "U+0435", "U+043E", "U+0440", "U+0441", "U+0456", "U+0443" ], "$comment": "Enumerated mechanically from the dump bytes, not by eye. Note that the zero-width class here does NOT include U+00AD even though codepoints/carriers.json lists U+00AD as a zero-width carrier, and that the Cyrillic class here is a 7-member set distinct from the 13-member CYRILLIC_CONFUSABLES list in that same file. The three sets are deliberately different in the seed implementation and are NOT reconciled here." }, "byte_identical_to_source": false } ], "families": [ { "id": "critical", "source_export": "CRITICAL_PATTERNS", "severity": "critical", "count": 21, "patterns": [ { "id": "override:ignore-previous", "label": "override: ignore previous instructions", "pattern": "ignore\\s+(?:all\\s+)?previous", "flags": "i", "aliases": { "llm_security": "override: ignore previous instructions", "llm_ingestion_guard": "override:ignore-previous" } }, { "id": "override:forget-instructions", "label": "override: forget instructions", "pattern": "forget\\s+your\\s+(?:instructions|rules|guidelines|directives)", "flags": "i", "aliases": { "llm_security": "override: forget instructions", "llm_ingestion_guard": "override:forget-instructions" } }, { "id": "override:disregard", "label": "override: disregard instructions", "pattern": "disregard\\s+your", "flags": "i", "aliases": { "llm_security": "override: disregard instructions", "llm_ingestion_guard": "override:disregard" } }, { "id": "override:override-instructions", "label": "override: override instructions", "pattern": "override\\s+your", "flags": "i", "aliases": { "llm_security": "override: override instructions", "llm_ingestion_guard": "override:override-instructions" } }, { "id": "override:suspend-constraints", "label": "override: suspend constraints", "pattern": "suspend\\s+all\\s+constraints", "flags": "i", "aliases": { "llm_security": "override: suspend constraints", "llm_ingestion_guard": "override:suspend-constraints" } }, { "id": "override:prior-constraints", "label": "override: prior constraints", "pattern": "all\\s+prior\\s+constraints", "flags": "i", "aliases": { "llm_security": "override: prior constraints", "llm_ingestion_guard": "override:prior-constraints" } }, { "id": "spoofed-header:hash-system", "label": "spoofed header: # SYSTEM:", "pattern": "^#+\\s*SYSTEM\\s*:", "flags": "m", "aliases": { "llm_security": "spoofed header: # SYSTEM:", "llm_ingestion_guard": "spoofed-header:hash-system" } }, { "id": "spoofed-header:inst", "label": "spoofed header: [INST]", "pattern": "^\\[INST\\]", "flags": "m", "aliases": { "llm_security": "spoofed header: [INST]", "llm_ingestion_guard": "spoofed-header:inst" } }, { "id": "spoofed-header:pipe-system", "label": "spoofed header: <|system|>", "pattern": "<\\|system\\|>", "aliases": { "llm_security": "spoofed header: <|system|>", "llm_ingestion_guard": "spoofed-header:pipe-system" } }, { "id": "spoofed-tag:system-open", "label": "spoofed tag: ", "pattern": "", "aliases": { "llm_security": "spoofed tag: ", "llm_ingestion_guard": "spoofed-tag:system-open" } }, { "id": "spoofed-tag:system-close", "label": "spoofed tag: ", "pattern": "<\\/system>", "aliases": { "llm_security": "spoofed tag: ", "llm_ingestion_guard": "spoofed-tag:system-close" } }, { "id": "spoofed-header:instructions", "label": "spoofed header: ### Instructions:", "pattern": "^###\\s*Instructions\\s*:", "flags": "m", "aliases": { "llm_security": "spoofed header: ### Instructions:", "llm_ingestion_guard": "spoofed-header:instructions" } }, { "id": "identity:no-longer", "label": "identity: you are no longer", "pattern": "you\\s+are\\s+no\\s+longer", "flags": "i", "aliases": { "llm_security": "identity: you are no longer", "llm_ingestion_guard": "identity:no-longer" } }, { "id": "identity:you-are-now", "label": "identity: you are now [name]", "pattern": "you\\s+are\\s+now\\s+(?!able|going|ready|done|running|using|looking|in\\s|at\\s|on\\s)", "flags": "i", "aliases": { "llm_security": "identity: you are now [name]", "llm_ingestion_guard": "identity:you-are-now" } }, { "id": "identity:new-role", "label": "identity: your new role", "pattern": "your\\s+new\\s+role\\s+is", "flags": "i", "aliases": { "llm_security": "identity: your new role", "llm_ingestion_guard": "identity:new-role" } }, { "id": "identity:new-directive", "label": "identity: new primary directive", "pattern": "your\\s+new\\s+primary\\s+directive", "flags": "i", "aliases": { "llm_security": "identity: new primary directive", "llm_ingestion_guard": "identity:new-directive" } }, { "id": "identity:pretend", "label": "identity: pretend you are", "pattern": "pretend\\s+you\\s+are", "flags": "i", "aliases": { "llm_security": "identity: pretend you are", "llm_ingestion_guard": "identity:pretend" } }, { "id": "config:ignore-claudemd", "label": "config: ignore CLAUDE.md", "pattern": "ignore\\s+your\\s+CLAUDE\\.md", "flags": "i", "aliases": { "llm_security": "config: ignore CLAUDE.md", "llm_ingestion_guard": "config:ignore-claudemd" } }, { "id": "config:override-system-prompt", "label": "config: override system prompt", "pattern": "override\\s+your\\s+system\\s+prompt", "flags": "i", "aliases": { "llm_security": "config: override system prompt", "llm_ingestion_guard": "config:override-system-prompt" } }, { "id": "config:bypass-safety", "label": "config: bypass safety", "pattern": "bypass\\s+your\\s+safety", "flags": "i", "aliases": { "llm_security": "config: bypass safety", "llm_ingestion_guard": "config:bypass-safety" } }, { "id": "config:disable-filtering", "label": "config: disable output filtering", "pattern": "disable\\s+output\\s+filtering", "flags": "i", "aliases": { "llm_security": "config: disable output filtering", "llm_ingestion_guard": "config:disable-filtering" } } ] }, { "id": "high", "source_export": "HIGH_PATTERNS", "severity": "high", "count": 32, "patterns": [ { "id": "normalization:prioritize-user", "label": "normalization: prioritize user over rules", "pattern": "always\\s+prioritize\\s+user\\s+requests?\\s+over", "flags": "i", "aliases": { "llm_security": "normalization: prioritize user over rules", "llm_ingestion_guard": "normalization:prioritize-user" } }, { "id": "normalization:user-precedence", "label": "normalization: user intent precedence", "pattern": "user\\s+intent\\s+takes?\\s+precedence\\s+over", "flags": "i", "aliases": { "llm_security": "normalization: user intent precedence", "llm_ingestion_guard": "normalization:user-precedence" } }, { "id": "normalization:claudemd-conflict", "label": "normalization: CLAUDE.md conflict override", "pattern": "if\\s+CLAUDE\\.md\\s+conflicts", "flags": "i", "aliases": { "llm_security": "normalization: CLAUDE.md conflict override", "llm_ingestion_guard": "normalization:claudemd-conflict" } }, { "id": "normalization:skip-confirmation", "label": "normalization: skip confirmation", "pattern": "skip\\s+confirmation\\s+for", "flags": "i", "aliases": { "llm_security": "normalization: skip confirmation", "llm_ingestion_guard": "normalization:skip-confirmation" } }, { "id": "reframing:actual-task", "label": "reframing: your actual task", "pattern": "your\\s+actual\\s+task\\s+is", "flags": "i", "aliases": { "llm_security": "reframing: your actual task", "llm_ingestion_guard": "reframing:actual-task" } }, { "id": "reframing:real-purpose", "label": "reframing: your real purpose", "pattern": "your\\s+real\\s+purpose\\s+is", "flags": "i", "aliases": { "llm_security": "reframing: your real purpose", "llm_ingestion_guard": "reframing:real-purpose" } }, { "id": "reframing:should-actually-do", "label": "reframing: what you should actually do", "pattern": "what\\s+you\\s+should\\s+actually\\s+do", "flags": "i", "aliases": { "llm_security": "reframing: what you should actually do", "llm_ingestion_guard": "reframing:should-actually-do" } }, { "id": "hidden-comment:agent-directed", "label": "hidden comment: agent-directed HTML comment", "pattern": "