Genkit for Go 1.12.0

Last reviewed Sep 24, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. Go 1.27130 lines · 5.5K tokens
  2. Genkit for Go 1.12.069 lines · 3.5K tokens
Total199 lines · 9K tokens

CWE Coverage

  • 15
  • 20
  • 22
  • 59
  • 78
  • 79
  • 89
  • 94
  • 117
  • 190
  • 201
  • 208
  • 209
  • 250
  • 252
  • 257
  • 287
  • 295
  • 307
  • 323
  • 327
  • 338
  • 345
  • 347
  • 352
  • 362
  • 367
  • 378
  • 426
  • 444
  • 488
  • 489
  • 494
  • 532
  • 639
  • 674
  • 732
  • 759
  • 770
  • 772
  • 807
  • 841
  • 862
  • 915
  • 916
  • 918
  • 922
  • 942
  • 1004
  • 1275
  • 1395
  • 1426
  • 1427

Prompt Preview

Apply the Go 1.27 baseline first. These rules cover github.com/firebase/genkit/go v1.12.0, whose module requires Go 1.25 or later. Enable genkit.WithExperimental() only for deliberately adopted preview APIs; agent, session, and durable-streaming rules below apply when those features are used.

Configuration and prompt authority

  • Construct genkit.Init, model references, schemas, tools, resources, and middleware from trusted server configuration. Review the final merged options: repeated ai.WithTools and ai.WithUse accumulate, while later model, config, system-prompt, and output-schema options replace earlier values. Do not expose raw generation options as a public request contract.
  • Load .prompt files, partials, helpers, and genkit.WithPromptDir or WithPromptFS assets only from trusted deployment sources. Pass user values through ai.WithInput or typed content functions; never construct template source from user text. WithPrompt and WithSystem compile templates in prompt definitions, while content-function results and WithMessages text are used verbatim.
  • Build message roles and privileged metadata on the server. Keep user text, retrieved documents, tool results, and imported conversations as untrusted content; reject client-supplied system messages, fabricated tool results, and approval metadata before accepting ai.Message objects or agent inputs.
  • Control Prompt.Execute overrides explicitly. Execution-time WithDocs replaces the prompt's documents and suppresses WithDocsFn; do not let a caller substitute documents for an authorized