averecion-lite 1.3.8 → 1.4.0
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.
- package/dashboard/dash.js +10 -1
- package/dist/log-watcher.d.ts.map +1 -1
- package/dist/log-watcher.js +10 -3
- package/dist/storage.js +1 -1
- package/package.json +1 -1
package/dashboard/dash.js
CHANGED
|
@@ -152,12 +152,21 @@
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
+
const FRIENDLY_TOOLS = {
|
|
156
|
+
"whatsapp-inbound": "received a WhatsApp message",
|
|
157
|
+
"whatsapp-reply": "sent a WhatsApp reply",
|
|
158
|
+
"whatsapp-processing": "processed a WhatsApp message",
|
|
159
|
+
"whatsapp-gateway": "WhatsApp gateway activity",
|
|
160
|
+
"whatsapp-reconnect": "reconnected to WhatsApp",
|
|
161
|
+
};
|
|
162
|
+
|
|
155
163
|
function friendlyAction(event) {
|
|
156
164
|
const tool = event.tool || "action";
|
|
157
165
|
const reason = event.reason || "";
|
|
166
|
+
const friendlyTool = FRIENDLY_TOOLS[tool] || tool;
|
|
158
167
|
|
|
159
168
|
if (event.decision === "approved") {
|
|
160
|
-
return { icon: "✓", class: "approved", text: `Your bot used ${tool}`, context: null };
|
|
169
|
+
return { icon: "✓", class: "approved", text: FRIENDLY_TOOLS[tool] ? `Bot ${friendlyTool}` : `Your bot used ${tool}`, context: null };
|
|
161
170
|
}
|
|
162
171
|
if (event.decision === "blocked") {
|
|
163
172
|
let context = THREAT_CONTEXT[tool] || null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-watcher.d.ts","sourceRoot":"","sources":["../log-watcher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"log-watcher.d.ts","sourceRoot":"","sources":["../log-watcher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAmDtC,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,YAAY,CAA+B;;IAMnD,KAAK,IAAI,IAAI;IAUb,IAAI,IAAI,IAAI;IAWZ,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,SAAS;IAuCjB,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,YAAY;IA+BpB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,YAAY;IAmMpB,OAAO,CAAC,eAAe;IAuCvB,OAAO,CAAC,eAAe;IA6BvB,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,gBAAgB;CAWzB;AAID,wBAAgB,eAAe,IAAI,UAAU,CAM5C;AAED,wBAAgB,cAAc,IAAI,IAAI,CAKrC;AAED,wBAAgB,aAAa,IAAI,UAAU,GAAG,IAAI,CAEjD"}
|
package/dist/log-watcher.js
CHANGED
|
@@ -46,12 +46,18 @@ const DANGEROUS_PATTERNS = [
|
|
|
46
46
|
];
|
|
47
47
|
const INJECTION_PATTERNS = [
|
|
48
48
|
{ pattern: /ignore\s+(all\s+)?(previous|prior|above)\s+(instructions?|prompts?)/i, reason: "Prompt injection: ignore instructions" },
|
|
49
|
+
{ pattern: /ignore\s+(previous|prior|all)\s+instructions/i, reason: "Prompt injection: ignore instructions" },
|
|
49
50
|
{ pattern: /disregard\s+(all\s+)?(previous|prior|above)/i, reason: "Prompt injection: disregard" },
|
|
50
|
-
{ pattern: /
|
|
51
|
+
{ pattern: /forget\s+(your|all|the)\s+(rules?|instructions?|guidelines?|restrictions?)/i, reason: "Prompt injection: forget rules" },
|
|
52
|
+
{ pattern: /you\s+are\s+now\s+(a|an|un)\s*/i, reason: "Prompt injection: role override" },
|
|
51
53
|
{ pattern: /jailbreak/i, reason: "Prompt injection: jailbreak attempt" },
|
|
52
54
|
{ pattern: /DAN\s*mode/i, reason: "Prompt injection: DAN mode" },
|
|
53
55
|
{ pattern: /pretend\s+(you'?re?|to\s+be)\s+/i, reason: "Prompt injection: pretend" },
|
|
54
|
-
{ pattern: /bypass\s+(your\s+)?(restrictions?|rules?|guidelines?)/i, reason: "Prompt injection: bypass" },
|
|
56
|
+
{ pattern: /bypass\s+(your\s+)?(restrictions?|rules?|guidelines?|safety|filters?)/i, reason: "Prompt injection: bypass" },
|
|
57
|
+
{ pattern: /override\s+(all\s+)?(safety|security|rules?|filters?)/i, reason: "Prompt injection: override safety" },
|
|
58
|
+
{ pattern: /SYSTEM:\s*/i, reason: "Prompt injection: fake system prompt" },
|
|
59
|
+
{ pattern: /send\s+(all\s+)?(contacts?|messages?|data|files?|info)\s+to/i, reason: "Prompt injection: data exfiltration" },
|
|
60
|
+
{ pattern: /delete\s+everything/i, reason: "Prompt injection: destructive command" },
|
|
55
61
|
];
|
|
56
62
|
class LogWatcher extends events_1.EventEmitter {
|
|
57
63
|
watchedFile = null;
|
|
@@ -423,7 +429,8 @@ class LogWatcher extends events_1.EventEmitter {
|
|
|
423
429
|
}
|
|
424
430
|
}
|
|
425
431
|
analyzeDanger(event) {
|
|
426
|
-
|
|
432
|
+
const scanTools = ["exec", "whatsapp-inbound", "whatsapp-reply", "whatsapp-processing", "whatsapp-gateway"];
|
|
433
|
+
if (!scanTools.includes(event.tool)) {
|
|
427
434
|
return { dangerous: false, reason: "" };
|
|
428
435
|
}
|
|
429
436
|
const argsStr = JSON.stringify(event.args || {}).toLowerCase();
|
package/dist/storage.js
CHANGED
|
@@ -91,7 +91,7 @@ function getEvents(hoursBack = 24) {
|
|
|
91
91
|
return loadLogsFromJsonl().filter(e => e.ts >= cutoff);
|
|
92
92
|
}
|
|
93
93
|
function getLastEvents(count = 10) {
|
|
94
|
-
return loadLogsFromJsonl().slice(-count);
|
|
94
|
+
return loadLogsFromJsonl().slice(-count).reverse();
|
|
95
95
|
}
|
|
96
96
|
function getConfig() {
|
|
97
97
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "averecion-lite",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Real-time AI agent monitoring - watches logs, detects dangerous commands and prompt injection attempts",
|
|
5
5
|
"author": "Averecion <hello@averecion.com>",
|
|
6
6
|
"homepage": "https://github.com/averecion/clawguard#readme",
|