create-metamynd-agent 0.10.3 → 0.10.10

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 +65 -2
  2. package/index.mjs +1324 -95
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -104,7 +104,11 @@ Answer a few prompts (API, owner email/password, agent name, scope, per-transact
104
104
 
105
105
  ```
106
106
  my-agent/
107
- ├─ agent.metamynd.json # portable guard config — HOLDS THE AGENT SECRET KEY (gitignored)
107
+ ├─ agent.metamynd.json # portable guard config — HOLDS THE AGENT SECRET KEY (gitignored). This
108
+ │ # is the freshly-minted key from THIS scaffold, not a re-download — the
109
+ │ # dashboard's own "Redownload config" for an EXISTING agent never re-issues
110
+ │ # the key into a downloaded file (it's excluded there by design). --byok /
111
+ │ # --daemon-socket instead keep the key off this CLI's process entirely.
108
112
  ├─ index.mjs # runnable example: signs + calls ./gateway; guardTool() here is a
109
113
  │ # fast local pre-check, NOT the enforcement boundary
110
114
  ├─ package.json # depends on @metamynd/agentsafe-guard
@@ -220,10 +224,13 @@ METAMYND_PASSWORD='…' npx create-metamynd-agent --yes …
220
224
  | Flag | Env | Default |
221
225
  |---|---|---|
222
226
  | `--harness` | — | off (no login/KYB/network at all; free local governance — see above) |
227
+ | `--gateway` | — | off — `--harness` only; ALSO scaffold a second local process (still zero network, zero account) that independently re-verifies every request via the real `@metamynd/agentsafe-mcp-guard`. Does not close nonce replay/cumulative spend — see the generated `harness-gateway/README.md#--gateway`. |
223
228
  | `--sandbox` | — | off (skips login/KYB; shared sandbox agent, still hosted) |
224
229
  | `--config <file>` | — | a JSON policy file — see [Policy config file](#policy-config-file---config) |
230
+ | `--non-financial` | — | off — the agent does not move money: no spend limits, no payment demo, demo derived from your own rules. Works in every mode: `--harness`, the default hosted flow, `--sandbox`, and `--request` / `--claim`. Implied by a `--config` file with no spend limit, no `merchants` and no monetary rule; `--financial` opts back in. See [Non-financial agents](#non-financial-agents). |
225
231
  | `--no-gateway` | — | off — hosted flow only; skips the default separate tool gateway (see above) |
226
- | `--gateway-port <n>` | — | `4401` — hosted flow only, the gateway process's port |
232
+ | `--gateway-port <n>` | — | `4401` — hosted flow or `--harness --gateway`, the gateway process's port |
233
+ | `--force`, `-f` | — | off — scaffold into a non-empty directory, overwriting existing files |
227
234
  | `--port <n>` | — | `4400` — `--harness` only, the local dashboard's port |
228
235
  | `--api <url>` | `METAMYND_API` | `https://metamynd.ai/api/v1` |
229
236
  | `--email <email>` | `METAMYND_EMAIL` | — (required) |
@@ -279,6 +286,62 @@ Any CLI flag still overrides the matching field from the file (`--config base.js
279
286
  Bot"`), and login credentials are never read from the file — use `--email`/`METAMYND_EMAIL` and
280
287
  `METAMYND_PASSWORD` as usual, so a policy file is safe to commit.
281
288
 
289
+ ## Non-financial agents
290
+
291
+ Not every governed agent moves money. A customer-communications, healthcare-referral or
292
+ recruitment agent has no per-transaction cap and no currency, and a scaffold that invents them —
293
+ or demonstrates a flight booking — teaches the wrong policy. This works with `--harness` **and**
294
+ with the default hosted flow (login + provision):
295
+
296
+ - **A `--config` file is the whole policy.** If it sets no `perTxnMax` / `maxAmount` / `currency`,
297
+ lists no `merchants`, and contains no `amount-over` / `amount-unknown` / `cumulative-over` rule,
298
+ nothing money-shaped is added, and the scaffold says so. A file that only names a `rulePack` is
299
+ never assumed non-financial. Set `"financial": true` in the file (or pass `--financial`) to opt
300
+ back in; `"financial": false` or `--non-financial` forces the other way.
301
+ - **No spend constraint anywhere.** The mandate carries none and the default SOP has no amount rule
302
+ (an `amount-unknown` block would refuse every action that carries no amount). Hosted: the
303
+ provisioning call sends no `currency` / `maxAmount` / `perTxnMax` at all — the backend treats their
304
+ absence as a non-financial mandate. A `rulePack` is built from spend limits, so it is ignored (and
305
+ the CLI says so); list your rules under `rules` instead.
306
+ - **The demo is derived from your rules.** `npm start` runs one request that satisfies every rule,
307
+ then one per rule that should trip it, then an action nobody delegated. Each step states what it
308
+ expects and flags any surprise, so changing your rules visibly changes the outcome. Rules the demo
309
+ cannot stage (monetary rules, the platform-derived trust score, `observe` decisions, rules that
310
+ share an input with another rule) are listed in the scaffold output and the generated README —
311
+ never faked, still enforced.
312
+ - **The generated README lists the request fields your rules read** (`consent`, `piiPresent`,
313
+ `jurisdiction`, …). An allow-list, consent or PII rule does not fire when its field is absent, so
314
+ your application must supply it. These fields are asserted by the calling agent.
315
+
316
+ **Hosted specifics.** The default shape is still agent + `gateway/`. The gateway runs with
317
+ `requireAuthorization: false` and a route with no value fields: the guard only seals a single-use
318
+ authorization for a value-bearing action, and this agent has no spending authority, so requiring one
319
+ would refuse every allowed request. The consequence — **replay of an identical signed request is not
320
+ refused** — is stated in the generated `gateway/README.md`, not glossed over. `npm test` runs
321
+ `agentsafe-guard verify --context ./verify-context.json`: the context is the request fields of a
322
+ compliant request, because a policy that *requires* an input blocks a request without it. Controls a
323
+ non-financial mandate does not set (a spend cap) are reported as "not configured", never as passed.
324
+
325
+ **Every mode honours it.**
326
+
327
+ - `--sandbox --non-financial` uses a shared sandbox agent that has **no spend authority** (it is its own agent,
328
+ not a spend tier). The shared agent's rules are the platform's defaults, so the demo is derived from those; a
329
+ `--config` file's rules cannot reach an agent you do not provision yourself, and the CLI says so.
330
+ - `--request --non-financial` asks the owner to approve **no spending authority**. The request says so
331
+ explicitly (`financial: false`); the owner's approval screen reads "no spending authority — this agent does
332
+ not move money" instead of a limit; and on approval the platform provisions the agent with no spend fields
333
+ (it does not apply the defaults it applies to an ordinary request). `--claim` then scaffolds the payment-free
334
+ project. `--claim` follows what was **issued**: an approved agent whose config says `financial: false` never
335
+ gets a payment demo, and a mismatch either way (you asked for non-financial but the config does not say it is
336
+ one; `--financial` on a non-financial agent) stops instead of scaffolding.
337
+ - **An older server cannot honour it, and the CLI will not pretend it did.** A server that predates this ignores the
338
+ field: it would return the shared payment agent (`--sandbox`) or file the request with default spend limits
339
+ (`--request`). The CLI checks the server's `financial: false` echo and stops with an explanation. For
340
+ `--request` it also tells you which request now exists so the owner can deny it; no claim file is saved for it.
341
+
342
+ Flag-only scaffolds (no policy file) keep the historical payment defaults; when none of
343
+ `--per-txn-max` / `--max-amount` / `--currency` was given, the CLI now prints the defaults it used.
344
+
282
345
  ## Bring your own key (`--byok`)
283
346
 
284
347
  ```bash