saktum 0.8.0 → 0.9.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.
Files changed (3) hide show
  1. package/README.md +12 -1
  2. package/package.json +1 -1
  3. package/saktum.mjs +199 -28
package/README.md CHANGED
@@ -11,6 +11,17 @@ npx saktum check https://your-server.example/mcp # a remote server (sign-in
11
11
 
12
12
  Runs on your machine. Nothing is uploaded. Your own environment variables are never passed to the server.
13
13
 
14
+ ## Evidence for governance (v0.9)
15
+
16
+ Saktum is the agent-controls layer of AI governance: identity, least privilege, tool permissions, human oversight and
17
+ audit. `npx saktum evidence --framework all` maps its evidence to the **EU AI Act, NIST AI RMF, ISO/IEC 42001, the OWASP
18
+ Top 10 for LLM applications, DORA and NIS2, and GDPR and India's DPDP Act**, marking each obligation covered, partly
19
+ covered or not covered, with the commands that produce the evidence ([docs/EVIDENCE.md](docs/EVIDENCE.md)); the
20
+ executive assessment includes the summary. Saktum supports evidence; it never claims compliance. Also new: the
21
+ **coding-agent** demo story (`npx saktum demo --story coding`: its own repository only, production releases only after
22
+ your signed approval of exactly that release), the `deploy` action class and `code` vocabulary, and assurance shown in
23
+ words (self-tested, independently checked, certified).
24
+
14
25
  ## From trust to a marketplace (v0.8)
15
26
 
16
27
  Every agent traceable to a person and an organisation (**identity chains**, with orphan detection); publishers sign
@@ -209,7 +220,7 @@ servers not on your allowlist, and the weakest grades. Configured secrets are ne
209
220
 
