Genkit for Dart 1.0

Last reviewed Oct 26, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. Dart 3.13109 lines · 2.9K tokens
  2. Genkit for Dart 1.058 lines · 2.8K tokens
Total167 lines · 5.7K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 78
  • 79
  • 201
  • 209
  • 287
  • 295
  • 323
  • 338
  • 362
  • 367
  • 377
  • 426
  • 532
  • 602
  • 636
  • 639
  • 704
  • 770
  • 772
  • 798
  • 807
  • 841
  • 862
  • 863
  • 915
  • 918
  • 922
  • 940
  • 942
  • 1333
  • 1395
  • 1426
  • 1427

Prompt Preview

Apply the Dart 3.13 prompt first. These rules cover Genkit's stable generation, tool, flow, prompt, and HTTP APIs, plus the experimental agents and the companion integrations when the application uses them.

API and deployment boundaries

  • Keep the resolved genkit, schemantic, provider, Shelf, middleware, MCP, and session-store packages in the application's lockfile; review each companion package's behavior when it changes because they are published separately. Treat experimental.dart, experimental_client.dart, experimental_io.dart, and genkit_middleware/agents.dart as APIs that can change on a minor release.
  • Register only intended flows, tools, models, and agents on GenkitRouter; addAction can expose more than flows, and addAgent also mounts snapshot and abort routes for a store-backed agent.
  • Supply a contextProvider to every protected addAction, addAgent, ioHandler, or Shelf shelfHandler route. Verify credentials there, reject missing or invalid credentials, and derive principal and tenant context server-side; a returned empty map still allows the action to run.
  • Authorize the requested operation and resource again inside each flow and tool using verified context. Do not trust an input uid, sessionId, snapshotId, model choice, or tool schema as proof of access, and cover direct action calls outside HTTP.
  • Put request byte limits, read deadlines, accepted media types, and concurrency limits at the HTTP server or Shelf boundary before Genkit parses input; bound streamed responses and return safe errors. Handle a