@mnemom/mnemom 0.17.9-next.0 → 0.17.9
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.
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
* governed identity `agent-<handle>`. This module makes that identity REAL in
|
|
7
7
|
* their Mnemom org: it births the agent through the gateway, claims it (so the
|
|
8
8
|
* customer owns it), and publishes a sane default coding posture. The CARDS are
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* OFF by default (operator 2026-10-02: alignment and protection analysis are
|
|
10
|
+
* billed, so nobody pays for them until they turn them on); the goal contract is
|
|
11
|
+
* what nudges (re-anchor on drift). Specifically:
|
|
12
|
+
* - alignment card: autonomy_mode + integrity_mode = off,
|
|
12
13
|
* principal.relationship = delegated_authority, coding bounded/forbidden
|
|
13
14
|
* actions, escalate-on-irreversible;
|
|
14
|
-
* - protection card: mode =
|
|
15
|
-
* screen_surfaces
|
|
15
|
+
* - protection card: mode = off, thresholds 0.60/0.80/0.95 and all four
|
|
16
|
+
* screen_surfaces declared, ready for when it is turned on.
|
|
16
17
|
* - goal-alignment: nudge — sealed per-conversation via the goal contract
|
|
17
18
|
* (--goal …), graded and re-anchored by the gateway.
|
|
18
19
|
*
|
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
* governed identity `agent-<handle>`. This module makes that identity REAL in
|
|
7
7
|
* their Mnemom org: it births the agent through the gateway, claims it (so the
|
|
8
8
|
* customer owns it), and publishes a sane default coding posture. The CARDS are
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* OFF by default (operator 2026-10-02: alignment and protection analysis are
|
|
10
|
+
* billed, so nobody pays for them until they turn them on); the goal contract is
|
|
11
|
+
* what nudges (re-anchor on drift). Specifically:
|
|
12
|
+
* - alignment card: autonomy_mode + integrity_mode = off,
|
|
12
13
|
* principal.relationship = delegated_authority, coding bounded/forbidden
|
|
13
14
|
* actions, escalate-on-irreversible;
|
|
14
|
-
* - protection card: mode =
|
|
15
|
-
* screen_surfaces
|
|
15
|
+
* - protection card: mode = off, thresholds 0.60/0.80/0.95 and all four
|
|
16
|
+
* screen_surfaces declared, ready for when it is turned on.
|
|
16
17
|
* - goal-alignment: nudge — sealed per-conversation via the goal contract
|
|
17
18
|
* (--goal …), graded and re-anchored by the gateway.
|
|
18
19
|
*
|
|
@@ -197,20 +198,20 @@ export async function ensureGovernedAgent(opts) {
|
|
|
197
198
|
say(fmt.section("Set up a governed coding agent"));
|
|
198
199
|
say(fmt.label(" Agent:", slug));
|
|
199
200
|
say(fmt.label(" Org:", orgLabel));
|
|
200
|
-
say(fmt.label(" Posture:", "
|
|
201
|
+
say(fmt.label(" Posture:", "alignment + protection off (turn them on with `mnemom card` / `mnemom protection`); goal contracts nudge"));
|
|
201
202
|
say(fmt.dim(" Births the agent through the gateway, claims it to your org, and publishes its cards."));
|
|
202
203
|
if (!(await askYesNo("Provision and claim this agent now?", true))) {
|
|
203
204
|
say(fmt.dim(" Skipped — launching under the unclaimed identity. Run `mnemom agent setup` anytime."));
|
|
204
205
|
return { slug, provisioned: false };
|
|
205
206
|
}
|
|
206
207
|
}
|
|
207
|
-
// 5. Birth → claim → publish
|
|
208
|
+
// 5. Birth → claim → publish the default (off) cards. (Key never logged.)
|
|
208
209
|
const gatewayUrl = opts.gatewayHost.replace(/\/+$/, "");
|
|
209
210
|
const agentId = await birthThroughGateway(gatewayUrl, "anthropic", slug, opts.anthropicKey);
|
|
210
211
|
const hashProof = deriveHashProof(opts.anthropicKey, slug);
|
|
211
212
|
await claimAgent(agentId, { hashProof, orgId: org?.org_id });
|
|
212
213
|
say(fmt.success(`mnemom agent: claimed '${slug}' (${agentId}) in ${orgLabel}.`));
|
|
213
|
-
// Publish the
|
|
214
|
+
// Publish the default (off) cards. A card write that can't complete (propagation
|
|
214
215
|
// right after the claim, or a missing cards:write scope) does NOT abort the
|
|
215
216
|
// provision — the agent is claimed and governed on whatever landed; we warn how
|
|
216
217
|
// to finish it. So `provisioned` reflects the claim, not a perfect card set.
|
|
@@ -273,7 +274,7 @@ async function tryPublishCard(name, write) {
|
|
|
273
274
|
}
|
|
274
275
|
return { name, ok: false, error: "unknown error" };
|
|
275
276
|
}
|
|
276
|
-
/** Publish both default
|
|
277
|
+
/** Publish both default (off) cards; never throws — warns on a card that can't be written. */
|
|
277
278
|
async function publishDefaultCards(agentId) {
|
|
278
279
|
const align = await tryPublishCard("alignment", () => putAlignmentCard(agentId, JSON.stringify(buildCodeAlignmentCard(agentId)), "application/json"));
|
|
279
280
|
// Protection is the "locked door": it needs a one-time cards:write:protection
|
|
@@ -296,11 +297,11 @@ async function publishDefaultCards(agentId) {
|
|
|
296
297
|
}
|
|
297
298
|
const prot = await tryPublishCard("protection", () => putProtectionCard(agentId, JSON.stringify(buildCodeProtectionCard(agentId)), "application/json"));
|
|
298
299
|
if (align.ok && prot.ok) {
|
|
299
|
-
say(fmt.success("mnemom agent:
|
|
300
|
+
say(fmt.success("mnemom agent: default posture published (alignment + protection off until you turn them on; goal contracts nudge)."));
|
|
300
301
|
return;
|
|
301
302
|
}
|
|
302
303
|
if (align.ok)
|
|
303
|
-
say(fmt.success("mnemom agent: alignment card published (
|
|
304
|
+
say(fmt.success("mnemom agent: alignment card published (off)."));
|
|
304
305
|
for (const c of [align, prot]) {
|
|
305
306
|
if (c.ok)
|
|
306
307
|
continue;
|
|
@@ -345,7 +346,7 @@ export async function agentSetupCommand(opts = {}) {
|
|
|
345
346
|
}
|
|
346
347
|
function warnUnclaimed(slug) {
|
|
347
348
|
say(fmt.warn(`mnemom agent: agent '${slug}' is not set up in your org — launching with an UNCLAIMED identity (governance is advisory/fail-open).`));
|
|
348
|
-
say(fmt.dim(" Provision it (creates + claims the agent, publishes
|
|
349
|
+
say(fmt.dim(" Provision it (creates + claims the agent, publishes default cards): mnemom agent setup"));
|
|
349
350
|
}
|
|
350
351
|
function persistAgentSlug(slug) {
|
|
351
352
|
try {
|
|
@@ -520,13 +521,13 @@ export async function resolvePreflightedAccount() {
|
|
|
520
521
|
const entitlement = await assertCodeEnabled(active?.org_id ?? "", orgLabel);
|
|
521
522
|
return { orgId: active?.org_id ?? entitlement?.org_id ?? "", orgLabel, entitlement };
|
|
522
523
|
}
|
|
523
|
-
// ── The default coding posture (cards
|
|
524
|
+
// ── The default coding posture (cards off; goal contracts nudge) ─────────────
|
|
524
525
|
function buildCodeAlignmentCard(agentId) {
|
|
525
526
|
return {
|
|
526
527
|
card_version: "unified/2026-04-26",
|
|
527
528
|
agent_id: agentId,
|
|
528
|
-
autonomy_mode: "
|
|
529
|
-
integrity_mode: "
|
|
529
|
+
autonomy_mode: "off",
|
|
530
|
+
integrity_mode: "off",
|
|
530
531
|
principal: { type: "agent", identifier: agentId, relationship: "delegated_authority" },
|
|
531
532
|
values: {
|
|
532
533
|
declared: ["transparency", "safety", "honesty", "user_control", "harm_prevention"],
|
|
@@ -563,7 +564,7 @@ function buildCodeProtectionCard(agentId) {
|
|
|
563
564
|
return {
|
|
564
565
|
card_version: "protection/2026-04-26",
|
|
565
566
|
agent_id: agentId,
|
|
566
|
-
mode: "
|
|
567
|
+
mode: "off",
|
|
567
568
|
thresholds: { warn: 0.6, quarantine: 0.8, block: 0.95 },
|
|
568
569
|
screen_surfaces: {
|
|
569
570
|
incoming: true,
|
package/dist/commands/card.js
CHANGED
|
@@ -884,8 +884,8 @@ export async function cardEditCommand(agentName, options = {}) {
|
|
|
884
884
|
cardYaml = yaml.dump({
|
|
885
885
|
card_version: "unified/2026-04-26",
|
|
886
886
|
agent_id: agentId,
|
|
887
|
-
autonomy_mode: "
|
|
888
|
-
integrity_mode: "
|
|
887
|
+
autonomy_mode: "off",
|
|
888
|
+
integrity_mode: "off",
|
|
889
889
|
principal: { type: "agent", identifier: agentId, relationship: "delegated_authority" },
|
|
890
890
|
values: { declared: ["transparency", "safety", "honesty"] },
|
|
891
891
|
autonomy: {
|
package/dist/commands/onboard.js
CHANGED
|
@@ -352,7 +352,8 @@ async function earnRating(agentId, steps, say) {
|
|
|
352
352
|
}
|
|
353
353
|
// ── starter alignment card ──────────────────────────────────────────────────────
|
|
354
354
|
/**
|
|
355
|
-
* A starter alignment card
|
|
355
|
+
* A starter alignment card, `off` by default (alignment analysis is billed; the
|
|
356
|
+
* user turns it on) — the honest, minimal declaration
|
|
356
357
|
* of intent for a freshly-onboarded agent. Mirrors the shape `wrap` seeds so the
|
|
357
358
|
* two skill-runners produce a consistent first card.
|
|
358
359
|
*/
|
|
@@ -360,8 +361,8 @@ function buildStarterAlignmentCard(agentId) {
|
|
|
360
361
|
return {
|
|
361
362
|
card_version: "unified/2026-04-26",
|
|
362
363
|
agent_id: agentId,
|
|
363
|
-
autonomy_mode: "
|
|
364
|
-
integrity_mode: "
|
|
364
|
+
autonomy_mode: "off",
|
|
365
|
+
integrity_mode: "off",
|
|
365
366
|
principal: { type: "agent", identifier: agentId, relationship: "delegated_authority" },
|
|
366
367
|
values: { declared: ["transparency", "safety", "honesty"] },
|
|
367
368
|
autonomy: {
|
|
@@ -729,7 +729,7 @@ export async function protectionEditCommand(agentName, options = {}) {
|
|
|
729
729
|
yaml.dump({
|
|
730
730
|
card_version: "protection/2026-04-26",
|
|
731
731
|
agent_id: agentId,
|
|
732
|
-
mode: "
|
|
732
|
+
mode: "off",
|
|
733
733
|
thresholds: { warn: 0.3, quarantine: 0.6, block: 0.9 },
|
|
734
734
|
screen_surfaces: {
|
|
735
735
|
incoming: true,
|
package/dist/commands/wrap.js
CHANGED
|
@@ -256,8 +256,8 @@ function buildStarterAlignmentCard(agentId) {
|
|
|
256
256
|
return {
|
|
257
257
|
card_version: "unified/2026-04-26",
|
|
258
258
|
agent_id: agentId,
|
|
259
|
-
autonomy_mode: "
|
|
260
|
-
integrity_mode: "
|
|
259
|
+
autonomy_mode: "off",
|
|
260
|
+
integrity_mode: "off",
|
|
261
261
|
principal: { type: "agent", identifier: agentId, relationship: "delegated_authority" },
|
|
262
262
|
values: { declared: ["transparency", "safety", "honesty"] },
|
|
263
263
|
autonomy: {
|
|
@@ -272,7 +272,7 @@ function buildStarterProtectionCard(agentId) {
|
|
|
272
272
|
return {
|
|
273
273
|
card_version: "protection/2026-04-26",
|
|
274
274
|
agent_id: agentId,
|
|
275
|
-
mode: "
|
|
275
|
+
mode: "off",
|
|
276
276
|
thresholds: { warn: 0.3, quarantine: 0.6, block: 0.9 },
|
|
277
277
|
screen_surfaces: {
|
|
278
278
|
incoming: true,
|