averecion-lite 1.4.1 → 1.4.3
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 +15 -3
- 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
|
@@ -211,11 +211,23 @@
|
|
|
211
211
|
|
|
212
212
|
function updateDashboard(metrics) {
|
|
213
213
|
document.getElementById("stat-approved").textContent = metrics.kpis.approved || 0;
|
|
214
|
-
document.getElementById("stat-blocked").textContent = metrics.kpis.
|
|
215
|
-
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;
|
|
216
225
|
|
|
217
226
|
const globalStatus = document.getElementById("global-status");
|
|
218
|
-
if (metrics.kpis.
|
|
227
|
+
if (metrics.kpis.promptInjectionDetected > 0) {
|
|
228
|
+
globalStatus.textContent = "🛡️ Attack Detected";
|
|
229
|
+
globalStatus.className = "status-badge warning";
|
|
230
|
+
} else if (metrics.kpis.dangerDetected > 0) {
|
|
219
231
|
globalStatus.textContent = "⚠️ Needs Attention";
|
|
220
232
|
globalStatus.className = "status-badge warning";
|
|
221
233
|
} else {
|
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,E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gB,eAAe,CAAC,CAAC,EAAE,MAAM,OAAO,OAAO,QAAmB;AAE1E,wBAAgB,UAAU,CAAC,SAAS,SAAK,GAAG,WAAW,CA4CtD"}
|
package/dist/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.3",
|
|
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",
|