create-metamynd-agent 0.10.5 → 0.10.16
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.
- package/README.md +67 -0
- package/index.mjs +1354 -90
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -227,6 +227,7 @@ METAMYND_PASSWORD='…' npx create-metamynd-agent --yes …
|
|
|
227
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`. |
|
|
228
228
|
| `--sandbox` | — | off (skips login/KYB; shared sandbox agent, still hosted) |
|
|
229
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). |
|
|
230
231
|
| `--no-gateway` | — | off — hosted flow only; skips the default separate tool gateway (see above) |
|
|
231
232
|
| `--gateway-port <n>` | — | `4401` — hosted flow or `--harness --gateway`, the gateway process's port |
|
|
232
233
|
| `--force`, `-f` | — | off — scaffold into a non-empty directory, overwriting existing files |
|
|
@@ -285,6 +286,62 @@ Any CLI flag still overrides the matching field from the file (`--config base.js
|
|
|
285
286
|
Bot"`), and login credentials are never read from the file — use `--email`/`METAMYND_EMAIL` and
|
|
286
287
|
`METAMYND_PASSWORD` as usual, so a policy file is safe to commit.
|
|
287
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
|
+
|
|
288
345
|
## Bring your own key (`--byok`)
|
|
289
346
|
|
|
290
347
|
```bash
|
|
@@ -331,6 +388,16 @@ polls until the owner approves, then scaffolds the project (the same default two
|
|
|
331
388
|
the full flow above — `--no-gateway`/`--gateway-port` work here too). With `--byok` the keypair is
|
|
332
389
|
generated locally and control is proven on claim — MetaMynd never sees the private key.
|
|
333
390
|
|
|
391
|
+
## Risk: say it, or have your owner set it
|
|
392
|
+
|
|
393
|
+
The starter rules include a high-risk review. A request that sends **no** `riskLevel` (or an unrecognised one)
|
|
394
|
+
is no longer waved through: it is **escalated** (`CONTEXT_UNVERIFIABLE`) for a human, because an agent that omits
|
|
395
|
+
its risk is indistinguishable from one hiding it. The scaffolded financial examples send `riskLevel` (`'low'`
|
|
396
|
+
unless you say otherwise) — that default is a placeholder, not an assessment — and the neutral template passes
|
|
397
|
+
your own `args` as the context, so include it there. A real integration should send an honest one — or, better, not depend on the agent at all: a mandate
|
|
398
|
+
permission can carry an owner-set `riskTier` that no claim can lower, and a gateway route can derive the risk
|
|
399
|
+
itself with `route.trustedContext` (`@metamynd/agentsafe-http-gateway` 0.10.0). See MAGP §6.3.
|
|
400
|
+
|
|
334
401
|
## Security
|
|
335
402
|
|
|
336
403
|
`agent.metamynd.json` contains the agent's **secret key** (a managed key, or — with `--byok` — the one
|