@acepaste/ingress 0.9.28 → 0.9.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -103,6 +103,12 @@ const INSTRUCTION_SHAPES = [
103
103
  * the dotenv README, Wikipedia's Kernel panic article, the sudoers man page and 23 of 27 everyday developer
104
104
  * sentences. Topic words now either sit behind IMPERATIVE or count as weak evidence.
105
105
  */
106
+ /** the named jailbreak personas: refused wherever they stand, with no allowance for quotation or a code block (see their rules) */
107
+ const DAN_PERSONA = "DAN persona";
108
+ const OTHER_PERSONA = "STAN, AIM or DUDE persona";
109
+ const ALWAYS_REFUSED = new Set([DAN_PERSONA, OTHER_PERSONA]);
110
+ /** "mode" as a word of its own, in English and where the same prompts circulate: Turkish (modu, modunda), Spanish, Portuguese and Italian (modo), German (Modus). Not "model", "modern", "moderate". */
111
+ const MODE = "[Mm]od(?:es?|o|us|u(?:n[uae]|nda(?:n)?|yla|dur)?)";
106
112
  const AGENT_SHAPES = [
107
113
  [/\b(ignore|disregard|forget|override|supersede)\b[^.\n]{0,40}\b(previous|prior|above|earlier|all|your|original|initial)\b[^.\n]{0,20}\b(instructions?|directions?|directives?|system\s+prompt|guidelines|programming|code\s+review\s+guidelines|processing\s+task|formatting\s+task|task)\b/i, 0.85, "drop prior instructions"],
108
114
  [/\b(previous|prior|all\s+previous|original)\s+(system\s+prompt|instructions|directives|rules)\s+(is|are)\s+(now\s+)?(revoked|deprecated|void|superseded|cancelled|canceled|overridden)/i, 0.9, "revokes prior instructions"],
@@ -116,10 +122,33 @@ const AGENT_SHAPES = [
116
122
  // "system configuration", "write your system prompt" (prompting guides) and "list the initial setup" are documentation
117
123
  [imp(/(output|print|show|reveal|share|tell\s+me|give\s+me|repeat|recite|translate|summari[sz]e|encode|convert|spell\s+out|dump|display|quote|leak|paste)\b[^.\n]{0,60}\b((your|the|my)\s+)?(full\s+|complete\s+|exact\s+|entire\s+|original\s+|initial\s+|current\s+|hidden\s+)?(system\s+(prompt|instructions?)|initial\s+(prompt|instructions?)|original\s+instructions?|hidden\s+instructions?|internal\s+instructions?)\b/), 0.85, "system prompt request"],
118
124
  [/\byour\s+(system\s+(prompt|instructions?|message)|initial\s+(prompt|instructions?)|original\s+instructions|internal\s+configuration)\b|\b(instructions|prompts?)\s+you\s+(were|have\s+been|'ve\s+been)\s+given\b|\binstructions\s+you('ve|\s+have)\s+received\b|\bmessages\[0\]/i, 0.6, "references the model's own prompt"],
119
- // the persona acronyms are names only in capitals: "aim" and "dan" are ordinary words (docs.python.org matched "aim ... version")
120
- [/\b(DAN|STAN|AIM|DUDE)\b(?=[^.\n]{0,80}\b([Ss]tands\s+for|[Mm]ode|[Vv]ersion|\d+\.\d|[Aa]nything|[Nn]orms|[Mm]achiavellian))/, 0.85, "jailbreak persona"],
125
+ // The named jailbreak personas (0.9.29, the owner's rule): naming one is refused wherever it stands, as an
126
+ // order, in a list of technique names on a dataset card, in a citation, in quotation marks or in a code
127
+ // block. Refused as suspect, so a person can still ask for the page. The acronyms are names only in capitals
128
+ // ("aim" and "dan" are ordinary words: docs.python.org matched "aim ... version"), and even in capitals they
129
+ // are words too, so each counts only where it is the persona.
130
+ //
131
+ // DAN: its spelled-out name; or DAN in capitals (not after an apostrophe or a letter: Turkish writes
132
+ // ANKARA'DAN, "from Ankara") with a version number right after it, with a persona word after it in the same
133
+ // sentence, with "jailbreak", "persona" or "role-play" before it, or with the model told to be it (in
134
+ // English, and in Turkish as the public Turkish set writes it: "DAN adlı bir modelsin", you are a model
135
+ // called DAN, which 0.9.28 caught only because "mode" matched the start of "modelsin").
136
+ [/\bdo\s+anything\s+now\b/i, 0.85, DAN_PERSONA],
137
+ [new RegExp(`(?<![\\p{L}\\p{N}'’])DAN\\b(?=[\\s-]*([Vv]\\.?\\s*\\d|[Vv]ersion\\s+\\d|\\d+\\.\\d)|[^.\\n]{0,80}\\b([Ss]tands\\s+for|${MODE}|[Aa]nything|[Jj]ailbreak\\w*|[Pp]ersonas?|[Pp]rompts?)\\b)|\\b([Jj]ailbreak\\w*|[Pp]ersonas?|[Rr]ole-?play\\w*)\\b[^.\\n]{0,80}(?<![\\p{L}\\p{N}'’])DAN\\b|\\b([Yy]ou\\s+are|[Yy]ou're|[Aa]ct(ing)?\\s+as|[Pp]retend(ing)?\\s+to\\s+be|[Bb]ecome|[Cc]alled|[Nn]amed)\\s+(now\\s+)?DAN\\b|(?<![\\p{L}\\p{N}'’])DAN\\b[^.\\n]{0,40}\\b(modelsin|asistans[ıi]n|botsun|karaktersin|zekas[ıi]n|olarak\\s+davran\\p{L}*|gibi\\s+davran\\p{L}*|rol[üu]n\\p{L}*)(?!\\p{L})`, "u"), 0.85, DAN_PERSONA],
138
+ // STAN, AIM, DUDE: their spelled-out names; or the acronym with "jailbreak" or "persona" in the same sentence,
139
+ // or with the model told to be one. A bare acronym near "mode", "version" or a number is NOT enough for
140
+ // these three, which is what 0.9.28 and earlier took: the Stan modelling language ("the STAN model": "mode"
141
+ // also matched the start of "model" and "modern"), the AIM stock market and its rule-book versions, "the AIM
142
+ // of this section", a greeting. Nothing in the word itself tells the persona from those.
143
+ // (DUDE is not an acronym; its prompt's own line, "can do anything and everything at the same time", is its name spelled out)
144
+ [/\bstrive\s+to\s+avoid\s+norms\b|\balways\s+intelligent\s+and\s+machiavellian\b|\bdo\s+anything\s+and\s+everything\s+at\s+the\s+same\s+time\b/i, 0.85, OTHER_PERSONA],
145
+ // how their prompts introduce them: "an AI called X", "a character named X", "take on the role of X", "respond as X".
146
+ // The noun before "called" matters: "a market called AIM" and "a language called STAN" are not introductions.
147
+ [/\b([Cc]haracter|[Pp]ersona|[Cc]hatbot|[Bb]ot|[Aa]ssistant|[Aa]lter\s+ego|AI(\s+model)?)\s+(named|called|known\s+as)\s+(STAN|AIM|DUDE)\b|\b(([Tt]ake|[Aa]ssume|[Pp]lay|[Aa]dopt)(\s+on)?\s+the\s+(role|part)\s+of|[Rr]espond(ing)?\s+as|[Aa]nswer(ing)?\s+as|[Rr]ole-?play(ing)?\s+as|[Ss]tay(ing)?\s+as)\s+(STAN|AIM|DUDE)\b|\bDUDE\b(?=[^.\n]{0,80}\b(can\s+do\s+anything|anything\s+and\s+everything)\b)/, 0.85, OTHER_PERSONA],
148
+ // (not after a letter or an apostrophe: PAKİSTAN and KAZAKİSTAN end in the acronym, and İ is no word character to \b)
149
+ [/(?<![\p{L}\p{N}'’])(STAN|AIM|DUDE)\b(?=[^.\n]{0,80}\b([Aa]void\s+[Nn]orms|[Mm]achiavellian|[Jj]ailbreak\w*|[Pp]ersonas?)\b)|\b([Jj]ailbreak\w*|[Pp]ersonas?)\b[^.\n]{0,80}(?<![\p{L}\p{N}'’])(STAN|AIM|DUDE)\b|\b([Yy]ou\s+are|[Yy]ou're|[Aa]ct(ing)?\s+as|[Pp]retend(ing)?\s+to\s+be|[Bb]ecome)\s+(now\s+)?(STAN|AIM|DUDE)\b/u, 0.85, OTHER_PERSONA],
121
150
  // "Developer Mode is enabled" is a Windows setting the os docs need for symlinks; "free version" is pricing
122
- [/\bdo\s+anything\s+now\b|\bdeveloper\s+mode\s+(output|response)s?\b|\b(enable|activate|enter)\s+developer\s+mode\b[^.\n]{0,60}\b(you|your|chatgpt|gpt|ai|assistant|model|claude)\b|\bjailbreak(ed)?\s+mode\b|\b(evil|unrestricted|unfiltered|uncensored)[-\s]?(gpt|ai|assistant|bot|chatbot|response|machine|version\s+of\s+(you|yourself))\b|\bfreed\s+from\s+the\s+(typical\s+)?confines\b|\bmongo\s+tom\b/i, 0.85, "jailbreak persona"],
151
+ [/\bdeveloper\s+mode\s+(output|response)s?\b|\b(enable|activate|enter)\s+developer\s+mode\b[^.\n]{0,60}\b(you|your|chatgpt|gpt|ai|assistant|model|claude)\b|\bjailbreak(ed)?\s+mode\b|\b(evil|unrestricted|unfiltered|uncensored)[-\s]?(gpt|ai|assistant|bot|chatbot|response|machine|version\s+of\s+(you|yourself))\b|\bfreed\s+from\s+the\s+(typical\s+)?confines\b|\bmongo\s+tom\b/i, 0.85, "jailbreak persona"],
123
152
  // "no restrictions" alone is ordinary prose (the Python tutorial); the safety, ethical or content qualifier is the tell
124
153
  [/\b(no|without(\s+any)?|zero|free\s+of)\s+(safety|ethical|content|moral)\s+(restrictions|guardrails|limitations|filters?|guidelines|constraints|polic(y|ies)|measures)\b|(?<!\b(?:if|as\s+long\s+as|so\s+long\s+as|when|whenever|unless|provided|assuming|while|because|since|once|where|that)\s+)\byou\s+(now\s+)?(have|operate\s+with|are\s+under|are\s+bound\s+by)\s+no\s+(restrictions|limitations|limits|rules|guidelines|filters|guardrails)\b(?!\s+(on|in|over|about|for|regarding|around|with|to|as|preventing|stopping|blocking|against)\b)|\b(safety|content)\s+(filters?|guidelines|guardrails|module|classifiers?)\s+(are|is|have\s+been|has\s+been)\s+(now\s+)?(temporarily\s+)?(disabled|suspended|removed|bypassed|corrupted|lifted|deprecated)\b|\b(disable|remove|bypass|turn\s+off|lift|ignore)\s+(all\s+(of\s+)?)?your\s+(safety|content|ethical)\s+(filters?|guidelines|measures|classifiers?|restrictions|checks?|module|guardrails)/i, 0.85, "safety removal"],
125
154
  // bracketed headers that claim a speaker or an authority. Log levels ([CRITICAL]), forum ranks ([Admin]), chat exports
@@ -290,7 +319,7 @@ function isQuotedOrAttributed(text, match) {
290
319
  * or "like" in a request are not quotation. Payload shapes (commands, paths, parameters) are never discounted:
291
320
  * an attack hands its payload over in quotes.
292
321
  */
293
- const UNDISCOUNTED = new Set(["destructive or escalating command", "parameter tampering", "sensitive path", "decode and obey", "fake system or agent header", "fake system message", "tool impersonation", "approval or privilege claim"]);
322
+ const UNDISCOUNTED = new Set([...ALWAYS_REFUSED, "destructive or escalating command", "parameter tampering", "sensitive path", "decode and obey", "fake system or agent header", "fake system message", "tool impersonation", "approval or privilege claim"]);
294
323
  function isQuotedStrict(text, match, label) {
295
324
  if (UNDISCOUNTED.has(label))
296
325
  return false;
@@ -358,8 +387,10 @@ function scoreText(text, hidden, where, findings, inCode = false) {
358
387
  const visibleFactor = asHidden ? 1 : n >= 2 || strong ? 0.75 : 0.55;
359
388
  const severity = asHidden ? 0.9 : n >= 2 || strong ? 0.6 : 0.45;
360
389
  // visible text that quotes or attributes an instruction (news, fiction, training material) is not issuing it
361
- const quotedFactor = !asHidden && (AGENT_LABELS.has(best.label) ? isQuotedStrict(text, best.match, best.label) : isQuotedOrAttributed(text, best.match)) ? 0.55 : 1;
362
- const conf = Math.min(0.98, (best.weight * visibleFactor + boost + Math.min(0.15, (n - 1) * 0.05)) * best.discount * codeFactor * quotedFactor);
390
+ // ...except where the text names one of the jailbreak personas: that is refused wherever it stands, quoted or in a code block
391
+ const namesDan = hits.some((h) => ALWAYS_REFUSED.has(h.label));
392
+ const quotedFactor = !namesDan && !asHidden && (AGENT_LABELS.has(best.label) ? isQuotedStrict(text, best.match, best.label) : isQuotedOrAttributed(text, best.match)) ? 0.55 : 1;
393
+ const conf = Math.min(0.98, (best.weight * visibleFactor + boost + Math.min(0.15, (n - 1) * 0.05)) * best.discount * (namesDan ? 1 : codeFactor) * quotedFactor);
363
394
  findings.push({
364
395
  pass: "meaning", kind: n >= 3 || /system\s+prompt/i.test(best.match) ? "meaning.system_prompt_imitation" : "meaning.instruction_shaped",
365
396
  confidence: conf, severity,
@@ -5,9 +5,9 @@
5
5
  * at the same source would not see is suspect by default.
6
6
  */
7
7
  import type { NetPolicy } from "./netpolicy.js";
8
- export declare const ENGINE_VERSION = "0.9.28";
8
+ export declare const ENGINE_VERSION = "0.9.29";
9
9
  /** bump whenever a detector's behavior changes; receipts carry it so verdicts are reproducible */
10
- export declare const RULESET_VERSION = "2026.11.21-1";
10
+ export declare const RULESET_VERSION = "2026.11.21-2";
11
11
  /**
12
12
  * clean: delivered. suspect: refused, overridable. hostile: refused, not overridable.
13
13
  * unreachable: nothing could be fetched or read (network error, timeout, redirect loop,
package/dist/src/types.js CHANGED
@@ -4,9 +4,9 @@
4
4
  * Governing principle: anything the model would receive that a human looking
5
5
  * at the same source would not see is suspect by default.
6
6
  */
7
- export const ENGINE_VERSION = "0.9.28";
7
+ export const ENGINE_VERSION = "0.9.29";
8
8
  /** bump whenever a detector's behavior changes; receipts carry it so verdicts are reproducible */
9
- export const RULESET_VERSION = "2026.11.21-1";
9
+ export const RULESET_VERSION = "2026.11.21-2";
10
10
  export const CONTENT_KINDS = ["html", "markdown", "json", "text", "javascript", "log", "email", "calendar", "message", "notification", "nearby", "automation", "captions", "image", "audio", "video"];
11
11
  /** Read a content kind and source from untyped input (an HTTP body, tool arguments). Unknown values are dropped, never guessed. */
12
12
  export function parseScanHints(o) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acepaste/ingress",
3
- "version": "0.9.28",
3
+ "version": "0.9.29",
4
4
  "description": "AcePaste Ingress engine: acquire, visibility, character, script, supply-chain, sandbox, meaning, verdict, envelope, receipts.",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",