create-metamynd-agent 0.7.7 → 0.7.8
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/index.mjs +18 -8
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -777,7 +777,12 @@ async function bookFlight(args) {
|
|
|
777
777
|
|
|
778
778
|
// One protected route: only a request signed by this agent, for exactly this action, and
|
|
779
779
|
// re-verified against this agent's own mandate/SOP, reaches bookFlight() below.
|
|
780
|
-
|
|
780
|
+
//
|
|
781
|
+
// valueFields is explicit on purpose, not left to the gateway's own default (which would be
|
|
782
|
+
// this exact list anyway): a route with a real amount/merchant should always say so itself,
|
|
783
|
+
// rather than relying on a library default to guess right. A route with NO value concept at
|
|
784
|
+
// all (a read, a status check) should set valueFields: [] instead — see the gateway's README.
|
|
785
|
+
const routes = [{ method: 'POST', path: '/book-flight', action: '${scope}', valueFields: ['amount', 'merchant'] }];
|
|
781
786
|
|
|
782
787
|
// No serviceKey: this minimal gateway only calls verifyRequest() (re-check a signed request),
|
|
783
788
|
// not the mutual-handshake methods, which are the only thing that needs it.
|
|
@@ -917,13 +922,18 @@ own code, or a network attacker) might attempt:
|
|
|
917
922
|
- **Direct call.** \`bookFlight()\` doesn't exist in the agent's process. There's nothing to call.
|
|
918
923
|
- **Confused deputy (payload).** The gateway re-verifies the signed request against this agent's
|
|
919
924
|
own policy AND binds it to the actual request body (payload binding,
|
|
920
|
-
\`@metamynd/agentsafe-http-gateway\` ≥ 0.4.
|
|
921
|
-
expensive one is refused before the tool ever runs.
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
925
|
+
\`@metamynd/agentsafe-http-gateway\` ≥ 0.4.5) — signing a cheap request while executing an
|
|
926
|
+
expensive one is refused before the tool ever runs. This route's \`valueFields: ['amount',
|
|
927
|
+
'merchant']\` (see \`server.mjs\`) is an explicit, server-controlled requirement, not a guess
|
|
928
|
+
inferred from anything the signed request itself declares — that distinction is what closes
|
|
929
|
+
the full history below, not just the most recent case in it. Earlier attempts checked
|
|
930
|
+
progressively weaker versions of "is this real": 0.3.0 only refused a body offering NONE of
|
|
931
|
+
the governed fields (a correct decoy in one field let the other hide nested, renamed, an
|
|
932
|
+
array, or an entirely empty/non-JSON body); 0.4.0–0.4.2 required a field only when the
|
|
933
|
+
SIGNED request's own value for it looked "real," which a signer could defeat by signing
|
|
934
|
+
\`amount: 0\` — or, identically, by never signing an amount at all, since both verify against
|
|
935
|
+
the exact same canonical message. \`valueFields\` moves the requirement to something the
|
|
936
|
+
signer never controls at all.
|
|
927
937
|
- **Replay.** \`requireAuthorization: true\` (set in \`server.mjs\`) requires the agent's
|
|
928
938
|
\`authorizationId\` — from a REAL \`guard.authorize()\` call, which \`index.mjs\` already makes for
|
|
929
939
|
any value-bearing action by default — to atomically claim single-use execution against the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-metamynd-agent",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.8",
|
|
4
4
|
"description": "Scaffold a MetaMynd/AgentSafe-governed AI agent in one command — logs in, provisions the agent (identity + mandate + SOP + Standards) in a single call, writes agent.metamynd.json plus a runnable agent + separate tool-gateway process that closes direct-call, confused-deputy, replay, and cumulative-spend bypasses. --harness scaffolds a free, local, zero-network governance harness instead.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|