210
221
  ```yaml
211
222
  - uses: actions/checkout@v4
212
- - uses: soodhere/saktum-check@v0.8.0
223
+ - uses: soodhere/saktum-check@v0.9.0
213
224
  with:
214
225
  target: "-- node build/index.js" # or an https URL
215
226
  args: "--active --tests saktum.tests.yaml" # optional; --active only for your own server
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saktum",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Test MCP servers in one command: conformance, sign-in, security (OWASP MCP Top 10), agent experience, context cost and performance.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
package/saktum.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // Saktum Check 0.8.0 (private beta). Licensed Apache-2.0; bundled dependencies keep their own licences.
2
+ // Saktum Check 0.9.0 (private beta). Licensed Apache-2.0; bundled dependencies keep their own licences.
3
3
  import { createRequire as __saktumCreateRequire } from "node:module";
4
4
  const require = __saktumCreateRequire(import.meta.url);
5
5
  var __create = Object.create;
@@ -19435,6 +19435,7 @@ var init_embedded = __esm({
19435
19435
  "change",
19436
19436
  "cancel",
19437
19437
  "communicate",
19438
+ "deploy",
19438
19439
  "other"
19439
19440
  ]
19440
19441
  },
@@ -33996,7 +33997,7 @@ var init_dist3 = __esm({
33996
33997
  init_stdio2();
33997
33998
  init_streamableHttp();
33998
33999
  init_types2();
33999
- USER_AGENT = "saktum-check/0.8.0 (+https://saktum.dev/check)";
34000
+ USER_AGENT = "saktum-check/0.9.0 (+https://saktum.dev/check)";
34000
34001
  LIMITS = { requestTimeoutMs: 1e4, connectTimeoutMs: 6e4, maxResponseChars: 5e6 };
34001
34002
  LimitError = class extends Error {
34002
34003
  };
@@ -34034,7 +34035,7 @@ var init_dist3 = __esm({
34034
34035
  jsonrpc: "2.0",
34035
34036
  id: 1,
34036
34037
  method: "initialize",
34037
- params: { protocolVersion: "2025-06-18", capabilities: {}, clientInfo: { name: "saktum-trust-check-probe", version: "0.8.0" } }
34038
+ params: { protocolVersion: "2025-06-18", capabilities: {}, clientInfo: { name: "saktum-trust-check-probe", version: "0.9.0" } }
34038
34039
  });
34039
34040
  }
34040
34041
  });
@@ -35406,7 +35407,7 @@ var init_engine = __esm({
35406
35407
  init_runner();
35407
35408
  init_safe();
35408
35409
  init_scoring();
35409
- ENGINE_VERSION = "0.8.0";
35410
+ ENGINE_VERSION = "0.9.0";
35410
35411
  UNKNOWN_TOOL = "saktum_trust_check_no_such_tool";
35411
35412
  INVALID_TOKEN = "saktum-check-deliberately-invalid-token";
35412
35413
  baseOf = (pack, check) => ({
@@ -35998,6 +35999,10 @@ var init_vocab = __esm({
35998
35999
  { path: "enterprise.data_class", type: "string", description: "Classification of the data: public, internal, confidential or restricted" },
35999
36000
  { path: "enterprise.vendor", type: "string", description: "The supplier or vendor" }
36000
36001
  ] };
36002
+ VOCABULARIES.code = { version: "0.1", fields: [
36003
+ { path: "code.repository", type: "string", description: "The code repository" },
36004
+ { path: "code.environment", type: "string", description: "The deployment environment (for example staging, production)" }
36005
+ ] };
36001
36006
  KNOWN_FIELDS = new Set(Object.values(VOCABULARIES).flatMap((v) => v.fields.map((f) => f.path)));
36002
36007
  NAME_RULES = [
36003
36008
  [/(^|[_-])(search|find|list|get|lookup|deals|browse)([_-]|$)/i, "search"],
@@ -36007,6 +36012,7 @@ var init_vocab = __esm({
36007
36012
  [/(^|[_-])(book|reserve|hold)([_-]|$)/i, "book"],
36008
36013
  [/(^|[_-])(change|modify|update|seat|upgrade)([_-]|$)/i, "change"],
36009
36014
  [/(^|[_-])(cancel|refund|void)([_-]|$)/i, "cancel"],
36015
+ [/(^|[_-])(deploy|release|publish)([_-]|$)/i, "deploy"],
36010
36016
  [/(^|[_-])(send|email|message|notify|post)([_-]|$)/i, "communicate"]
36011
36017
  ];
36012
36018
  ARG_RULES = [
@@ -36413,6 +36419,29 @@ function consumeApproval(m, requestId, path = DEFAULT_APPROVALS()) {
36413
36419
  }
36414
36420
  return { ok: false };
36415
36421
  }
36422
+ function agentMaturity(m, o = {}) {
36423
+ const op = checkOperator(m);
36424
+ const tier = agentRiskTier(m).tier;
36425
+ const bounded = Boolean(m.allow.tools?.length || m.actions?.length) && m.delegation !== true && (!(tier === "R3" || tier === "R4") || Boolean(m.constraints?.length || m.approveAbove || m.rules?.length || m.approvalTriggers?.length || m.autonomy === "propose" || m.autonomy === "notify"));
36426
+ const entries = o.entries ?? [];
36427
+ const actions = entries.filter((e) => e.receipt.outcome === "allow" && e.result.status === "ok").length;
36428
+ const outside = entries.filter((e) => String(e.result.code ?? "").startsWith("observed-")).length;
36429
+ const explained = entries.length > 0 && o.verified === true && entries.every((e) => Boolean(e.result.code));
36430
+ const steps = [
36431
+ { level: 1, name: "Identified", met: checkMandate(m).ok, why: "its own identity and a valid mandate signed by its owner" },
36432
+ { level: 2, name: "Accountable", met: op.present && op.valid || o.chainValid === true, why: "an operator countersignature or an identity chain to an organisation" },
36433
+ { level: 3, name: "Bounded", met: bounded, why: "explicit tools or action classes, no sub-delegation, and caps or approvals when it can act irreversibly or spend" },
36434
+ { level: 4, name: "Explained", met: explained, why: "signed, verified receipts with a reason for every decision" },
36435
+ { level: 5, name: "Proven", met: actions >= 10 && outside === 0 && !o.revoked && explained, why: `a track record of at least 10 actions, none outside its mandate (${actions} so far)` }
36436
+ ];
36437
+ let level = 0;
36438
+ for (const st of steps) {
36439
+ if (!st.met)
36440
+ break;
36441
+ level = st.level;
36442
+ }
36443
+ return { level, label: level ? `A${level} ${steps[level - 1].name}` : "Not yet identified", steps };
36444
+ }
36416
36445
  var FIELD_LABEL, ruleText, DEFAULT_REVOCATIONS, readRevocations, DEFAULT_APPROVALS, readApprovals;
36417
36446
  var init_agentid = __esm({
36418
36447
  "packages/testkit-core/dist/agentid.js"() {
@@ -36827,6 +36856,63 @@ var init_market = __esm({
36827
36856
  }
36828
36857
  });
36829
36858
 
36859
+ // packages/testkit-core/dist/crosswalk.js
36860
+ function crosswalk(id = "all") {
36861
+ return id === "all" ? FRAMEWORKS : FRAMEWORKS.filter((f) => f.id === id);
36862
+ }
36863
+ function coverageSummary(f) {
36864
+ const n = (c) => f.items.filter((i) => i.coverage === c).length;
36865
+ return { covered: n("covered"), partial: n("partial"), gap: n("gap"), total: f.items.length };
36866
+ }
36867
+ var I, FRAMEWORKS, DISCLAIMER;
36868
+ var init_crosswalk = __esm({
36869
+ "packages/testkit-core/dist/crosswalk.js"() {
36870
+ "use strict";
36871
+ I = (ref, obligation, coverage, evidence, commands) => ({ ref, obligation, coverage, evidence, commands });
36872
+ FRAMEWORKS = [
36873
+ { id: "eu-ai-act", name: "EU AI Act", note: "Most obligations apply to high-risk AI systems; whether a system is high-risk is the organisation's assessment.", items: [
36874
+ I("Art. 9", "Risk management", "partial", "Risk tiers R0\u2013R4 for servers and agents, policy ceilings, the executive assessment", ["saktum check", "saktum assess"]),
36875
+ I("Art. 12", "Record-keeping (automatic logging)", "covered", "Signed, hash-chained receipts of every agent tool call, with the decision and its reason", ["saktum proxy", "saktum receipts verify"]),
36876
+ I("Art. 13", "Transparency and information to deployers", "partial", "Passports, manifests and plain-language mandates", ["saktum passport", "saktum manifest create"]),
36877
+ I("Art. 14", "Human oversight", "covered", "Autonomy levels, signed approvals of exact actions, revocation (the stop button)", ["saktum agent approve", "saktum agent revoke"]),
36878
+ I("Art. 15", "Accuracy, robustness and cybersecurity", "partial", "Conformance and security checks of tools; containment of manipulated agents by mandates (not model accuracy)", ["saktum check", "saktum demo"]),
36879
+ I("Art. 26", "Obligations of deployers (monitoring, logs)", "covered", "Monitoring of approved tools, receipts retained by the deployer, OpenTelemetry export", ["saktum watch", "saktum receipts export --otel"]),
36880
+ I("Art. 50", "Transparency for certain AI systems", "gap", "Not in scope: disclosure to people interacting with AI is the deployer's interface", [])
36881
+ ] },
36882
+ { id: "nist-ai-rmf", name: "NIST AI RMF 1.0", note: "Voluntary framework; functions Govern, Map, Measure, Manage.", items: [
36883
+ I("GOVERN", "Policies, accountability, third-party risk", "covered", "Policy as code with exceptions; identity chains to accountable people and organisations; operator countersignatures", ["saktum fleet --policy", "saktum identity verify"]),
36884
+ I("MAP", "Context, inventory and risk categorisation", "partial", "Inventory of MCP servers across machines, capability profiles, risk tiers (agent inventory planned)", ["saktum scan-config", "saktum fleet"]),
36885
+ I("MEASURE", "Testing, evaluation and monitoring", "partial", "Conformance, security, functional and readiness checks; track records from receipts (no model evaluation)", ["saktum check", "saktum kpi"]),
36886
+ I("MANAGE", "Risk treatment, response and recovery", "covered", "Mandates, approvals, allowlists, monitoring alerts, revocation", ["saktum allowlist", "saktum watch", "saktum agent revoke"])
36887
+ ] },
36888
+ { id: "iso-42001", name: "ISO/IEC 42001", note: "AI management system standard; certification is by accredited bodies.", items: [
36889
+ I("6.1", "Actions to address risks and opportunities", "partial", "Risk tiers, policy, assessment with recommendations", ["saktum assess"]),
36890
+ I("8", "Operation: planning and control", "covered", "Mandates and agreements enforced before every call", ["saktum proxy --enforce"]),
36891
+ I("9.1", "Monitoring, measurement, analysis and evaluation", "covered", "Receipts, KPIs, usage statements, monitoring", ["saktum kpi", "saktum usage", "saktum watch"]),
36892
+ I("9.2", "Internal audit", "partial", "Independently verifiable ledger, receipts and passports for auditors", ["saktum ledger verify", "saktum receipts verify"]),
36893
+ I("A.10", "Third-party and customer relationships", "covered", "Passports, manifests, signed agreements, Verifiable Credentials", ["saktum attest --vc", "saktum agreement verify"])
36894
+ ] },
36895
+ { id: "owasp-llm", name: "OWASP Top 10 for LLM Applications (2025)", note: "Mapped for agents' tool use; model-level risks are out of scope.", items: [
36896
+ I("LLM01", "Prompt injection", "partial", "Hidden-instruction checks on tools; mandates contain a manipulated agent (detection inside models is out of scope)", ["saktum check", "saktum demo"]),
36897
+ I("LLM02", "Sensitive information disclosure", "partial", "Personal and classified data enforced per recipient; secrets never printed; argument digests only", ["saktum proxy --enforce"]),
36898
+ I("LLM03", "Supply chain", "covered", "Provenance and install-script checks, maturity levels, SBOMs, the census", ["saktum check", "saktum passport"]),
36899
+ I("LLM06", "Excessive agency", "covered", "Least-privilege mandates, autonomy levels, approvals, revocation", ["saktum agent create --intent", "saktum agent approve"]),
36900
+ I("LLM10", "Unbounded consumption", "covered", "Daily limits, prepaid token metering, context-cost and ROI analysis", ["saktum proxy --wallet", "saktum roi"])
36901
+ ] },
36902
+ { id: "dora-nis2", name: "DORA and NIS2", note: "EU financial-sector (DORA) and critical-sector (NIS2) resilience rules.", items: [
36903
+ I("DORA Art. 28", "ICT third-party risk and the register of information", "partial", "Inventory of AI tools, passports, agreements, monitoring of third-party servers", ["saktum fleet", "saktum watch"]),
36904
+ I("NIS2 Art. 21", "Risk-management measures incl. supply-chain security", "partial", "Supply-chain checks, allowlists pinned to tool fingerprints, incident evidence", ["saktum allowlist", "saktum check"])
36905
+ ] },
36906
+ { id: "gdpr-dpdp", name: "GDPR and India's DPDP Act", note: "Data protection; lawful basis and notices are the controller's responsibility.", items: [
36907
+ I("GDPR Art. 5(1)(b)", "Purpose limitation", "partial", "Mandates state the purpose; personal data goes only to permitted recipients", ["saktum agent create --intent"]),
36908
+ I("GDPR Art. 30", "Records of processing", "partial", "Receipts record which personal-data fields went to whom (digests, not values)", ["saktum receipts summary"]),
36909
+ I("GDPR Art. 32 / DPDP", "Security of processing; reasonable safeguards", "partial", "Enforcement before each call, signed evidence, revocation", ["saktum proxy --enforce"])
36910
+ ] }
36911
+ ];
36912
+ DISCLAIMER = "Saktum supports evidence for these obligations; it does not establish compliance, which depends on your own assessment and advisers.";
36913
+ }
36914
+ });
36915
+
36830
36916
  // packages/testkit-core/dist/index.js
36831
36917
  var dist_exports = {};
36832
36918
  __export(dist_exports, {
@@ -36838,9 +36924,11 @@ __export(dist_exports, {
36838
36924
  DEFAULT_LEDGER_URL: () => DEFAULT_LEDGER_URL,
36839
36925
  DEFAULT_REVOCATIONS: () => DEFAULT_REVOCATIONS,
36840
36926
  DEFAULT_TERMS: () => DEFAULT_TERMS,
36927
+ DISCLAIMER: () => DISCLAIMER,
36841
36928
  EMBEDDED_CONTRACTS: () => EMBEDDED_CONTRACTS,
36842
36929
  EMBEDDED_PACKS: () => EMBEDDED_PACKS,
36843
36930
  ENGINE_VERSION: () => ENGINE_VERSION,
36931
+ FRAMEWORKS: () => FRAMEWORKS,
36844
36932
  FUNCTIONAL_LIMITS: () => FUNCTIONAL_LIMITS,
36845
36933
  GENESIS: () => GENESIS,
36846
36934
  INVISIBLE: () => INVISIBLE,
@@ -36866,6 +36954,7 @@ __export(dist_exports, {
36866
36954
  VOCABULARIES: () => VOCABULARIES,
36867
36955
  acceptAgreement: () => acceptAgreement,
36868
36956
  actionClass: () => actionClass,
36957
+ agentMaturity: () => agentMaturity,
36869
36958
  agentRiskTier: () => agentRiskTier,
36870
36959
  allowlistFromLedger: () => allowlistFromLedger,
36871
36960
  analyseSetup: () => analyseSetup,
@@ -36899,7 +36988,9 @@ __export(dist_exports, {
36899
36988
  contractText: () => contractText,
36900
36989
  contractsDir: () => contractsDir,
36901
36990
  cosignMandate: () => cosignMandate,
36991
+ coverageSummary: () => coverageSummary,
36902
36992
  createMandate: () => createMandate,
36993
+ crosswalk: () => crosswalk,
36903
36994
  decideCall: () => decideCall,
36904
36995
  decideIntent: () => decideIntent,
36905
36996
  describeMandate: () => describeMandate,
@@ -37022,6 +37113,7 @@ var init_dist4 = __esm({
37022
37113
  init_risk();
37023
37114
  init_vocab();
37024
37115
  init_market();
37116
+ init_crosswalk();
37025
37117
  }
37026
37118
  });
37027
37119
 
@@ -37046,12 +37138,12 @@ function renderServerPassport(r, tools, o = {}) {
37046
37138
  }).join("");
37047
37139
  const body2 = `<div class="card"><div class="top"><div class="seal" style="background:${GRADE_COLOUR[g] ?? "#757575"}">${esc2(g)}</div>
