Mastra 1.63.2

Last reviewed Sep 24, 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.63.283 lines · 3.7K tokens
Total332 lines · 13.7K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 73
  • 78
  • 79
  • 88
  • 89
  • 95
  • 113
  • 117
  • 200
  • 201
  • 208
  • 209
  • 214
  • 250
  • 287
  • 295
  • 297
  • 306
  • 319
  • 323
  • 330
  • 338
  • 346
  • 347
  • 352
  • 354
  • 362
  • 367
  • 377
  • 426
  • 444
  • 459
  • 471
  • 488
  • 494
  • 502
  • 524
  • 532
  • 602
  • 639
  • 653
  • 732
  • 754
  • 770
  • 772
  • 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 target @mastra/core 1.63.2 and the companion APIs documented at that release. Core requires Node.js >=22.13.0; use Node.js 24.

Server exposure and authentication

  • Configure server.auth before exposing the API or Studio. With no auth configured, built-in and custom routes are public; setting requiresAuth: true on a route does not establish an identity provider.
  • Update server.auth.protected and server.auth.public whenever server.apiPrefix changes. The defaults protect /api/* and exempt /api and /api/auth/*; verify coverage of every deployed route and method under the actual prefix.
  • Keep requiresAuth: false and public path patterns limited to intentionally public endpoints. Mastra skips user middleware on routes declared public with requiresAuth: false, so protect webhook actions inside their handler or an upstream boundary.
  • Install security middleware through the serving framework's supported API. server.middleware uses Hono handlers and does not run on Express, Fastify, or Koa adapters; those adapters need their native middleware. Middleware paths must explicitly include the configured API prefix.
  • Resolve identity with getAuthenticatedUser() when Hono middleware needs the verified user: server.middleware runs before per-route authentication. Implement resource authorization in authorizeUser() or application policy rather than accepting any user with an ID.
  • Restrict server.cors.origin from its '*' default to approved browser origins and enable credentials only