averecion-lite 1.4.0 → 1.4.2
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.css +12 -0
- package/dashboard/dash.js +28 -6
- package/dashboard/index.html +6 -2
- package/dist/metrics.d.ts +1 -0
- package/dist/metrics.d.ts.map +1 -1
- package/dist/metrics.js +5 -2
- package/package.json +1 -1
package/dashboard/dash.css
CHANGED
|
@@ -411,6 +411,10 @@ body {
|
|
|
411
411
|
color: var(--warning);
|
|
412
412
|
}
|
|
413
413
|
|
|
414
|
+
.stat-value.attack {
|
|
415
|
+
color: #9333ea;
|
|
416
|
+
}
|
|
417
|
+
|
|
414
418
|
.stat-label {
|
|
415
419
|
font-size: 0.8rem;
|
|
416
420
|
color: var(--text-muted);
|
|
@@ -558,6 +562,14 @@ body {
|
|
|
558
562
|
.legend-dot.blocked { background: var(--danger); }
|
|
559
563
|
.legend-dot.attack { background: #9333ea; }
|
|
560
564
|
|
|
565
|
+
.legend-count {
|
|
566
|
+
font-weight: 700;
|
|
567
|
+
font-size: 0.85rem;
|
|
568
|
+
color: var(--text-primary);
|
|
569
|
+
min-width: 1.2rem;
|
|
570
|
+
text-align: center;
|
|
571
|
+
}
|
|
572
|
+
|
|
561
573
|
.legend-help {
|
|
562
574
|
width: 16px;
|
|
563
575
|
height: 16px;
|
package/dashboard/dash.js
CHANGED
|
@@ -87,7 +87,19 @@
|
|
|
87
87
|
"promptInjection": {
|
|
88
88
|
title: "Prompt Injection Detected!",
|
|
89
89
|
desc: "An attacker tried to manipulate your AI by hiding instructions in data. This is a known attack vector."
|
|
90
|
-
}
|
|
90
|
+
},
|
|
91
|
+
"whatsapp-inbound": {
|
|
92
|
+
title: "Dangerous Message Received",
|
|
93
|
+
desc: "An incoming WhatsApp message contained a dangerous command or attack pattern."
|
|
94
|
+
},
|
|
95
|
+
"whatsapp-processing": {
|
|
96
|
+
title: "Dangerous Content Detected",
|
|
97
|
+
desc: "A WhatsApp message being processed contained dangerous commands or prompt injection."
|
|
98
|
+
},
|
|
99
|
+
"whatsapp-reply": {
|
|
100
|
+
title: "Suspicious Reply Flagged",
|
|
101
|
+
desc: "A bot reply contained content that matched a dangerous pattern."
|
|
102
|
+
},
|
|
91
103
|
};
|
|
92
104
|
|
|
93
105
|
function showScreen(name) {
|
|
@@ -170,14 +182,15 @@
|
|
|
170
182
|
}
|
|
171
183
|
if (event.decision === "blocked") {
|
|
172
184
|
let context = THREAT_CONTEXT[tool] || null;
|
|
173
|
-
if (reason.includes("promptInjection")) {
|
|
185
|
+
if (reason.includes("promptInjection") || reason.includes("Prompt injection")) {
|
|
174
186
|
context = THREAT_CONTEXT.promptInjection;
|
|
175
187
|
return { icon: "🛡️", class: "blocked attack", text: `Caught attack: Prompt injection attempt`, context, isAttack: true };
|
|
176
188
|
}
|
|
189
|
+
const dangerLabel = FRIENDLY_TOOLS[tool] ? `Flagged: ${friendlyTool}` : `Blocked risky action: ${tool}`;
|
|
177
190
|
if (reason.includes("highRisk")) {
|
|
178
|
-
return { icon: "⚠️", class: "blocked", text:
|
|
191
|
+
return { icon: "⚠️", class: "blocked", text: dangerLabel, context };
|
|
179
192
|
}
|
|
180
|
-
return { icon: "
|
|
193
|
+
return { icon: "⚠️", class: "blocked", text: FRIENDLY_TOOLS[tool] ? `Flagged dangerous content in WhatsApp` : `Blocked: ${tool}`, context };
|
|
181
194
|
}
|
|
182
195
|
if (event.decision === "manual") {
|
|
183
196
|
return { icon: "👆", class: "manual", text: `You approved ${tool}`, context: null };
|
|
@@ -198,8 +211,17 @@
|
|
|
198
211
|
|
|
199
212
|
function updateDashboard(metrics) {
|
|
200
213
|
document.getElementById("stat-approved").textContent = metrics.kpis.approved || 0;
|
|
201
|
-
document.getElementById("stat-blocked").textContent = metrics.kpis.
|
|
202
|
-
document.getElementById("stat-manual").textContent = metrics.kpis.
|
|
214
|
+
document.getElementById("stat-blocked").textContent = metrics.kpis.dangerDetected || 0;
|
|
215
|
+
document.getElementById("stat-manual").textContent = metrics.kpis.promptInjectionDetected || 0;
|
|
216
|
+
|
|
217
|
+
const legendSafe = document.getElementById("legend-safe");
|
|
218
|
+
const legendReviewed = document.getElementById("legend-reviewed");
|
|
219
|
+
const legendFlagged = document.getElementById("legend-flagged");
|
|
220
|
+
const legendAttack = document.getElementById("legend-attack");
|
|
221
|
+
if (legendSafe) legendSafe.textContent = metrics.kpis.approved || 0;
|
|
222
|
+
if (legendReviewed) legendReviewed.textContent = metrics.kpis.manualApproved || 0;
|
|
223
|
+
if (legendFlagged) legendFlagged.textContent = metrics.kpis.dangerDetected || 0;
|
|
224
|
+
if (legendAttack) legendAttack.textContent = metrics.kpis.promptInjectionDetected || 0;
|
|
203
225
|
|
|
204
226
|
const globalStatus = document.getElementById("global-status");
|
|
205
227
|
if (metrics.kpis.blocked > 5 || metrics.kpis.promptInjectionDetected > 0) {
|
package/dashboard/index.html
CHANGED
|
@@ -121,21 +121,25 @@
|
|
|
121
121
|
<div class="legend-item">
|
|
122
122
|
<span class="legend-dot safe"></span>
|
|
123
123
|
<span>Safe</span>
|
|
124
|
+
<span class="legend-count" id="legend-safe">0</span>
|
|
124
125
|
<span class="legend-help" data-tooltip="Action was approved - no issues detected">?</span>
|
|
125
126
|
</div>
|
|
126
127
|
<div class="legend-item">
|
|
127
128
|
<span class="legend-dot manual"></span>
|
|
128
129
|
<span>Reviewed</span>
|
|
130
|
+
<span class="legend-count" id="legend-reviewed">0</span>
|
|
129
131
|
<span class="legend-help" data-tooltip="An action you reviewed in the activity log">?</span>
|
|
130
132
|
</div>
|
|
131
133
|
<div class="legend-item">
|
|
132
134
|
<span class="legend-dot blocked"></span>
|
|
133
135
|
<span>Flagged</span>
|
|
136
|
+
<span class="legend-count" id="legend-flagged">0</span>
|
|
134
137
|
<span class="legend-help" data-tooltip="Dangerous action was detected and flagged">?</span>
|
|
135
138
|
</div>
|
|
136
139
|
<div class="legend-item">
|
|
137
140
|
<span class="legend-dot attack"></span>
|
|
138
141
|
<span>Caught Attack</span>
|
|
142
|
+
<span class="legend-count" id="legend-attack">0</span>
|
|
139
143
|
<span class="legend-help" data-tooltip="Prompt injection attempt was detected">?</span>
|
|
140
144
|
</div>
|
|
141
145
|
</div>
|
|
@@ -245,8 +249,8 @@
|
|
|
245
249
|
<span class="stat-label">Flagged</span>
|
|
246
250
|
</div>
|
|
247
251
|
<div class="stat">
|
|
248
|
-
<span class="stat-value" id="stat-manual">0</span>
|
|
249
|
-
<span class="stat-label">
|
|
252
|
+
<span class="stat-value attack" id="stat-manual">0</span>
|
|
253
|
+
<span class="stat-label">Attacks</span>
|
|
250
254
|
</div>
|
|
251
255
|
</div>
|
|
252
256
|
</div>
|
package/dist/metrics.d.ts
CHANGED
package/dist/metrics.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,WAAW,EAAkC,MAAM,WAAW,CAAC;AAElG,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,kBAAkB,EAAE,MAAM,CAAC;QAAC,uBAAuB,EAAE,MAAM,CAAA;KAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,WAAW,EAAkC,MAAM,WAAW,CAAC;AAElG,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,kBAAkB,EAAE,MAAM,CAAC;QAAC,uBAAuB,EAAE,MAAM,CAAC;QAAC,cAAc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/metrics.js
CHANGED
|
@@ -7,7 +7,7 @@ const session = { approved: 0, blocked: 0, manualApproved: 0, highRiskIntercepts
|
|
|
7
7
|
function incrementMetric(k) { session[k]++; }
|
|
8
8
|
function getMetrics(hoursBack = 24) {
|
|
9
9
|
const events = (0, storage_1.getEvents)(hoursBack);
|
|
10
|
-
const kpis = { approved: 0, blocked: 0, manualApproved: 0, highRiskIntercepts: 0, promptInjectionDetected: 0 };
|
|
10
|
+
const kpis = { approved: 0, blocked: 0, manualApproved: 0, highRiskIntercepts: 0, promptInjectionDetected: 0, dangerDetected: 0 };
|
|
11
11
|
const egressCounts = {};
|
|
12
12
|
const trusted = new Set(), unknownBlocked = new Set();
|
|
13
13
|
for (const e of events) {
|
|
@@ -21,8 +21,11 @@ function getMetrics(hoursBack = 24) {
|
|
|
21
21
|
}
|
|
22
22
|
if (e.reason.includes("highRisk"))
|
|
23
23
|
kpis.highRiskIntercepts++;
|
|
24
|
-
|
|
24
|
+
const isInjection = e.reason.includes("promptInjection") || e.reason.includes("Prompt injection");
|
|
25
|
+
if (isInjection)
|
|
25
26
|
kpis.promptInjectionDetected++;
|
|
27
|
+
if (e.decision === "blocked" && !isInjection)
|
|
28
|
+
kpis.dangerDetected++;
|
|
26
29
|
if (e.decision !== "blocked")
|
|
27
30
|
trusted.add(e.tool);
|
|
28
31
|
if (e.decision === "blocked" && e.reason === "unknownSkill")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "averecion-lite",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
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",
|