@olurabian/audit 0.1.0 → 0.1.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.
- package/dist/score.js +12 -4
- package/package.json +1 -1
package/dist/score.js
CHANGED
|
@@ -357,6 +357,14 @@ function openness(verdicts, dims, exposedIf, partialIf) {
|
|
|
357
357
|
return "closed";
|
|
358
358
|
return "unknown";
|
|
359
359
|
}
|
|
360
|
+
/** "a", "a and b", "a, b, and c". Three clauses need the commas to read. */
|
|
361
|
+
function joinAnd(parts) {
|
|
362
|
+
if (parts.length <= 1)
|
|
363
|
+
return parts.join("");
|
|
364
|
+
if (parts.length === 2)
|
|
365
|
+
return `${parts[0]} and ${parts[1]}`;
|
|
366
|
+
return `${parts.slice(0, -1).join(", ")}, and ${parts[parts.length - 1]}`;
|
|
367
|
+
}
|
|
360
368
|
function cap1(s) {
|
|
361
369
|
return s.length ? s.charAt(0).toUpperCase() + s.slice(1) : s;
|
|
362
370
|
}
|
|
@@ -426,8 +434,8 @@ export function score(rawIntake) {
|
|
|
426
434
|
misdirectionClauses.push("the agent approves its own requests");
|
|
427
435
|
if (approvalNoneBound)
|
|
428
436
|
misdirectionClauses.push("large spends execute against bound grants without a person");
|
|
429
|
-
const forgerySentence = forgeryClauses.length ? `${cap1(forgeryClauses
|
|
430
|
-
const misdirectionSentence = misdirectionClauses.length ? `${cap1(misdirectionClauses
|
|
437
|
+
const forgerySentence = forgeryClauses.length ? `${cap1(joinAnd(forgeryClauses))}, so a poisoned instruction can forge a spend.` : undefined;
|
|
438
|
+
const misdirectionSentence = misdirectionClauses.length ? `${cap1(joinAnd(misdirectionClauses))}, so the agent can misdirect a spend it is allowed to request.` : undefined;
|
|
431
439
|
let why;
|
|
432
440
|
if (forgerySentence && misdirectionSentence)
|
|
433
441
|
why = `${forgerySentence} ${misdirectionSentence}`;
|
|
@@ -442,8 +450,8 @@ export function score(rawIntake) {
|
|
|
442
450
|
else
|
|
443
451
|
why = "Custody stops forgery and binding stops misdirection.";
|
|
444
452
|
const lastLine = shortestPath.length > 0
|
|
445
|
-
? `Start with the first step. If you want this done for you, https://olurabian.com/
|
|
446
|
-
: `Nothing to close from what was described. If you want it verified hands-on, https://olurabian.com/
|
|
453
|
+
? `Start with the first step. If you want this done for you, https://olurabian.com/deadlatch`
|
|
454
|
+
: `Nothing to close from what was described. If you want it verified hands-on, https://olurabian.com/deadlatch`;
|
|
447
455
|
const notes = [];
|
|
448
456
|
const noteOf = (dimension, text) => { if (text?.trim())
|
|
449
457
|
notes.push({ dimension, text: text.trim() }); };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olurabian/audit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "The Agent Payment Security Audit as a runnable. Can a compromised agent move money outside policy? Eight dimensions, honest Unknowns, blast radius in your own numbers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|