@acepaste/ingress 0.9.0 → 0.9.1

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.
@@ -32,6 +32,9 @@ const CONFUSABLE = {
32
32
  "Ν": "N", "Ο": "O", "Ρ": "P", "Τ": "T", "Υ": "Y", "Χ": "X", "ο": "o",
33
33
  "А": "A", "В": "B", "Е": "E", "К": "K", "М": "M", "Н": "H", "О": "O",
34
34
  "Р": "P", "С": "C", "Т": "T", "Х": "X",
35
+ // lower-case Greek and further Cyrillic letters that pass for Latin in most fonts
36
+ "α": "a", "ι": "i", "κ": "k", "ν": "v", "ρ": "p", "υ": "u", "ϲ": "c", "ϳ": "j",
37
+ "ԝ": "w", "ѵ": "v", "ӏ": "l", "ԍ": "G", "Ꮪ": "S",
35
38
  };
36
39
  function excerptAround(text, idx, span = 40) {
37
40
  return text.slice(Math.max(0, idx - span), idx + span).replace(/[\p{Cf}\p{Mn}]/gu, "�");
@@ -221,8 +224,10 @@ export function scanCharacters(text) {
221
224
  decodedPayloads.push(decoded);
222
225
  cleaned = cleaned.replace(/(?:[︀-️]|[\u{E0100}-\u{E01EF}]){4,}/gu, "");
223
226
  }
224
- // 5. Mixed-script words: Latin letters sharing a word with letters of another script. Legitimate text does this rarely
225
- // (brand names, transliteration glosses); injection spelled with look-alikes does it in every keyword.
227
+ // 5. Mixed-script words: Latin letters sharing a word with letters of another script that render like Latin
228
+ // (іgnore with a Cyrillic і). Injection spelled with look-alikes does it in every keyword. A non-Latin letter
229
+ // that looks like no Latin letter (the Ψ in a brand like Ψfiles, a transliteration gloss) spoofs nothing,
230
+ // so only letters in the CONFUSABLE table count.
226
231
  const words = cleaned.match(/[\p{L}\p{M}]{3,}/gu) ?? [];
227
232
  let confusableWords = 0;
228
233
  let sample = "";
@@ -230,8 +235,8 @@ export function scanCharacters(text) {
230
235
  const hasLatin = /\p{Script=Latin}/u.test(w);
231
236
  if (!hasLatin)
232
237
  continue;
233
- const hasOther = /[^\p{Script=Latin}\p{Script=Common}\p{Script=Inherited}]/u.test(w);
234
- if (hasOther) {
238
+ const lookalike = [...w].some((c) => c in CONFUSABLE);
239
+ if (lookalike) {
235
240
  confusableWords++;
236
241
  if (!sample)
237
242
  sample = w;
@@ -231,7 +231,9 @@ export class IngressEngine {
231
231
  if (++opens > 400000)
232
232
  return "more than 400000 tags";
233
233
  if (m[2].length > 2000) {
234
- const n = (m[2].match(/\s[\w:.-]+(=|\s|$)/g) ?? []).length;
234
+ // count attribute names, not words inside quoted values: a long SVG path or a JSON props blob is one attribute
235
+ const names = m[2].replace(/"[^"]*"|'[^']*'/g, '""');
236
+ const n = (names.match(/\s[\w:.-]+(=|\s|$)/g) ?? []).length;
235
237
  if (n > 300)
236
238
  return `element with ${n} attributes`;
237
239
  attrs += n;
@@ -42,7 +42,9 @@ const TOOL_CALL_SHAPES = [
42
42
  const INSTRUCTION_SHAPES = [
43
43
  [/\bignore\s+(all\s+|any\s+)?(previous|prior|above|earlier|preceding)\s+(instructions?|prompts?|directions?|rules?|context)/i, 0.9, "ignore previous instructions"],
44
44
  [/\bdisregard\s+(all\s+|any\s+)?(previous|prior|above|your)\s+(instructions?|prompts?|rules?|guidelines?)/i, 0.9, "disregard instructions"],
45
- [/\b(you\s+are\s+now|from\s+now\s+on\s+you\s+(are|will|must))\b/i, 0.6, "role reassignment"],
45
+ // "you are now" + a role, a mode or a loosened state. Not a clause ("where you are now"), not UI copy ("you are now logged in").
46
+ [/(?<!\b(?:where|what|who|how|when|which|whether|if|that|than|as|while|because|since|until|once|wherever)\s+)\byou\s+are\s+now\s+(a|an|the|my|our|acting|operating|playing|role-?playing|pretending|free|unrestricted|unfiltered|uncensored|unbound|jailbroken|dan|no\s+longer|in\s+(\w+\s+)?(mode|character|role))\b/i, 0.6, "role reassignment"],
47
+ [/\bfrom\s+now\s+on\s+you\s+(are|will|must)\b/i, 0.6, "role reassignment"],
46
48
  [/\bnew\s+(instructions?|task|directive|system\s+prompt)\s*:/i, 0.7, "new instructions directive"],
47
49
  [/\b(do\s+not|don'?t|never)\s+(tell|inform|reveal|mention|show|disclose)\s+(this\s+to\s+)?(the\s+)?(user|human|operator)/i, 0.95, "conceal from user"],
48
50
  [/\b(ai|assistant|language\s+model|llm|agent|chatbot|copilot|claude|gpt|gemini)\b[^.\n]{0,60}\b(must|should|need\s+to|is\s+required\s+to|has\s+to)\b/i, 0.55, "addressed to the model"],
@@ -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.0";
8
+ export declare const ENGINE_VERSION = "0.9.1";
9
9
  /** bump whenever a detector's behavior changes; receipts carry it so verdicts are reproducible */
10
- export declare const RULESET_VERSION = "2026.11.03-2";
10
+ export declare const RULESET_VERSION = "2026.11.16-1";
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.0";
7
+ export const ENGINE_VERSION = "0.9.1";
8
8
  /** bump whenever a detector's behavior changes; receipts carry it so verdicts are reproducible */
9
- export const RULESET_VERSION = "2026.11.03-2";
9
+ export const RULESET_VERSION = "2026.11.16-1";
10
10
  export const DEFAULT_CONFIG = {
11
11
  hostileThreshold: 0.7,
12
12
  suspectThreshold: 0.25,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acepaste/ingress",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
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",