Google ADK for TypeScript 2.3

Last reviewed Oct 19, 2026

Export as PDF

Prompt Details

Prompt Composition

4prompts
  1. JavaScript ES2026102 lines · 3.1K tokens
  2. Node.js 24101 lines · 5.3K tokens
  3. TypeScript 5.940 lines · 1.2K tokens
  4. Google ADK for TypeScript 2.361 lines · 2.7K tokens
Total304 lines · 12.3K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 73
  • 78
  • 79
  • 88
  • 89
  • 95
  • 113
  • 116
  • 117
  • 200
  • 208
  • 209
  • 214
  • 250
  • 295
  • 297
  • 306
  • 319
  • 323
  • 330
  • 338
  • 346
  • 347
  • 352
  • 354
  • 362
  • 367
  • 377
  • 426
  • 444
  • 459
  • 471
  • 488
  • 494
  • 502
  • 522
  • 524
  • 532
  • 602
  • 613
  • 639
  • 653
  • 674
  • 732
  • 754
  • 770
  • 807
  • 829
  • 838
  • 841
  • 862
  • 863
  • 908
  • 915
  • 916
  • 918
  • 922
  • 942
  • 943
  • 1004
  • 1321
  • 1333
  • 1427

Prompt Preview

Apply the Node.js 24 and TypeScript 5.9 prompts first. These rules cover @google/adk 2.3 agents, tools, runners, state, credentials, and development surfaces; apply server controls to the backend of browser agents too.

Prompt injection

  • Build LlmAgent.instruction, globalInstruction, agent descriptions, and tool definitions from trusted application policy. Keep user messages, retrieved documents, tool results, and remembered conversations as untrusted data that cannot grant authority.
  • Allowlist state keys used by instruction placeholders; never interpolate caller-controlled policy, roles, credentials, or approval decisions. Review ExampleTool and PRELOAD_MEMORY because they add content to instructions; filter memory by the authenticated user before retrieval and preserve its untrusted status.
  • Keep agent trees, model routing, tool registries, requestProcessors, and responseProcessors under application control. Custom processor arrays replace defaults; prefer model callbacks for filtering without removing authentication, confirmation, or content processing.
  • Validate the public message envelope before Runner.runAsync or runLive: fix the user role, bound parts, and accept function responses only for an outstanding call belonging to this principal and session. Do not accept caller-supplied histories, internal metadata, or arbitrary stateDelta.

Tool authorization

  • Authorize the current principal, operation, validated arguments, and target resource inside every tool before reading protected data or performing a side effect. A model-selected