37048
37140
  <div><small>MCP SERVER PASSPORT</small><h1>${esc2(name)} ${esc2(version2)}</h1><div class="muted">${esc2(r.target.transport)} \xB7 protocol ${esc2(r.target.protocolVersion ?? "unknown")} \xB7 ${esc2(String(r.target.toolCount ?? tools.length))} tools</div></div></div>
37049
- <div class="chips">${chip("Trust", r.grade, GRADE_COLOUR[g])}${chip("Agent readiness", r.readiness?.grade, GRADE_COLOUR[r.readiness?.grade ?? ""])}${chip("Context", `${(r.readiness?.contextTokens ?? 0).toLocaleString("en-US")} tokens/turn`)}${r.riskTier ? chip("Risk", `${r.riskTier.tier} \xB7 ${r.riskTier.label}`, r.riskTier.tier >= "R3" ? "#b7791f" : void 0) : ""}${chip("Assurance", r.assuranceLevel ?? "L1")}${o.ledgerEntry ? chip("Ledger entry", `#${o.ledgerEntry}`) : ""}</div></div>
37141
+ <div class="chips">${chip("Trust", r.grade, GRADE_COLOUR[g])}${chip("Agent readiness", r.readiness?.grade, GRADE_COLOUR[r.readiness?.grade ?? ""])}${chip("Context", `${(r.readiness?.contextTokens ?? 0).toLocaleString("en-US")} tokens/turn`)}${r.riskTier ? chip("Risk", `${r.riskTier.tier} \xB7 ${r.riskTier.label}`, r.riskTier.tier >= "R3" ? "#b7791f" : void 0) : ""}${chip("Assurance", { L1: "self-tested", L2: "independently checked", L3: "certified", L4: "continuously certified" }[r.assuranceLevel ?? "L1"] ?? "self-tested")}${o.ledgerEntry ? chip("Ledger entry", `#${o.ledgerEntry}`) : ""}</div></div>
37050
37142
  <div class="card"><h2>Maturity</h2>${levelBar(lvl, lvl === 4 ? "L5 also needs supply-chain evidence (provenance, no install scripts)" : void 0)}</div>
37051
37143
  ${r.riskTier ? `<div class="card"><h2>Risk tier</h2><p><b>${esc2(r.riskTier.tier)}: ${esc2(r.riskTier.label)}.</b> ${esc2(r.riskTier.reasons.join("; "))}.</p><p class="muted">Proportionate requirement: ${esc2(r.riskTier.requirement)}.</p></div>` : ""}
37052
37144
  <div class="card"><h2>What it can do</h2>${caps.length ? `<div class="chips">${caps.map((c) => chip(c.basis, c.label)).join("")}</div>` : `<p class="muted">No notable capabilities inferred.</p>`}${r.capabilities?.lethalTrifecta ? `<p><b>Note:</b> combines private data, untrusted content and an outbound channel.</p>` : ""}</div>
37053
37145
  <div class="card"><h2>Interface</h2>${tools.length ? `<div class="wrap"><table><tr><th>Tool</th><th>Effect</th><th>Output schema</th><th>Required inputs</th></tr>${rows}</table></div>${tools.length > 60 ? `<p class="muted">First 60 of ${tools.length} tools.</p>` : ""}` : `<p class="muted">Tool list not included.</p>`}</div>
37054
- <div class="card"><h2>Verify this passport</h2><p>Generated by Saktum Check ${esc2(r.tool.version)} on ${esc2(r.run.startedAt.slice(0, 10))} from a signed result${r.signature?.kid ? ` (signer <code>${esc2(r.signature.kid)}</code>)` : ""}; tool fingerprint <code>${esc2(r.target.toolsFingerprint ?? "-")}</code>. Check it yourself: <code>npx saktum verify saktum-report.json</code>${o.ledgerEntry ? ` and <code>npx saktum ledger find "${esc2(name)}"</code>` : ""}.</p><p class="muted">Self-tested (L1) unless stated otherwise. A passport describes these exact tools at that time; any tool change needs a new one.</p></div>`;
37146
+ <div class="card"><h2>Verify this passport</h2><p>Generated by Saktum Check ${esc2(r.tool.version)} on ${esc2(r.run.startedAt.slice(0, 10))} from a signed result${r.signature?.kid ? ` (signer <code>${esc2(r.signature.kid)}</code>)` : ""}; tool fingerprint <code>${esc2(r.target.toolsFingerprint ?? "-")}</code>. Check it yourself: <code>npx saktum verify saktum-report.json</code>${o.ledgerEntry ? ` and <code>npx saktum ledger find "${esc2(name)}"</code>` : ""}.</p><p class="muted">Self-tested unless stated otherwise. A passport describes these exact tools at that time; any tool change needs a new one.</p></div>`;
37055
37147
  return page(`${name}: MCP Server Passport`, body2);
