Mastra 1.64.0

Last reviewed Sep 20, 2026

Export as PDF

Prompt Details

Prompt Composition

4prompts
  1. JavaScript ES2026102 lines · 3.1K tokens
  2. Node.js 24101 lines · 5.3K tokens
  3. TypeScript 746 lines · 1.5K tokens
  4. Mastra 1.64.0164 lines · 5.7K tokens
Total413 lines · 15.6K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 73
  • 78
  • 79
  • 88
  • 89
  • 95
  • 113
  • 117
  • 200
  • 201
  • 208
  • 209
  • 214
  • 250
  • 295
  • 297
  • 306
  • 319
  • 323
  • 330
  • 338
  • 345
  • 346
  • 347
  • 352
  • 354
  • 362
  • 367
  • 377
  • 426
  • 444
  • 459
  • 471
  • 488
  • 494
  • 502
  • 522
  • 524
  • 532
  • 552
  • 598
  • 602
  • 613
  • 639
  • 653
  • 732
  • 754
  • 770
  • 772
  • 778
  • 807
  • 829
  • 837
  • 838
  • 841
  • 862
  • 863
  • 908
  • 915
  • 916
  • 918
  • 922
  • 942
  • 943
  • 1004
  • 1321
  • 1333
  • 1427

Prompt Preview

Apply the Node.js 24 and TypeScript 7 prompts first. These rules cover @mastra/core 1.64.0 and the companion packages documented at that release. Core requires Node.js >=22.13.0, accepts Zod ^3.25.0 or ^4.0.0, and provides both ESM and CommonJS exports. Companion packages have independent version numbers.

Server exposure and authentication

  • Configure server.auth before anyone else can reach the process: with no auth provider every built-in route, custom route, and Studio session is public.
  • Update server.auth.protected and server.auth.public whenever you set a custom server.apiPrefix, because the defaults only match /api/* and stop covering built-in routes.
  • Keep SimpleAuth out of production: its tokens live in memory, never expire, are compared without cryptographic verification, and are also read from X-Playground-Access.
  • Verify JWT signatures with MastraJwtAuth or verifyJwks, and enforce expected algorithms, issuer, audience, and expiry in the authentication implementation; decodeToken proves none of these.
  • Write authorizeUser as a real policy decision instead of an existence check such as !!user.id, because it is the last gate before the route handler runs.
  • Review every custom route marked requiresAuth: false, since Mastra skips both route auth and user server.middleware on those paths.
  • Configure an auth provider before splitting workers out, or /api/workflows/:workflowId/runs/:runId/steps/execute and /api/workflows/events accept any caller.
  • Give each worker type its own credential in MASTRA_WORKER_AUTH_TOKEN, carry