Mastra 1.63.2
Last reviewed Sep 24, 2026
Prompt Details
Prompt Composition
4prompts
- JavaScript ES2026102 lines · 3.1K tokens
- Node.js 24101 lines · 5.3K tokens
- TypeScript 746 lines · 1.5K tokens
- 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.authbefore exposing the API or Studio. With no auth configured, built-in and custom routes are public; settingrequiresAuth: trueon a route does not establish an identity provider. - Update
server.auth.protectedandserver.auth.publicwheneverserver.apiPrefixchanges. The defaults protect/api/*and exempt/apiand/api/auth/*; verify coverage of every deployed route and method under the actual prefix. - Keep
requiresAuth: falseand public path patterns limited to intentionally public endpoints. Mastra skips user middleware on routes declared public withrequiresAuth: false, so protect webhook actions inside their handler or an upstream boundary. - Install security middleware through the serving framework's supported API.
server.middlewareuses 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.middlewareruns before per-route authentication. Implement resource authorization inauthorizeUser()or application policy rather than accepting any user with an ID. - Restrict
server.cors.originfrom its'*'default to approved browser origins and enable credentials only