37056
37148
  }
37057
37149
  function renderAgentPassport(m, valid, receipts, tier, plain, extra = {}) {
@@ -37071,7 +37163,9 @@ function renderAgentPassport(m, valid, receipts, tier, plain, extra = {}) {
37071
37163
  const steps = (receipts?.timeline ?? []).slice(0, 80).map((t) => `<span class="step ${t.outcome === "deny" ? "deny" : t.status === "ok" ? "ok" : "err"}${t.repeated ? " rep" : ""}" title="${esc2(t.outcome)} \xB7 ${esc2(t.status)}">${t.outcome === "deny" ? "\u26D4" : t.status === "ok" ? "\u2713" : "!"} ${esc2(t.tool)}</span>`).join('<span class="muted">\u2192</span>');
37072
37164
  const body2 = `<div class="card"><div class="top"><div class="seal" style="background:${valid.ok ? "#5a3fc0" : "#c62828"}">AI</div>
37073
37165
  <div><small>AGENT PASSPORT</small><h1>${esc2(m.agent.name)}</h1><div class="muted">acts for ${esc2(m.owner.name ?? m.owner.id)}${m.purpose ? ` \xB7 ${esc2(m.purpose)}` : ""}</div></div></div>
37074
- <div class="chips">${chip("Mandate", valid.ok ? "valid" : "not valid", valid.ok ? "#2e7d32" : "#c62828")}${chip("Expires", m.expires)}${chip("Destructive actions", m.allow.destructive ? "allowed" : "not allowed")}${tier ? chip("Risk", `${tier.tier}`, tier.tier === "R4" ? "#b7791f" : void 0) : ""}${s ? chip("Receipts", receipts.verified ? "verified" : "DO NOT verify", receipts.verified ? "#2e7d32" : "#c62828") : ""}</div>${valid.ok ? "" : `<p><b>${esc2(valid.reason)}</b></p>`}</div>
37166
+ <div class="chips">${chip("Mandate", valid.ok ? "valid" : "not valid", valid.ok ? "#2e7d32" : "#c62828")}${chip("Expires", m.expires)}${chip("Destructive actions", m.allow.destructive ? "allowed" : "not allowed")}${extra.maturity ? chip("Maturity", extra.maturity.label, "#5a3fc0") : ""}${tier ? chip("Risk", `${tier.tier}`, tier.tier === "R4" ? "#b7791f" : void 0) : ""}${s ? chip("Receipts", receipts.verified ? "verified" : "DO NOT verify", receipts.verified ? "#2e7d32" : "#c62828") : ""}</div>${valid.ok ? "" : `<p><b>${esc2(valid.reason)}</b></p>`}</div>
37167
+ ${extra.maturity ? `<div class="card"><h2>Maturity</h2><div class="levels">${[1, 2, 3, 4, 5].map((l) => `<div class="lv${l <= extra.maturity.level ? " on" : ""}">A${l}</div>`).join("")}</div><small>${esc2(extra.maturity.label)} \xB7 earned from evidence, never a score</small>
37168
+ <div class="wrap" style="margin-top:8px"><table>${extra.maturity.steps.map((st) => `<tr><td>${st.met ? "\u2713" : "\u2013"} <b>A${st.level} ${esc2(st.name)}</b></td><td>${esc2(st.why)}</td></tr>`).join("")}</table></div></div>` : ""}
37075
37169
  ${extra.track?.length ? `<div class="card"><h2>Track record</h2>${extra.track.map((l) => `<p style="margin:4px 0">${esc2(l)}</p>`).join("")}<p class="muted">A statement from its signed receipts, not a score.</p></div>` : ""}
37076
37170
  ${plain?.length ? `<div class="card"><h2>Its instructions, in plain words</h2>${plain.map((l) => `<p style="margin:4px 0">${esc2(l)}</p>`).join("")}</div>` : ""}
37077
37171
  <div class="card"><h2>Permissions</h2><div class="wrap"><table>${perms}</table></div>${tier ? `<p class="muted">Risk tier ${esc2(tier.tier)}: ${esc2(tier.note)}.</p>` : ""}</div>
@@ -37088,9 +37182,9 @@ function renderLedgerPassport(e) {
37088
37182
  const c = e.attestation.claims, g = c.trustGrade ?? "-";
37089
37183
  const body2 = `<div class="card"><div class="top"><div class="seal" style="background:${GRADE_COLOUR[g] ?? "#757575"}">${esc2(g)}</div><div><small>MCP SERVER PASSPORT \xB7 TRUST LEDGER ENTRY #${e.seq}</small><h1>${esc2(e.subject.server)} ${esc2(e.subject.version ?? "")}</h1>
37090
37184
  <div class="muted">${esc2(e.attestation.subject.transport)} \xB7 ${esc2(String(e.attestation.subject.toolCount ?? "?"))} tools \xB7 checked ${esc2(e.attestation.checkedAt.slice(0, 10))} with ${esc2(e.attestation.checkedWith)}</div></div></div>
37091
- <div class="chips">${chip("Trust", c.trustGrade, GRADE_COLOUR[g])}${chip("Agent readiness", c.readinessGrade, GRADE_COLOUR[c.readinessGrade ?? ""])}${chip("Assurance", c.assuranceLevel)}${chip("Recorded", e.recordedAt.slice(0, 10))}</div></div>
37185
+ <div class="chips">${chip("Trust", c.trustGrade, GRADE_COLOUR[g])}${chip("Agent readiness", c.readinessGrade, GRADE_COLOUR[c.readinessGrade ?? ""])}${chip("Assurance", { L1: "self-tested", L2: "independently checked", L3: "certified", L4: "continuously certified" }[c.assuranceLevel] ?? c.assuranceLevel)}${chip("Recorded", e.recordedAt.slice(0, 10))}</div></div>
37092
37186
  <div class="card"><h2>Maturity evidence</h2>${levelBar(evidenceLevel(c.evidence))}</div>
37093
- <div class="card"><h2>Verify</h2><p>Signed by <code>${esc2(e.signer)}</code>; tools fingerprint <code>${esc2(e.subject.toolsFingerprint ?? "-")}</code>.</p><p><code>npx saktum ledger verify</code> \xB7 <code>npx saktum ledger find "${esc2(e.subject.server)}"</code></p><p class="muted">A signed claim by the server's publisher (assurance ${esc2(c.assuranceLevel)}; L1 = self-tested). It describes the tools matching the fingerprint at that time.</p></div>
37187
+ <div class="card"><h2>Verify</h2><p>Signed by <code>${esc2(e.signer)}</code>; tools fingerprint <code>${esc2(e.subject.toolsFingerprint ?? "-")}</code>.</p><p><code>npx saktum ledger verify</code> \xB7 <code>npx saktum ledger find "${esc2(e.subject.server)}"</code></p><p class="muted">A signed claim by the server's publisher (${esc2({ L1: "self-tested", L2: "independently checked", L3: "certified", L4: "continuously certified" }[c.assuranceLevel] ?? c.assuranceLevel)}). It describes the tools matching the fingerprint at that time.</p></div>
37094
37188
  <p class="muted"><a href="index.html">All passports</a> \xB7 <a href="../index.html">State of MCP Trust</a></p>`;
37095
37189
  return page(`${e.subject.server}: MCP Server Passport`, body2);
37096
37190
  }
@@ -37104,7 +37198,7 @@ function renderPassportGallery(entries) {
37104
37198
  }).join("");
37105
37199
  return page("MCP Server Passports: the Saktum trust ledger", `<div class="card"><small>SAKTUM TRUST LEDGER</small><h1>MCP Server Passports</h1><p class="muted">Servers whose publishers recorded a signed Saktum attestation in the public, append-only ledger. Anyone can verify every entry: <code>npx saktum ledger verify</code>. Add yours: <code>npx saktum attest saktum-report.json --publish</code>.</p></div>${cards || `<p class="muted">No entries yet.</p>`}`);
37106
37200
  }
37107
- function renderAssessment(org, f, receipts = [], roi) {
37201
+ function renderAssessment(org, f, receipts = [], roi, frameworks, disclaimer) {
37108
37202
  const risky = /* @__PURE__ */ new Set(["code-execution", "money", "sends-messages", "writes-or-deletes", "reads-private-data"]);
37109
37203
  const caps = ["code-execution", "money", "sends-messages", "writes-or-deletes", "reads-private-data", "network", "filesystem", "untrusted-content"];
37110
37204
  const grades = ["A", "B", "C", "D", "F", "-"];
@@ -37132,6 +37226,7 @@ function renderAssessment(org, f, receipts = [], roi) {
37132
37226
  <div class="card"><h2>Servers needing attention</h2>${top ? `<div class="wrap"><table><tr><th>Server</th><th>Machines</th><th>Trust / readiness</th><th>Why</th></tr>${top}</table></div>` : `<p>None: every assessed server meets the policy.</p>`}</div>
37133
37227
  ${rc ? `<div class="card"><h2>Agent receipts</h2><div class="wrap"><table><tr><th>Agent</th><th>Calls</th><th>Blocked</th><th>Destructive</th><th>Repeated calls</th><th>Receipts</th></tr>${rc}</table></div></div>` : ""}
37134
37228
  ${roi ? `<div class="card"><h2>Business case</h2><div class="grid"><div class="kv"><small>Tool definitions cost a year</small><b>$${roi.annualToolCost.toLocaleString("en-US")}</b></div><div class="kv"><small>Savings from fixes</small><b>$${roi.tokenSavings.toLocaleString("en-US")}</b></div><div class="kv"><small>Review effort replaced by passports</small><b>$${roi.reviewSavings.toLocaleString("en-US")}</b></div><div class="kv"><small>Total a year</small><b>$${roi.totalSavings.toLocaleString("en-US")}</b></div></div><p class="muted">Estimate. Assumptions: ${esc2(roi.assumptions)}. Replace them with your own figures.</p></div>` : ""}
37229
+ ${frameworks?.length ? `<div class="card"><h2>Evidence for the frameworks you are held to</h2><div class="wrap"><table><tr><th>Framework</th><th>Covered</th><th>Partly</th><th>Not covered</th></tr>${frameworks.map((x) => `<tr><td>${esc2(x.name)}</td><td>${x.summary.covered}</td><td>${x.summary.partial}</td><td>${x.summary.gap}</td></tr>`).join("")}</table></div><p class="muted">${esc2(disclaimer ?? "")} Details: <code>npx saktum evidence --framework all</code>.</p></div>` : ""}
37135
37230
  <div class="card"><h2>Recommendations</h2><ol>${rec.map((x) => `<li>${esc2(x)}</li>`).join("")}</ol></div>
37136
37231
  <div class="card"><h2>Next steps</h2><p>1. Agree the policy and exceptions with security. 2. Enforce it in CI on MCP repositories. 3. Deploy the allowlist to the MCP firewall or gateway. 4. Extend agent mandates and receipts to production agent workflows with the Saktum gateway (design partnership).</p><p class="muted">Findings describe the servers and agents at the time of assessment and are not a guarantee of security.</p></div>`;
37137
37232
  return page(`MCP Trust Assessment: ${org}`, body2);
@@ -37326,7 +37421,7 @@ function renderTerminal(r) {
37326
37421
  }
37327
37422
  lines.push("");
37328
37423
  lines.push(SELF_SIGNED_NOTE);
37329
- lines.push(DISCLAIMER);
37424
+ lines.push(DISCLAIMER2);
37330
37425
  lines.push("");
37331
37426
  lines.push(`Feedback shapes the next release (2 minutes): ${FEEDBACK_URL}`);
37332
37427
  return lines.join("\n");
@@ -37349,7 +37444,7 @@ ${(r.summary ?? []).map((l) => `<p>${e(l)}</p>`).join("")}
37349
37444
  <h2>Findings</h2><table>${rows}</table>
37350
37445
  <h2>Scope of this run</h2>${scopeOfRun(r).map((l) => `<p>${e(l)}</p>`).join("")}
37351
37446
  <h2>OWASP MCP Top 10 coverage</h2><table>${cov}</table>
37352
- <p><small>${e(SELF_SIGNED_NOTE)} ${e(DISCLAIMER)}</small></p></body></html>`;
37447
+ <p><small>${e(SELF_SIGNED_NOTE)} ${e(DISCLAIMER2)}</small></p></body></html>`;
37353
37448
  }
37354
37449
  function badgeSvg(r) {
37355
37450
  const colour = (g) => ({ A: "#2e7d32", B: "#558b2f", C: "#f9a825", D: "#ef6c00", F: "#c62828" })[g ?? ""] ?? "#757575";
@@ -37399,7 +37494,7 @@ ${(r.summary ?? []).map((l) => `<p>${e(l)}</p>`).join("")}
37399
37494
  <h2>2. Open findings</h2><table><tr><th>Severity</th><th>Check</th><th>Detail</th></tr>${problems}</table>
37400
37495
  <h2>3. What the tools can do</h2><ul>${caps}</ul>${r.capabilities?.lethalTrifecta ? "<p><b>Note:</b> the tools combine private data, untrusted content and an outbound channel; customers should limit what an agent can combine.</p>" : ""}
37401
37496
  ${tests ? `<h2>4. Provider test cases</h2><ul>${tests}</ul>` : ""}
37402
- <h2>${tests ? 5 : 4}. Scope and limits</h2>${scopeOfRun(r).map((l) => `<p>${e(l)}</p>`).join("")}<p class="muted">${e(COVERAGE_NOTE)} ${e(DISCLAIMER)}</p>
37497
+ <h2>${tests ? 5 : 4}. Scope and limits</h2>${scopeOfRun(r).map((l) => `<p>${e(l)}</p>`).join("")}<p class="muted">${e(COVERAGE_NOTE)} ${e(DISCLAIMER2)}</p>
37403
37498
  <h2>${tests ? 6 : 5}. Verify this evidence</h2><p>The full signed result accompanies this packet${signedBy ? ` (signed by <code>${e(signedBy)}</code>)` : ""}. Anyone can check it was not altered: <code>npx saktum verify saktum-report.json</code>.</p>
37404
37499
  <h2>${tests ? 7 : 6}. Provider statements (completed by the provider; not verified by Saktum)</h2><table>${declare}</table>
37405
37500
  </body></html>
@@ -37434,7 +37529,7 @@ function toSarif(r, anchor2 = "package.json", accepted = /* @__PURE__ */ new Set
37434
37529
  }]
37435
37530
  };
