OpenAI Agents SDK for TypeScript 0.21
Last reviewed Oct 21, 2026
Prompt Details
Prompt Composition
5prompts
- JavaScript ES2026102 lines · 3.1K tokens
- Node.js 24101 lines · 5.3K tokens
- TypeScript 746 lines · 1.5K tokens
- OpenAI SDK for TypeScript 7.980 lines · 3.4K tokens
- OpenAI Agents SDK for TypeScript 0.2166 lines · 3.7K tokens
Total395 lines · 17K tokens
CWE Coverage
- 15
- 20
- 22
- 59
- 73
- 78
- 79
- 88
- 89
- 95
- 113
- 117
- 200
- 208
- 209
- 214
- 250
- 252
- 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
- 639
- 653
- 732
- 770
- 772
- 807
- 829
- 838
- 841
- 862
- 863
- 908
- 915
- 916
- 918
- 922
- 942
- 943
- 1004
- 1321
- 1333
- 1426
- 1427
Prompt Preview
Apply the OpenAI SDK for TypeScript 7.9 prompt first, including its Node.js 24 and TypeScript 7 baselines. These rules cover the 0.21 line's text and Realtime runs, tools, handoffs, MCP, saved state, tracing, and sandbox capabilities.
Instructions and capability boundaries
- Keep directly installed
@openai/agentsand@openai/agents-*packages on one linked release set in the lockfile. A caret range on this pre-stable SDK stays within one minor; review the current release policy and breaking changes when changing minor lines, without assuming older minors receive backports. - Prevent prompt injection by keeping user input, retrieved documents, tool results, workspace files, and memory out of trusted
Agent.instructions,SandboxAgent.baseInstructions, and policy-bearing configuration. Summaries and compaction output remain untrusted data; never let them grant capabilities or approvals. - Build
RunContextidentity and tenant fields from authenticated application state. KeepcallModelInputFilterand dynamic instruction callbacks application-owned; neither model arguments nor stored conversation content may replace current authorization context. - Use bounded Zod schemas or supported synchronous Standard Schema values for
tool().parameters,agent.asTool().parameters,Agent.outputType, andhandoff().inputType. Raw JSON Schema only describes the contract and parses JSON; validate it locally before use. Keep strict mode enabled and enforce domain constraints after transforms. - For tool authorization, check the current principal, operation, normalized