Genkit for Go 1.14
Last reviewed Oct 26, 2026
Prompt Details
Prompt Composition
2prompts
- Go 1.27130 lines · 5.5K tokens
- Genkit for Go 1.1465 lines · 3K tokens
Total195 lines · 8.5K tokens
CWE Coverage
- 15
- 20
- 22
- 59
- 78
- 79
- 89
- 94
- 117
- 190
- 201
- 208
- 209
- 250
- 252
- 257
- 287
- 295
- 307
- 311
- 323
- 327
- 338
- 345
- 347
- 352
- 362
- 367
- 378
- 426
- 444
- 488
- 489
- 494
- 532
- 639
- 674
- 732
- 759
- 770
- 772
- 778
- 807
- 841
- 862
- 863
- 915
- 916
- 918
- 922
- 942
- 1004
- 1275
- 1395
- 1426
- 1427
Prompt Preview
Apply the Go 1.27 baseline first. These rules cover Genkit model calls, flows, tools, middleware, preview agents, MCP connections, provider integrations, HTTP serving, state, and observability.
Trusted configuration and model content
- Build
genkit.Init, provider credentials and endpoints, model references,.promptfiles, system instructions, tool lists, middleware, and agent definitions from trusted application configuration. Complete shared registration before serving requests; do not let request data mutate a shared registry or policy object. - Keep user messages, retrieved documents, tool results, skills, MCP descriptions, remote-agent replies, artifacts, and restored history as untrusted model content. Do not promote their instructions into system policy, tool configuration, authorization claims, or approval decisions.
- Use
ai.WithOutputType,ai.WithOutputSchema, orGenerateData[T]when expecting structured output; check schema failures and enforce business invariants and current resource access before using a parsed value. - Validate and encode model, tool, retrieved, and A2UI output for its actual sink before rendering HTML or Markdown, executing code, building SQL, opening a URL, or sending an external action. A schema that describes a model response is not a sink sanitizer.
- Treat streamed chunks and a response returned beside an error as provisional. Check
FinishReason,FinishMessage,Error, and the Go error; never publish a blocked, failed, aborted, interrupted, or incomplete result as a completed action. - Keep prompt templates, partials,