@metamynd/agentsafe-guard 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/policy-core.mjs +13 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamynd/agentsafe-guard",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Zero-dependency runtime governance for any Node AI agent — gate tool calls through MetaMynd/AgentSafe (allow / block / escalate) against the agent's mandate, enforced Standards, and SOPs. Ed25519-signed, deterministic, fail-closed.",
5
5
  "type": "module",
6
6
  "main": "./agentsafe-guard.mjs",
package/policy-core.mjs CHANGED
@@ -30,7 +30,12 @@ ${c.output ?? ""}`.toLowerCase();
30
30
  "model-not-allowed": (c, cfg) => notInAllowList(c.model, cfg?.allowed),
31
31
  "tool-not-allowed": (c, cfg) => notInAllowList(c.tool, cfg?.allowed),
32
32
  "pii-present": (c) => c.piiPresent === true,
33
- "rate-limit-exceeded": (c, cfg) => typeof c.callCount === "number" && c.callCount > Number(cfg?.max ?? 0)
33
+ "rate-limit-exceeded": (c, cfg) => typeof c.callCount === "number" && c.callCount > Number(cfg?.max ?? 0),
34
+ // Trust guidance (MetaMynd Trust Index / HCS-28). Fires when the counterparty's trust score is
35
+ // below a soft REVIEW line — intended to author an ESCALATE (route to a human), NOT a hard block.
36
+ // The score is server-derived (signed-last) so the agent's itinerary can't fake it; when no score
37
+ // is present (e.g. no counterparty resolved) the atom simply does not fire — no guidance.
38
+ "hol-trust-below-review": (c, cfg) => typeof c.holTrustScore === "number" && c.holTrustScore < Number(cfg?.reviewBelow ?? 60)
34
39
  };
35
40
  function notInAllowList(value, allowList) {
36
41
  const v = value != null ? String(value).toLowerCase().trim() : "";
@@ -133,6 +138,13 @@ var ATOM_SPECS = [
133
138
  description: "Fires when the rolling call count exceeds a configured maximum.",
134
139
  config: [{ key: "max", type: "number", required: true, description: "Maximum allowed calls" }],
135
140
  requiredContext: ["callCount"]
141
+ },
142
+ {
143
+ predicate: "hol-trust-below-review",
144
+ label: "Counterparty trust below review line",
145
+ description: "Routes to human review when the counterparty's MetaMynd Trust Index (HCS-28) score is below a soft review line. Guidance, not a hard block \u2014 author it with an ESCALATE decision. The score is resolved server-side; no counterparty score \u2192 the atom does not fire.",
146
+ config: [{ key: "reviewBelow", type: "number", required: true, description: "Trust score (0\u2013100) below which a human is asked to decide" }],
147
+ requiredContext: ["holTrustScore"]
136
148
  }
137
149
  ];
138
150
  var CATALOGUED_ATOMS = ATOM_SPECS.filter((s) => !!ATOM_REGISTRY[s.predicate]);