mneme-ai 3.146.0 → 3.147.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.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * `mneme posture` (v3.147.0) — the signed Agent Security Posture report.
3
+ * Composes MUTAGEN (input-guardrail breach test) + ESCALON (tool-graph escalation +
4
+ * poisoning) into one A–F graded, Ed25519-signed certificate.
5
+ *
6
+ * mneme posture scan --file agent.json
7
+ * mneme posture verify --file posture.json
8
+ */
9
+ import type { Command } from "commander";
10
+ export declare function registerPostureCommands(program: Command): void;
11
+ //# sourceMappingURL=posture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"posture.d.ts","sourceRoot":"","sources":["../../src/commands/posture.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoC9D"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * `mneme posture` (v3.147.0) — the signed Agent Security Posture report.
3
+ * Composes MUTAGEN (input-guardrail breach test) + ESCALON (tool-graph escalation +
4
+ * poisoning) into one A–F graded, Ed25519-signed certificate.
5
+ *
6
+ * mneme posture scan --file agent.json
7
+ * mneme posture verify --file posture.json
8
+ */
9
+ import { readFileSync, writeFileSync } from "node:fs";
10
+ import { posture } from "@mneme-ai/core";
11
+ function out(s) { process.stdout.write(s + "\n"); }
12
+ export function registerPostureCommands(program) {
13
+ const c = program.command("posture")
14
+ .description("🛡 AGENT SECURITY POSTURE — grade an AI agent's whole safety surface (input guardrail via MUTAGEN + tool-graph escalation/poisoning via ESCALON) into one A–F, Ed25519-signed report. ★HONEST: grades the DECLARED config against a known attack space — a posture assessment, not a live pentest.");
15
+ c.command("scan").description("grade an agent profile (JSON: {name, guardrail:'mneme|naive|none', tools:[...]})")
16
+ .option("--file <file>", "agent profile JSON")
17
+ .option("--out <file>", "write the signed posture certificate JSON")
18
+ .option("--json", "print the report JSON")
19
+ .action((o) => {
20
+ let raw = "";
21
+ try {
22
+ raw = o.file ? readFileSync(o.file, "utf8") : readFileSync(0, "utf8");
23
+ }
24
+ catch {
25
+ out("⛔ provide --file <agent.json> (or pipe it on stdin)");
26
+ process.exitCode = 2;
27
+ return;
28
+ }
29
+ let profile;
30
+ try {
31
+ profile = JSON.parse(raw);
32
+ }
33
+ catch {
34
+ out("⛔ not valid JSON");
35
+ process.exitCode = 2;
36
+ return;
37
+ }
38
+ const { report, receipt } = posture.certifyPosture(process.cwd(), profile);
39
+ if (o.out)
40
+ writeFileSync(o.out, JSON.stringify(receipt, null, 2) + "\n");
41
+ if (o.json) {
42
+ out(JSON.stringify(report, null, 2));
43
+ return;
44
+ }
45
+ const mark = report.grade === "A" || report.grade === "B" ? "🟢" : report.grade === "C" || report.grade === "D" ? "🟠" : "🔴";
46
+ out(`${mark} AGENT POSTURE — ${report.agent}: grade ${report.grade} (${report.score}/100)`);
47
+ out(` input '${report.input.guardrail}': ${Math.round(report.input.breachRate * 100)}% of ${report.input.tested} variants breach · tools: ${report.toolGraph.verdict} (${report.toolGraph.critical} critical, ${report.toolGraph.poisoned} poisoned)`);
48
+ for (const f of report.findings)
49
+ out(` ${f}`);
50
+ out(` signed ${receipt.issuerFingerprint} · verify offline: mneme posture verify`);
51
+ });
52
+ c.command("verify").description("verify a posture certificate OFFLINE (Ed25519 + grade re-derives from score)")
53
+ .option("--file <file>", "posture certificate JSON")
54
+ .action((o) => {
55
+ let raw = "";
56
+ try {
57
+ raw = o.file ? readFileSync(o.file, "utf8") : readFileSync(0, "utf8");
58
+ }
59
+ catch {
60
+ out("⛔ provide --file <posture.json>");
61
+ process.exitCode = 2;
62
+ return;
63
+ }
64
+ let receipt;
65
+ try {
66
+ receipt = JSON.parse(raw);
67
+ }
68
+ catch {
69
+ out("⛔ not valid JSON");
70
+ process.exitCode = 2;
71
+ return;
72
+ }
73
+ const v = posture.verifyPosture(receipt);
74
+ out(v.valid ? `🟢 VALID — grade ${v.grade} (${v.score}/100)` : `🔴 INVALID — ${v.reason}`);
75
+ if (!v.valid)
76
+ process.exitCode = 1;
77
+ });
78
+ }
79
+ //# sourceMappingURL=posture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"posture.js","sourceRoot":"","sources":["../../src/commands/posture.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,SAAS,GAAG,CAAC,CAAS,IAAU,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAEjE,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACtD,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;SACjC,WAAW,CAAC,oSAAoS,CAAC,CAAC;IAErT,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,kFAAkF,CAAC;SAC9G,MAAM,CAAC,eAAe,EAAE,oBAAoB,CAAC;SAC7C,MAAM,CAAC,cAAc,EAAE,2CAA2C,CAAC;SACnE,MAAM,CAAC,QAAQ,EAAE,uBAAuB,CAAC;SACzC,MAAM,CAAC,CAAC,CAAkD,EAAE,EAAE;QAC7D,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,IAAI,CAAC;YAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QAAC,CAAC;QAC9E,MAAM,CAAC;YAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;YAAC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;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,KAAK,KAAK,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3F,IAAI,CAAC,CAAC,CAAC,KAAK;YAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoNA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAunNvD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqNA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAwnNvD"}
package/dist/index.js CHANGED
@@ -143,6 +143,7 @@ import { registerCosmosCommands } from "./commands/cosmos.js";
143
143
  import { registerLedgerCommands } from "./commands/honesty_ledger.js";
144
144
  import { registerMutagenCommands } from "./commands/mutagen.js";
145
145
  import { registerEscalonCommands } from "./commands/escalon.js";
146
+ import { registerPostureCommands } from "./commands/posture.js";
146
147
  import { registerMoatCommands } from "./commands/moat.js";
147
148
  import { attachRegretOracle } from "./commands/regret.js";
148
149
  import { registerTrustCommands } from "./commands/trust.js";
@@ -4843,6 +4844,7 @@ export async function run(argv) {
4843
4844
  registerLedgerCommands(program);
4844
4845
  registerMutagenCommands(program);
4845
4846
  registerEscalonCommands(program);
4847
+ registerPostureCommands(program);
4846
4848
  registerMoatCommands(program);
4847
4849
  // ─── Trust calibrator (v1.31.0) -- per-subsystem precision/recall/band
4848
4850
  registerTrustCommands(program);