Mastra 1.79.0
Last reviewed Oct 25, 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.79.045 lines · 2.4K tokens
Total294 lines · 12.3K tokens
CWE Coverage
- 20
- 22
- 59
- 73
- 78
- 79
- 88
- 89
- 94
- 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
- 522
- 524
- 532
- 602
- 639
- 653
- 732
- 754
- 770
- 807
- 829
- 838
- 841
- 862
- 863
- 908
- 915
- 916
- 918
- 922
- 942
- 943
- 1004
- 1321
- 1333
- 1427
Prompt Preview
Apply these rules to Mastra agents, workflows, tools, MCP integrations, and the server surfaces you expose. Treat @mastra/core as the pack identity; check companion packages against their own APIs and release notes because they have independent versions.
Server identity and authorization
- Configure
server.authfor every deployed Mastra API that is not intentionally public. Without it, built-in routes are public;requiresAuth: truedoes not create an authenticator. AuditrequiresAuth: false,customRouteAuthConfig, adapter routes, Studio access, MCP REST routes, and any changedserver.apiPrefix. Verify public webhook signatures before using their bodies. - When using custom
server.auth.authenticateToken, verify issuer, audience, signature, and expiry appropriate to the credential. Derive a stable tenant-and-user ownership key from the verified identity withmapUserToResourceId; do not acceptmemory.resource, thread IDs, or request-body context as proof of ownership. Reject a request when the expected server-derived resource key is absent. - Carry the authenticated principal in server-owned
RequestContextkeys and pass it explicitly when invoking an agent or workflow outside an HTTP handler. Derive record filters and outbound credentials insidecreateTool().execute(inputData, context)or workflow steps from that trusted context; authorize the principal, operation, arguments, and resource at the point of use. A tool schema, model decision, approval click, or instruction is not permission. - If using Enterprise FGA, configure
server.fgapermission