37436
37531
  }
37437
- var SEV_ORDER, rank, SYMBOL, FEEDBACK_URL, COVERAGE_NOTE, DISCLAIMER, SELF_SIGNED_NOTE, OWASP_MCP, LATER, PARTIAL, PACK_DIMENSION, dim;
37532
+ var SEV_ORDER, rank, SYMBOL, FEEDBACK_URL, COVERAGE_NOTE, DISCLAIMER2, SELF_SIGNED_NOTE, OWASP_MCP, LATER, PARTIAL, PACK_DIMENSION, dim;
37438
37533
  var init_dist5 = __esm({
37439
37534
  "packages/report/dist/index.js"() {
37440
37535
  "use strict";
@@ -37445,7 +37540,7 @@ var init_dist5 = __esm({
37445
37540
  SYMBOL = { fail: "\u2717 FAIL", inconclusive: "! INCONCLUSIVE", pass: "\u2713 PASS", skipped: "- SKIPPED", info: "i INFO" };
37446
37541
  FEEDBACK_URL = "https://github.com/soodhere/saktum-check/discussions";
37447
37542
  COVERAGE_NOTE = "This version tests conformance, sign-in basics, security hygiene, functional behaviour (with --active or test cases), performance and agent readiness; deeper sign-in, injection and supply-chain checks arrive in later releases.";
37448
- DISCLAIMER = "Findings describe this server at the time of the run. They are not a guarantee of security or correctness.";
37543
+ DISCLAIMER2 = "Findings describe this server at the time of the run. They are not a guarantee of security or correctness.";
37449
37544
  SELF_SIGNED_NOTE = "Assurance level L1 (self-tested): the signature proves this report was not changed after the run, not that it was run independently.";
37450
37545
  OWASP_MCP = [
37451
37546
  ["MCP01", "Token mismanagement and secret exposure"],
@@ -38537,7 +38632,7 @@ __export(demo_exports, {
38537
38632
  import { mkdirSync as mkdirSync5, readFileSync as readFileSync7, writeFileSync as writeFileSync4, existsSync as existsSync6, rmSync } from "node:fs";
38538
38633
  import { join as join5 } from "node:path";
38539
38634
  async function startDemoServer(story = "autonomy") {
38540
- const tools = story === "grocery" ? GROCERY_TOOLS : story === "travel" ? TRAVEL_TOOLS : story === "finance" ? FINANCE_TOOLS : DEMO_TOOLS;
38635
+ const tools = story === "grocery" ? GROCERY_TOOLS : story === "travel" ? TRAVEL_TOOLS : story === "finance" ? FINANCE_TOOLS : story === "coding" ? CODING_TOOLS : DEMO_TOOLS;
38541
38636
  const server = new Server({ name: story === "travel" ? "demo-travel" : story === "finance" ? "demo-finance" : "demo-grocer", version: "1.0.0" }, { capabilities: { tools: {} } });
38542
38637
  const cart = [];
38543
38638
  server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools }));
@@ -38570,6 +38665,16 @@ async function startDemoServer(story = "autonomy") {
38570
38665
  return text2(`Sent "${a.report}" to ${a.recipient}.`);
38571
38666
  case "pay_invoice":
38572
38667
  return text2(`Paid $${a.amount} to ${a.vendor}.`);
38668
+ case "run_tests":
38669
+ return text2(`${a.repository}: 412 tests passed.`);
38670
+ case "open_pull_request":
38671
+ return text2(`Opened pull request #318 in ${a.repository}: ${a.title}.`);
38672
+ case "read_secret":
38673
+ return text2(`Read ${a.name}.`);
38674
+ case "deploy_to_staging":
38675
+ return text2(`Deployed ${a.build} to staging.`);
38676
+ case "deploy_to_production":
38677
+ return text2(`Released ${a.build} to production.`);
38573
38678
  default:
38574
38679
  return { isError: true, content: [{ type: "text", text: "Unknown tool" }] };
38575
38680
  }
@@ -38656,10 +38761,14 @@ async function runStory(dir, st, owner, log) {
38656
38761
  verified: verifyReceiptLog(entries).ok,
38657
38762
  summary: summariseReceipts(entries),
38658
38763
  timeline: entries.map((e) => ({ tool: e.receipt.envelope.tool, outcome: e.receipt.outcome, status: e.result.status, repeated: false, why: [e.receipt.reason ?? "", ...e.result.rationale?.preferences ?? [], ...e.result.rationale?.flags ?? []].filter(Boolean).join(" \xB7 ") }))
38659
- }, agentRiskTier(m), describeMandate(m), { operator: (() => {
38660
- const op = checkOperator(cm);
38661
- return op.present && op.valid ? `${op.name} (${op.id})` : void 0;
38662
- })(), track: ts.lines }));
38764
+ }, agentRiskTier(m), describeMandate(m), {
38765
+ operator: (() => {
38766
+ const op = checkOperator(cm);
38767
+ return op.present && op.valid ? `${op.name} (${op.id})` : void 0;
38768
+ })(),
38769
+ track: ts.lines,
38770
+ maturity: agentMaturity(cm, { entries, verified: verifyReceiptLog(entries).ok })
38771
+ }));
38663
38772
  log(` ${entries.length} signed receipts \xB7 ${verifyReceiptLog(entries).ok ? "verified" : "NOT verified"} \xB7 passport: ${html}
38664
38773
  `);
38665
38774
  return html;
@@ -38700,7 +38809,7 @@ async function runMarketplace(dir, log) {
38700
38809
  const wf = join5(dir, "market-wallet.json");
38701
38810
  topUp(wf, acme.kid, 12);
38702
38811
  log(` \u2713 Acme tops up 12 prepaid tokens (bought outside Saktum; no money is handled here)`);
38703
- const m = cosignMandate(createMandate({ agentId: agent.kid, agentName: "Acme shopping agent", ownerName: "Priya", purpose: "Weekly office groceries", tools: gm.capabilities.map((c) => c.tool), destructive: false, expires: exp, autonomy: "act" }, priya), acme, "Acme Corp");
38812
+ const m = cosignMandate(createMandate({ agentId: agent.kid, agentName: "Acme shopping agent", ownerName: "Priya", purpose: "Weekly office groceries", tools: gm.capabilities.map((c) => c.tool), destructive: false, expires: exp, autonomy: "act", approveAbove: { arg: "amount", value: 50 } }, priya), acme, "Acme Corp");
38704
38813
  const mf = w("market-mandate.json", m), rf = join5(dir, "market-receipts.jsonl"), revf = join5(dir, "market-revoked-credentials.json");
38705
38814
  writeFileSync4(revf, "[]");
38706
38815
  const open2 = () => connect({ kind: "stdio", command: process.execPath, args: [
@@ -38767,7 +38876,7 @@ async function runMarketplace(dir, log) {
38767
38876
  log(` KPIs: ${k2.calls} calls \xB7 ${k2.allowed} allowed \xB7 ${k2.blocked} blocked (${k2.byOutcome.filter(([c]) => !c.startsWith("ok")).map(([c, n]) => `${n} ${c}`).join(", ")}) \xB7 ${k2.tokens} tokens`);
38768
38877
  const html = join5(dir, "marketplace-passport.html");
38769
38878
  const ts = trustStatement(all, verifyReceiptLog(all).ok);
38770
- writeFileSync4(html, renderAgentPassport(m, { ok: true }, { verified: verifyReceiptLog(all).ok, summary: summariseReceipts(all), timeline: all.map((e) => ({ tool: e.receipt.envelope.tool, outcome: e.receipt.outcome, status: e.result.status, repeated: false, why: [e.receipt.reason ?? "", e.result.metering ? `${e.result.metering.tokens} token(s), balance ${e.result.metering.balance}` : ""].filter(Boolean).join(" \xB7 ") })) }, agentRiskTier(m), [`Weekly office groceries for Acme Corp, under agreement ${ag.id} with Demo Grocer.`, `Accountable: ${verifyChain(agentCred).path.join(" \u2192 ")}.`, "Paid per call in prepaid tokens."], { operator: "Acme Corp", track: ts.lines }));
38879
+ writeFileSync4(html, renderAgentPassport(m, { ok: true }, { verified: verifyReceiptLog(all).ok, summary: summariseReceipts(all), timeline: all.map((e) => ({ tool: e.receipt.envelope.tool, outcome: e.receipt.outcome, status: e.result.status, repeated: false, why: [e.receipt.reason ?? "", e.result.metering ? `${e.result.metering.tokens} token(s), balance ${e.result.metering.balance}` : ""].filter(Boolean).join(" \xB7 ") })) }, agentRiskTier(m), [`Weekly office groceries for Acme Corp, under agreement ${ag.id} with Demo Grocer.`, `Accountable: ${verifyChain(agentCred).path.join(" \u2192 ")}.`, "Paid per call in prepaid tokens."], { operator: "Acme Corp", track: ts.lines, maturity: agentMaturity(m, { entries: all, verified: verifyReceiptLog(all).ok, chainValid: verifyChain(agentCred).valid }) }));
38771
38880
  log(` ${all.length} signed receipts \xB7 ${verifyReceiptLog(all).ok ? "verified" : "NOT verified"} \xB7 passport: ${html}
38772
38881
  `);
38773
38882
  return html;
@@ -38787,7 +38896,7 @@ async function runDemo(dir, log, story = "all") {
38787
38896
  const owner = loadOrCreateKey(join5(dir, "owner-key.json"));
38788
38897
  log("Saktum demo: agents acting on real instructions (rules, preferences, substitutions, upsells), every decision explained and signed.\n");
38789
38898
  const files = [];
38790
- for (const st of story === "travel" ? [TRAVEL] : story === "grocery" ? [GROCERY] : story === "finance" ? [FINANCE] : [GROCERY, TRAVEL, FINANCE])
38899
+ for (const st of story === "travel" ? [TRAVEL] : story === "grocery" ? [GROCERY] : story === "finance" ? [FINANCE] : story === "coding" ? [CODING] : [GROCERY, TRAVEL, FINANCE, CODING])
38791
38900
  files.push(await runStory(dir, st, owner, log));
38792
38901
  if (story === "all")
38793
38902
  files.push(await runMarketplace(dir, log));
@@ -38864,7 +38973,7 @@ async function runAutonomyDemo(dir, log) {
38864
38973
  log("What you just saw: the same agent and the same shop. Only the mandate changed what it was allowed to do, and every\ndecision, allowed or blocked, has a signed receipt. Open the passports to see each agent's permissions and path.");
38865
38974
  return { files };
38866
38975
  }
38867
- var PRODUCTS, DEMO_TOOLS, B, GROCERY_TOOLS, TRAVEL_TOOLS, FINANCE_TOOLS, SCRIPT, EXTRA, GROCERY, TRAVEL, FINANCE;
38976
+ var PRODUCTS, DEMO_TOOLS, B, GROCERY_TOOLS, TRAVEL_TOOLS, FINANCE_TOOLS, CODING_TOOLS, SCRIPT, EXTRA, GROCERY, TRAVEL, FINANCE, CODING;
38868
38977
  var init_demo = __esm({
38869
38978
  "packages/cli/dist/demo.js"() {
38870
38979
  "use strict";
@@ -38917,6 +39026,13 @@ var init_demo = __esm({
38917
39026
  { name: "send_report", description: "Send a report to a recipient.", inputSchema: { type: "object", properties: { recipient: { type: "string" }, report: { type: "string" }, data_class: { type: "string" } }, required: ["recipient", "report", "data_class"] }, annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true }, _meta: B({ recipient: "party.recipient", data_class: "enterprise.data_class" }, "communicate") },
38918
39027
  { name: "pay_invoice", description: "Pays a vendor invoice from the company account.", inputSchema: { type: "object", properties: { amount: { type: "number" }, currency: { type: "string" }, vendor: { type: "string" }, idempotency_key: { type: "string" } }, required: ["amount", "currency", "vendor", "idempotency_key"] }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true }, _meta: B({ amount: "commerce.order.total", currency: "commerce.order.currency", vendor: "enterprise.vendor" }, "pay") }
38919
39028
  ];
39029
+ CODING_TOOLS = [
39030
+ { name: "run_tests", description: "Run the repository's test suite.", inputSchema: { type: "object", properties: { repository: { type: "string" } }, required: ["repository"] }, annotations: { readOnlyHint: true }, _meta: B({ repository: "code.repository" }, "search") },
39031
+ { name: "open_pull_request", description: "Open a pull request with the agent's changes.", inputSchema: { type: "object", properties: { repository: { type: "string" }, title: { type: "string" } }, required: ["repository", "title"] }, annotations: { readOnlyHint: false, destructiveHint: false }, _meta: B({ repository: "code.repository" }, "change") },
39032
+ { name: "read_secret", description: "Read a secret from the secrets store.", inputSchema: { type: "object", properties: { repository: { type: "string" }, name: { type: "string" } }, required: ["repository", "name"] }, annotations: { readOnlyHint: true }, _meta: B({ repository: "code.repository" }, "search") },
39033
+ { name: "deploy_to_staging", description: "Deploy a build to the staging environment.", inputSchema: { type: "object", properties: { repository: { type: "string" }, build: { type: "string" } }, required: ["repository", "build"] }, annotations: { readOnlyHint: false, destructiveHint: false }, _meta: B({ repository: "code.repository" }, "change") },
39034
+ { name: "deploy_to_production", description: "Release a build to production.", inputSchema: { type: "object", properties: { repository: { type: "string" }, build: { type: "string" } }, required: ["repository", "build"] }, annotations: { readOnlyHint: false, destructiveHint: true }, _meta: B({ repository: "code.repository" }, "deploy") }
39035
+ ];
38920
39036
  SCRIPT = [
38921
39037
  { tool: "get_deals", args: {}, say: "checks this week's deals" },
38922
39038
  { tool: "search_products", args: { query: "coffee" }, say: "searches for coffee" },
@@ -38990,6 +39106,23 @@ var init_demo = __esm({
38990
39106
  { tool: "", args: {}, say: "you approve exactly that invoice (saktum agent approve)", approveLast: true },
38991
39107
  { tool: "pay_invoice", args: { amount: 12e3, currency: "CAD", vendor: "Consulting LLP", idempotency_key: "f-2" }, say: "retries the same $12,000 invoice" }
38992
39108
  ] };
39109
+ CODING = { id: "coding", title: 'Coding agent: "fix the failing tests; production only with my approval"', server: "coding", tools: CODING_TOOLS.map((t) => t.name), m: {
39110
+ autonomy: "act",
39111
+ destructive: true,
39112
+ purpose: "Fix the failing tests in payments-service overnight",
39113
+ actions: [{ cls: "search", autonomy: "act" }, { cls: "change", autonomy: "act" }, { cls: "deploy", autonomy: "propose" }],
39114
+ rules: [{ field: "code.repository", op: "in", value: ["payments-service"], label: "only the payments-service repository" }],
39115
+ disclosures: { operator: "Acme platform team", incentives: "None", dataUse: "Code and secrets of payments-service only" }
39116
+ }, steps: [
39117
+ { tool: "run_tests", args: { repository: "payments-service" }, say: "runs the test suite" },
39118
+ { tool: "open_pull_request", args: { repository: "payments-service", title: "Fix currency rounding in refunds" }, say: "opens a pull request with the fix" },
39119
+ { tool: "read_secret", args: { repository: "payments-service", name: "STAGING_DB_URL" }, say: "reads its own staging database secret" },
39120
+ { tool: "read_secret", args: { repository: "billing-core", name: "PROD_SIGNING_KEY" }, say: "tries to read another repository's production key" },
39121
+ { tool: "deploy_to_staging", args: { repository: "payments-service", build: "build-2291" }, say: "deploys build-2291 to staging" },
39122
+ { tool: "deploy_to_production", args: { repository: "payments-service", build: "build-2291" }, say: "tries to release build-2291 to production" },
39123
+ { tool: "", args: {}, say: "in the morning, you approve exactly that release (saktum agent approve)", approveLast: true },
39124
+ { tool: "deploy_to_production", args: { repository: "payments-service", build: "build-2291" }, say: "retries the same release" }
39125
+ ] };
38993
39126
  }
38994
39127
  });
38995
39128
 
@@ -39993,7 +40126,11 @@ ${r.errors.slice(0, 10).map((e) => ` ${e}`).join("\n")}
39993
40126
  }
39994
40127
  const rev = revocationOf(m), op = checkOperator(m);
39995
40128
  const ts = o.receipts ? trustStatement(parseReceiptLog(readFileSync9(o.receipts, "utf8")), receipts2?.verified ?? false) : void 0;
39996
- writeFileSync5(o.out, renderAgentPassport(m, rev ? { ok: false, reason: `Revoked on ${rev.at.slice(0, 10)}${rev.reason ? `: ${rev.reason}` : ""}` } : valid.ok ? { ok: true } : { ok: false, reason: valid.reason }, receipts2, agentRiskTier(m), describeMandate(m), { operator: op.present && op.valid ? `${op.name} (${op.id})` : void 0, track: ts?.lines }));
40129
+ writeFileSync5(o.out, renderAgentPassport(m, rev ? { ok: false, reason: `Revoked on ${rev.at.slice(0, 10)}${rev.reason ? `: ${rev.reason}` : ""}` } : valid.ok ? { ok: true } : { ok: false, reason: valid.reason }, receipts2, agentRiskTier(m), describeMandate(m), {
40130
+ operator: op.present && op.valid ? `${op.name} (${op.id})` : void 0,
40131
+ track: ts?.lines,
40132
+ maturity: agentMaturity(m, { entries: o.receipts ? parseReceiptLog(readFileSync9(o.receipts, "utf8")) : [], verified: receipts2?.verified, revoked: Boolean(rev) })
40133
+ }));
39997
40134
  process.stdout.write(`Wrote the Agent Passport for ${sanitizeText(m.agent.name, 80)} to ${sanitizeText(o.out)}. Open it in a browser.
39998
40135
  `);
39999
40136
  return;
@@ -40060,7 +40197,7 @@ Assumptions: ${r.assumptions}.
40060
40197
  });
40061
40198
  const distinctTokens = (fleet.servers ?? []).reduce((a, x) => a + (x.tokens ?? 0), 0);
40062
40199
  const roi = roiEstimate({ ...ROI_DEFAULTS, tokensPerTurn: distinctTokens, agents: Number(o.agents), turnsPerDay: Number(o.turnsPerDay), pricePerMTok: Number(o.pricePerMtok), vendorReviews: Number(o.vendorReviews) });
40063
- writeFileSync5(o.out, renderAssessment(o.org, fleet, rec, roi));
40200
+ writeFileSync5(o.out, renderAssessment(o.org, fleet, rec, roi, crosswalk().map((x) => ({ name: x.name, summary: coverageSummary(x) })), DISCLAIMER));
40064
40201
  process.stdout.write(`Wrote the MCP Trust Assessment for ${sanitizeText(o.org, 80)} to ${sanitizeText(o.out)}: ${fleet.servers?.length ?? 0} servers, ${fleet.nonCompliant ?? 0} violating policy. Open it in a browser and print to PDF.
40065
40202
  `);
40066
40203
  });
@@ -40235,11 +40372,45 @@ By tool: ${k.byTool.map(([c, n]) => `${c} ${n}`).join(", ")}
40235
40372
  process.stdout.write(ok ? "\u2713 Valid bounty document.\n" : "\u2717 Not a valid bounty document.\n");
40236
40373
  exitCode = ok ? 0 : 1;
40237
40374
  });
