Google ADK for Go 1.9
Last reviewed Oct 25, 2026
Prompt Details
Prompt Composition
2prompts
- Go 1.27130 lines · 5.5K tokens
- 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.Configinstructions, 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
InstructionandGlobalInstructiontemplates:{key}and{artifact.name}insert session state or artifact text. UseInstructionProviderwhen braces must remain literal, and validate values inserted by a provider. - Put shared instructions on the root agent, whose
GlobalInstructionis 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, andSubAgentsa request needs. SetDisallowTransferToParentandDisallowTransferToPeerswhen those paths are unnecessary, and authorize access again in the destination agent. - Validate
OutputSchemaresults andOutputKeystate 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