Google ADK for Go 2.3.0
Last reviewed Sep 19, 2026
Prompt Details
Prompt Composition
2prompts
- Go 1.27130 lines · 5.5K tokens
- Google ADK for Go 2.3.090 lines · 3.4K tokens
Total220 lines · 8.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
- 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 google.golang.org/adk/v2 v2.3.0 on Go 1.27; the module requires Go 1.26.6 or newer.
Agent configuration and instruction boundaries
- Build
llmagent.Configmodels, instructions, tools, toolsets, subagents, and generation settings from trusted configuration; treat tool descriptions and retrieved content as untrusted inputs to model decisions. - Keep untrusted state and artifact text out of authoritative
InstructionandGlobalInstructiontemplates:{key}and{artifact.name}substitute their contents. UseInstructionProviderfor literal braces, and validate any values the provider inserts. - Put shared instructions on the root agent; only its
GlobalInstructiontakes effect. Review instruction providers because they override the corresponding static instructions, and keep authorization independent of all instruction text. - Minimize
Tools,Toolsets, andSubAgents, and setDisallowTransferToParentandDisallowTransferToPeerswhen those routes are unnecessary; transfer restrictions do not authorize access to the destination's resources. - Validate structured agent output before using it for privileged operations;
OutputSchemastill permits tool calls throughset_model_response, andOutputKeystores model-produced data rather than trusted policy.
Tool execution and callback coverage
- Use typed
functiontool.Newarguments and explicit schema bounds, then check business constraints and current principal, tenant, resource, and operation inside the handler; schema validation does not grant