Genkit for Go 1.12.0
Last reviewed Sep 24, 2026
Prompt Details
Prompt Composition
2prompts
- Go 1.27130 lines · 5.5K tokens
- 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: repeatedai.WithToolsandai.WithUseaccumulate, 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
.promptfiles, partials, helpers, andgenkit.WithPromptDirorWithPromptFSassets only from trusted deployment sources. Pass user values throughai.WithInputor typed content functions; never construct template source from user text.WithPromptandWithSystemcompile templates in prompt definitions, while content-function results andWithMessagestext 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.Messageobjects or agent inputs. - Control
Prompt.Executeoverrides explicitly. Execution-timeWithDocsreplaces the prompt's documents and suppressesWithDocsFn; do not let a caller substitute documents for an authorized