@mnemom/mnemom 0.17.20 → 0.17.22

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,88 @@
1
+ ---
2
+ name: about-mnemom
3
+ description: Explains Mnemom, the Trust Rating, the gateway and the /mnemom commands in a session launched by `mnemom agent`. Use when the person asks what Mnemom is, what "governed" means here, why the band or the ◆ sign shows, how the Trust Rating is scored or verified, or how to route Claude Code through the Mnemom gateway.
4
+ ---
5
+
6
+ # Mnemom for Claude Code
7
+
8
+ Mnemom is **the trust plane for the agentic internet**: live, cryptographic trust signals for AI
9
+ agents and the sites they act on. Everything Mnemom publishes is signed and independently
10
+ verifiable against its public keys. Site: https://www.mnemom.ai · Docs: https://docs.mnemom.ai ·
11
+ What kind of company it is, for agents: https://www.mnemom.ai/for-agents
12
+
13
+ ## What "governed" means in this session
14
+
15
+ `mnemom agent <session>` launches stock Claude Code with its model traffic routed through the
16
+ Mnemom gateway:
17
+
18
+ - `ANTHROPIC_BASE_URL` points at the gateway's Anthropic door (`<gateway>/anthropic`); the
19
+ Mnemom API key and the governed identity (agent, conversation, goal mode) travel in request
20
+ headers. Under Remote Control a local proxy does the same for the server process.
21
+ - The gateway records every model call as an **integrity checkpoint** on an append-only hash
22
+ chain, applies the agent's **protection posture** (the policy its owner set), and feeds the
23
+ agent's public **Trust Rating**.
24
+ - Nothing about the model or the tools changes: this is governance around the session, not a
25
+ different Claude.
26
+
27
+ This plugin is the visible part: the band above the prompt, the status pane, the ◆ sign on the
28
+ spinner and the turn line, Mnemom trailers in commit attribution, a governance section in the
29
+ system prompt, and a guard that denies Bash commands which would point `ANTHROPIC_BASE_URL`,
30
+ `ANTHROPIC_AUTH_TOKEN` or `ANTHROPIC_CUSTOM_HEADERS` away from the gateway.
31
+
32
+ A session that was NOT launched by `mnemom agent` shows an amber "not governed" band. Nothing is
33
+ recorded for it. Tell the person to launch with `mnemom agent` (install: `npm i -g @mnemom/mnemom`,
34
+ then `mnemom login`).
35
+
36
+ ## The /mnemom commands
37
+
38
+ | Command | What it does |
39
+ | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
40
+ | `/mnemom` or `/mnemom status` | agent, conversation, cell, gateway, shape, goal (mode, statement, requirements, paths, guardrails, verdict), Trust Rating, turn count |
41
+ | `/mnemom goal` | the goal in full: statement, every requirement, path fences, guardrail ceilings + usage, the gateway's latest verdict; sealed shows `mnemom agent show`, implicit `mnemom agent goal show\|pin\|reset` |
42
+ | `/mnemom doctor` | GETs `<gateway>/health` and the Trust Rating endpoint; reports both |
43
+ | `/mnemom verify` | GETs `/v1/reputation/<agent>/verify`: the hash-chain + Merkle-root attestation |
44
+ | `/mnemom panel` / `/mnemom close` | opens or closes the Mnemom status pane (the band's `▸ status` mark opens it too) |
45
+ | `/mnemom hide` / `/mnemom show` | hides or shows the band for this session |
46
+ | `/mnemom help` | the list above |
47
+
48
+ Plugin options (in `/config` or `pluginConfigs["mnemom"]` in settings): `showBand`,
49
+ `requireGovernance` (refuse all tool calls while ungoverned), `guardReroute`, `commitTrailer`,
50
+ `spinnerMark`.
51
+
52
+ ## The Trust Rating
53
+
54
+ Public, no auth: `GET https://api.mnemom.ai/v1/reputation/{agent_id}`.
55
+
56
+ - **score** 0–1000, **grade** AAA · AA · A · BBB · BB · B · CCC · CC · C · D, or **NR** (not
57
+ rated) until the agent has enough checkpoints (the band shows `NR (building n/50)`).
58
+ - **tier** describes the evidence volume; **integrity_ratio** is the public, signed proof of
59
+ chain integrity. Integrity- and alignment-internal detail stays owner-private.
60
+ - Public page: `https://www.mnemom.ai/agents/{agent_id}/reputation`; badge: `.../badge.svg`.
61
+
62
+ Two DISTINCT verification paths; do not conflate them:
63
+
64
+ - `/v1/reputation/{agent_id}/verify` (what `/mnemom verify` calls): a **chain-integrity
65
+ attestation**: Merkle root + `hash_chain_valid`, plus a pointer to a signed integrity
66
+ certificate. Not an in-band signature check.
67
+ - Website scorecards (`scan_trust` on the Mnemom MCP server) are verified **in-band** with Ed25519
68
+ against `https://api.mnemom.ai/.well-known/jwks.json`.
69
+
70
+ ## The Mnemom MCP server
71
+
72
+ This plugin connects `https://api.mnemom.ai/mcp` (HTTP). Zero-auth tools: `get_started`,
73
+ `get_reputation`, `verify_reputation`, `search_reputation_directory`, `scan_trust`, `verify_scan`.
74
+ With a Mnemom credential (Bearer JWT or `X-Mnemom-Api-Key`) it also manages the person's own
75
+ agents: alignment cards, protection postures, governance signals, webhooks, API keys. The docs
76
+ server at `https://docs.mnemom.ai/mcp` answers questions from the published docs.
77
+
78
+ ## When the person asks…
79
+
80
+ - **"Why is there a ◆ on the spinner?"** The session is governed; every model call is being
81
+ checkpointed through the Mnemom gateway. `/mnemom status` shows by whom.
82
+ - **"Can I turn the gateway off for one command?"** Not inside this session: the plugin denies
83
+ it, by design. Use another terminal, or `mnemom agent --no-plugin` for a session without the
84
+ guard (the routing itself still comes from the launcher).
85
+ - **"Is my score good?"** Grades A and up are strong; NR means not enough history yet, not a
86
+ bad score. Point them at the public page for the breakdown.
87
+ - **"Who sees what?"** The public rating and its chain attestation are public. Alignment and
88
+ integrity internals are visible only to the agent's owner.
@@ -0,0 +1,142 @@
1
+ /**
2
+ * The state contract of the `mnemom` mod: every value it keeps in
3
+ * `$.state`, declared under its plugin name. `claude plugin validate` holds the
4
+ * module's `$.state` keys to this file.
5
+ */
6
+
7
+ /** How the session came to be: the non-secret launch facts `mnemom agent` exports. */
8
+ export type MnemomLaunch = {
9
+ /** Gateway origin the session's model traffic goes through (`https://gateway.mnemom.ai`). */
10
+ gatewayHost: string;
11
+ /** Mnemom API origin for the public Trust Rating lookups (`https://api.mnemom.ai`). */
12
+ apiUrl: string;
13
+ /** The governed identity (`x-mnemom-agent`). */
14
+ agent: string;
15
+ /** The conversation id (`x-mnemom-conversation-id`). */
16
+ conversationId: string;
17
+ /** The cell note the launcher printed (`us-2/prod`, `custom (https://…)`). */
18
+ cell: string;
19
+ /** `terminal`, `remote-control` or `server`. */
20
+ shape: string;
21
+ /** `sealed` (a `--goal` contract), `implicit` (the gateway infers the goal) or `off`. */
22
+ goalMode: "sealed" | "implicit" | "off";
23
+ /** The sealed contract's display hash (sha256[0:16]), empty when none. */
24
+ contractSha: string;
25
+ /** The sealed contract as the launcher sealed it; null unless `goalMode` is `sealed`. */
26
+ contract: MnemomContract | null;
27
+ /**
28
+ * The guardrail ceilings the launch asked for: the sealed contract's, or the implicit mode's
29
+ * `--max-turns/--budget/--stall`. All null when none was given.
30
+ */
31
+ ceilings: MnemomCeilings;
32
+ /**
33
+ * The argv that runs the launching `mnemom` again (`[node, …, script]`); the live goal state is
34
+ * read through `mnemom agent show --json`. Empty when the launcher did not say.
35
+ */
36
+ launcherExec: string[];
37
+ /** The launcher's session name (`mnemom agent <session>`). */
38
+ session: string;
39
+ /** The `mnemom` CLI version that launched the session. */
40
+ launcherVersion: string;
41
+ };
42
+
43
+ /** What a `--goal` launch sealed: the person's own words, as sent in `x-mnemom-contract`. */
44
+ export type MnemomContract = {
45
+ goalId: string | null;
46
+ statement: string;
47
+ requirements: string[];
48
+ allowedPaths: string[];
49
+ forbiddenPaths: string[];
50
+ };
51
+
52
+ /** Guardrail ceilings; null = that guardrail is not set. */
53
+ export type MnemomCeilings = {
54
+ maxTurns: number | null;
55
+ budgetUsd: number | null;
56
+ stallTurns: number | null;
57
+ };
58
+
59
+ /** The goal judge's latest word on the conversation. */
60
+ export type MnemomVerdict = {
61
+ /** `aligned` | `drifting` | `violation` (the gateway's own words). */
62
+ verdict: string;
63
+ turn: number | null;
64
+ reason: string | null;
65
+ /** ISO time the verdict was stored, when known. */
66
+ at: string | null;
67
+ };
68
+
69
+ /**
70
+ * The live goal state as the gateway holds it, read through `mnemom agent show --json` (and, in
71
+ * implicit mode, `mnemom agent goal show --json`). Sealed: the gateway's hash and verdict, the
72
+ * guardrail usage. Implicit: the inferred goal (statement, requirements, fences), its revision and
73
+ * pin, the verdict, the guardrail usage.
74
+ */
75
+ export type MnemomGoal =
76
+ | { state: "loading" }
77
+ | { state: "unavailable"; reason: string; fetchedAt: number }
78
+ | {
79
+ state: "live";
80
+ fetchedAt: number;
81
+ /** `sealed` | `implicit`, as the gateway reports it. */
82
+ mode: "sealed" | "implicit";
83
+ /** The gateway's contract hash (sealed) or the intent's contract_hash (implicit). */
84
+ hash: string | null;
85
+ /** Implicit: the inferred goal's revision; null when sealed. */
86
+ revision: number | null;
87
+ /** Implicit: whether the person pinned the goal (`mnemom agent goal pin`). */
88
+ pinned: boolean | null;
89
+ /** Implicit: how many revisions wait for the next turn boundary. */
90
+ pendingCount: number | null;
91
+ /** The goal as the gateway holds it (implicit: inferred; sealed: echoed). */
92
+ statement: string | null;
93
+ requirements: string[];
94
+ allowedPaths: string[];
95
+ forbiddenPaths: string[];
96
+ /** The ceilings the gateway enforces (its view, over the launch's). */
97
+ ceilings: MnemomCeilings;
98
+ /** Guardrail usage so far; null until the gateway has seen a turn. */
99
+ usage: {
100
+ turns: number;
101
+ spendUsd: number;
102
+ stallRun: number;
103
+ /** Which guardrails fired: `turns`, `budget`, `stall`. */
104
+ fired: string[];
105
+ } | null;
106
+ verdict: MnemomVerdict | null;
107
+ /** The gateway's turn counter for the conversation. */
108
+ turn: number | null;
109
+ };
110
+
111
+ /** The agent's public Trust Rating as last fetched from the Mnemom API. */
112
+ export type MnemomReputation =
113
+ | { state: "loading" }
114
+ | {
115
+ state: "rated";
116
+ grade: string;
117
+ score: number;
118
+ tier: string | null;
119
+ checkpointCount: number | null;
120
+ fetchedAt: number;
121
+ }
122
+ | { state: "unrated"; checkpointCount: number | null; fetchedAt: number }
123
+ | { state: "error"; reason: string; fetchedAt: number };
124
+
125
+ declare module "claude-code" {
126
+ interface PluginState {
127
+ mnemom: {
128
+ /** The launch facts, or null when the session was not launched by `mnemom agent`. */
129
+ launch: MnemomLaunch | null;
130
+ /** The Trust Rating, or null before the first lookup. */
131
+ reputation: MnemomReputation | null;
132
+ /** Whether the person hid the band for this session. */
133
+ isHidden: boolean;
134
+ /** Turns completed in this session. */
135
+ turns: number;
136
+ /** The intro animation's frame while it plays on the band; -1 once it is over. */
137
+ introFrame: number;
138
+ /** The live goal state, or null when the session is not governed. */
139
+ goal: MnemomGoal | null;
140
+ };
141
+ }
142
+ }