Google ADK for Go 1.9

Last reviewed Oct 25, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. Go 1.27130 lines · 5.5K tokens
  2. Google ADK for Go 1.952 lines · 2.1K tokens
Total182 lines · 7.6K 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
  • 494
  • 532
  • 639
  • 732
  • 759
  • 770
  • 772
  • 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 target the google.golang.org/adk 1.9 release line, checked against v1.9.0. The module's go.mod declares Go 1.25; the included Go 1.27 baseline is a supported runtime choice for this composition.

Agent instructions and model output

  • Build llmagent.Config instructions, models, tools, toolsets, and subagents from trusted configuration. Treat user messages, retrieved documents, remote-agent replies, skill files, and tool results as data: prompt injection in any of them must not change tool permissions or trusted instructions.
  • Keep untrusted values out of authoritative Instruction and GlobalInstruction templates: {key} and {artifact.name} insert session state or artifact text. Use InstructionProvider when braces must remain literal, and validate values inserted by a provider.
  • Put shared instructions on the root agent, whose GlobalInstruction is the one applied. Review instruction providers because they override static fields; enforce policy in code even when instructions forbid a dangerous action.
  • Register only the Tools, Toolsets, and SubAgents a request needs. Set DisallowTransferToParent and DisallowTransferToPeers when those paths are unnecessary, and authorize access again in the destination agent.
  • Validate OutputSchema results and OutputKey state before output handling in HTML, commands, database queries, or external actions. Structured model output remains untrusted, and a schema is not permission for a tool call.

Tools, callbacks, and approvals

  • Use typed functiontool.New