40238
- program2.command("demo").description("See permissions, autonomy, risk and receipts in 60 seconds: one shopping agent under three mandates").option("--out <dir>", "folder for the demo's mandates, receipts and passports", "saktum-demo").option("--story <name>", "grocery, travel, finance, marketplace, autonomy, or all (grocery, travel, finance and marketplace)", "all").action(async (o) => {
40375
+ program2.command("evidence").description("Saktum's evidence mapped to the frameworks you're held to (supports evidence; never a compliance claim)").option("--framework <id>", "all, eu-ai-act, nist-ai-rmf, iso-42001, owasp-llm, dora-nis2, gdpr-dpdp", "all").option("--markdown", "print as Markdown tables", false).action((o) => {
40376
+ const fs2 = crosswalk(o.framework);
40377
+ if (!fs2.length)
40378
+ throw new Error("Unknown framework. Use all, eu-ai-act, nist-ai-rmf, iso-42001, owasp-llm, dora-nis2 or gdpr-dpdp.");
40379
+ const mark2 = { covered: "\u2713 covered", partial: "\u25D0 partly", gap: "\u2013 not covered" };
40380
+ for (const f of fs2) {
40381
+ const sm = coverageSummary(f);
40382
+ if (o.markdown) {
40383
+ process.stdout.write(`## ${f.name}
40384
+
40385
+ ${f.note}
40386
+
40387
+ | Ref | Obligation | Coverage | Saktum evidence | Commands |
40388
+ | --- | --- | --- | --- | --- |
40389
+ `);
40390
+ for (const i of f.items)
40391
+ process.stdout.write(`| ${i.ref} | ${i.obligation} | ${mark2[i.coverage]} | ${i.evidence} | ${i.commands.map((c) => "`" + c + "`").join(", ")} |
40392
+ `);
40393
+ process.stdout.write("\n");
40394
+ } else {
40395
+ process.stdout.write(`
40396
+ ${f.name}: ${sm.covered} covered, ${sm.partial} partly, ${sm.gap} not covered
40397
+ ${f.note}
40398
+ `);
40399
+ for (const i of f.items)
40400
+ process.stdout.write(` ${mark2[i.coverage].padEnd(15)} ${i.ref.padEnd(18)} ${i.obligation}
40401
+ ${" ".repeat(36)}${i.evidence}${i.commands.length ? ` (${i.commands.join("; ")})` : ""}
40402
+ `);
40403
+ }
40404
+ }
40405
+ process.stdout.write(`
40406
+ ${DISCLAIMER}
40407
+ `);
40408
+ });
40409
+ program2.command("demo").description("See permissions, autonomy, risk and receipts in 60 seconds: one shopping agent under three mandates").option("--out <dir>", "folder for the demo's mandates, receipts and passports", "saktum-demo").option("--story <name>", "grocery, travel, finance, coding, marketplace, autonomy, or all (grocery, travel, finance, coding and marketplace)", "all").action(async (o) => {
40239
40410
  const { runDemo: runDemo2 } = await Promise.resolve().then(() => (init_demo(), demo_exports));
40240
40411
  await runDemo2(o.out, (l) => process.stdout.write(l + "\n"), o.story);
40241
40412
  });
40242
- program2.command("demo-server", { hidden: true }).description("The demo MCP servers (used by saktum demo)").option("--story <name>", "grocery, travel, finance or autonomy", "autonomy").action(async (o) => {
40413
+ program2.command("demo-server", { hidden: true }).description("The demo MCP servers (used by saktum demo)").option("--story <name>", "grocery, travel, finance, coding or autonomy", "autonomy").action(async (o) => {
40243
40414
  const { startDemoServer: startDemoServer2 } = await Promise.resolve().then(() => (init_demo(), demo_exports));
40244
40415
  await startDemoServer2(o.story);
40245
40416
  });