ambitry 0.1.1 → 0.1.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/dist/cli.js +8 -0
- package/dist/viewer.js +7 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
|
+
import { rmSync } from 'node:fs';
|
|
3
4
|
import { Store } from "./db.js";
|
|
4
5
|
import { Controls, loadPolicy } from "./policy.js";
|
|
5
6
|
import { createServer } from "./server.js";
|
|
@@ -67,6 +68,13 @@ function main(argv) {
|
|
|
67
68
|
const port = Number(flag(argv, 'port') ?? 8787);
|
|
68
69
|
// Demo traffic goes to its own file so it never mixes with real traces.
|
|
69
70
|
const dbPath = resolve(flag(argv, 'db') ?? (demo ? 'ambitry-demo.db' : 'ambitry.db'));
|
|
71
|
+
// Each demo run starts clean. Otherwise a second run doubles every number
|
|
72
|
+
// on the dashboard, which is confusing on its own and useless to record.
|
|
73
|
+
if (demo) {
|
|
74
|
+
for (const suffix of ['', '-journal', '-wal', '-shm']) {
|
|
75
|
+
rmSync(`${dbPath}${suffix}`, { force: true });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
70
78
|
const policyPath = resolve(flag(argv, 'policy') ?? 'ambitry.json');
|
|
71
79
|
let controls;
|
|
72
80
|
try {
|
package/dist/viewer.js
CHANGED
|
@@ -125,9 +125,14 @@ async function refresh() {
|
|
|
125
125
|
// The headline. What people came for is "am I leaking anything", and the
|
|
126
126
|
// answer belongs above the fold, not inside a trace nobody opens.
|
|
127
127
|
const f = status.findings || [];
|
|
128
|
+
const total = f.reduce((n, x) => n + x.occurrences, 0);
|
|
129
|
+
// "Credentials" only when they all are. An email address is personal data,
|
|
130
|
+
// not a credential, and this line is the first thing anyone reads — the
|
|
131
|
+
// whole positioning rests on not overstating.
|
|
132
|
+
const allCreds = f.every(x => x.severity === 'critical');
|
|
133
|
+
const noun = allCreds ? 'credential' : 'sensitive value';
|
|
128
134
|
$('alert').innerHTML = !f.length ? '' :
|
|
129
|
-
'<div class="alert"><h3>' +
|
|
130
|
-
' credential' + (f.reduce((n, x) => n + x.occurrences, 0) === 1 ? '' : 's') +
|
|
135
|
+
'<div class="alert"><h3>' + total + ' ' + noun + (total === 1 ? '' : 's') +
|
|
131
136
|
' sent to your model provider</h3>' +
|
|
132
137
|
'<p>Found in outgoing prompts over the last 7 days. The finding keeps only a masked preview — ' +
|
|
133
138
|
'but the prompt itself is in your local trace file, so treat that file as sensitive.</p>' +
|