mneme-ai 3.145.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 escalon` (v3.146.0) — the agent TOOL-GRAPH vulnerability analyzer.
3
+ *
4
+ * analyze — given a tool manifest (JSON: [{id, capabilities, consumes, produces, description}]),
5
+ * find tool-chain privilege-escalation paths + poisoned tool descriptions.
6
+ *
7
+ * mneme escalon analyze --file tools.json
8
+ */
9
+ import type { Command } from "commander";
10
+ export declare function registerEscalonCommands(program: Command): void;
11
+ //# sourceMappingURL=escalon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"escalon.d.ts","sourceRoot":"","sources":["../../src/commands/escalon.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqB9D"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * `mneme escalon` (v3.146.0) — the agent TOOL-GRAPH vulnerability analyzer.
3
+ *
4
+ * analyze — given a tool manifest (JSON: [{id, capabilities, consumes, produces, description}]),
5
+ * find tool-chain privilege-escalation paths + poisoned tool descriptions.
6
+ *
7
+ * mneme escalon analyze --file tools.json
8
+ */
9
+ import { readFileSync } from "node:fs";
10
+ import { escalon } from "@mneme-ai/core";
11
+ function out(s) { process.stdout.write(s + "\n"); }
12
+ export function registerEscalonCommands(program) {
13
+ const c = program.command("escalon")
14
+ .description("🔗 ESCALON — analyze an AI agent's TOOL GRAPH for (1) tool-chain privilege escalation (safe tools that compose into a dangerous capability — the confused deputy) and (2) MCP tool-poisoning (injection hidden in a tool's description). Deterministic, no LLM. ★HONEST: reasons over the DECLARED capabilities — surfaces reachable paths to inspect, not a proven runtime exploit.");
15
+ c.command("analyze").description("find privilege-escalation chains + poisoned descriptions in a tool manifest")
16
+ .option("--file <file>", "tool manifest JSON: [{id, capabilities:[], consumes:[], produces:[], description}]")
17
+ .option("--json", "JSON")
18
+ .action((o) => {
19
+ let raw = "";
20
+ try {
21
+ raw = o.file ? readFileSync(o.file, "utf8") : readFileSync(0, "utf8");
22
+ }
23
+ catch {
24
+ out("⛔ provide --file <tools.json> (or pipe the manifest on stdin)");
25
+ process.exitCode = 2;
26
+ return;
27
+ }
28
+ let tools;
29
+ try {
30
+ tools = JSON.parse(raw);
31
+ }
32
+ catch {
33
+ out("⛔ not valid JSON");
34
+ process.exitCode = 2;
35
+ return;
36
+ }
37
+ const r = escalon.analyze(tools);
38
+ if (o.json) {
39
+ out(JSON.stringify(r, null, 2));
40
+ return;
41
+ }
42
+ const mark = r.verdict === "DANGER" ? "🔴" : r.verdict === "REVIEW" ? "🟠" : "🟢";
43
+ out(`${mark} ESCALON — ${r.verdict} · ${r.tools} tools · ${r.escalations.length} escalation path(s) · ${r.poisoned.length} poisoned · ${r.critical} critical`);
44
+ for (const e of r.escalations.slice(0, 8))
45
+ out(` ${e.severity >= 80 && !e.gated ? "🔴" : "🟠"} [sev ${e.severity}] ${e.tools.join(" → ")} ⇒ ${e.sink}${e.gated ? " (gated)" : ""}`);
46
+ for (const p of r.poisoned)
47
+ out(` ☣ poisoned: ${p.tool} — "${p.excerpt}"`);
48
+ if (r.verdict === "CLEAN")
49
+ out(` ✅ no escalation path or poisoned description found.`);
50
+ });
51
+ }
52
+ //# sourceMappingURL=escalon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"escalon.js","sourceRoot":"","sources":["../../src/commands/escalon.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,SAAS,GAAG,CAAC,CAAS,IAAU,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC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K,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QAClF,GAAG,CAAC,GAAG,IAAI,cAAc,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,WAAW,CAAC,MAAM,yBAAyB,CAAC,CAAC,QAAQ,CAAC,MAAM,eAAe,CAAC,CAAC,QAAQ,WAAW,CAAC,CAAC;QAC/J,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;YAAE,GAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACtL,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ;YAAE,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC;QAC7E,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO;YAAE,GAAG,CAAC,wDAAwD,CAAC,CAAC;IAC3F,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -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,S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AAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsnNvD"}
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
@@ -142,6 +142,8 @@ import { registerArkCommands } from "./commands/ark.js";
142
142
  import { registerCosmosCommands } from "./commands/cosmos.js";
143
143
  import { registerLedgerCommands } from "./commands/honesty_ledger.js";
144
144
  import { registerMutagenCommands } from "./commands/mutagen.js";
145
+ import { registerEscalonCommands } from "./commands/escalon.js";
146
+ import { registerPostureCommands } from "./commands/posture.js";
145
147
  import { registerMoatCommands } from "./commands/moat.js";
146
148
  import { attachRegretOracle } from "./commands/regret.js";
147
149
  import { registerTrustCommands } from "./commands/trust.js";
@@ -4841,6 +4843,8 @@ export async function run(argv) {
4841
4843
  registerCosmosCommands(program);
4842
4844
  registerLedgerCommands(program);
4843
4845
  registerMutagenCommands(program);
4846
+ registerEscalonCommands(program);
4847
+ registerPostureCommands(program);
4844
4848
  registerMoatCommands(program);
4845
4849
  // ─── Trust calibrator (v1.31.0) -- per-subsystem precision/recall/band
4846
4850
  registerTrustCommands(program);