Genkit for JavaScript 1.41.0

Last reviewed Sep 19, 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. Genkit for JavaScript 1.41.081 lines · 3.6K tokens
Total330 lines · 13.5K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 73
  • 78
  • 79
  • 88
  • 89
  • 95
  • 113
  • 117
  • 200
  • 208
  • 209
  • 214
  • 250
  • 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 the Node.js 24 and TypeScript 7 prompts first. These rules target Genkit for JavaScript 1.41.0 on Node.js 24. Apply the beta agent, interrupt, and optional integration rules when those features are used.

Configuration and prompt authority

  • Use the stable genkit entry point unless a feature requires genkit/beta; review beta behavior on every minor upgrade because beta APIs do not have the stable channel's compatibility guarantee.
  • Build ai.generate() options from server policy. Allowlist any client-selectable model or preset; never spread a request body into model, system, config, tools, resources, use, or context.
  • Protect Dotprompt files, front matter, helpers, partials, prompt names, and variants as application configuration. genkit() loads ./prompts by default; set a trusted promptDir, or promptDir: null when automatic loading is unnecessary.
  • Pass user text and retrieved material as untrusted prompt data. Reconstruct conversation history from authorized state instead of accepting arbitrary client-supplied system messages, model messages, tool responses, or resumed metadata; prompt delimiters do not enforce authorization.

Flow authentication and HTTP exposure

  • Authenticate exposed flows with verified credentials in expressHandler(..., { contextProvider }), fetchHandler(..., { contextProvider }), withFlowOptions(), or equivalent server middleware. An omitted context provider does not reject unauthenticated requests.
  • Validate a configured key before calling apiKey(requiredKey) from genkit/context. apiKey() and