OpenAI Agents SDK for TypeScript 0.17
Last reviewed Sep 9, 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.855 lines · 1.3K tokens
- OpenAI Agents SDK for TypeScript 0.1757 lines · 1.7K tokens
Total361 lines · 13K tokens
CWE Coverage
- 15
- 20
- 22
- 59
- 73
- 78
- 79
- 88
- 89
- 95
- 113
- 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
- 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.8, Node.js 24, and TypeScript 7 prompts first. These rules cover Agents SDK for TypeScript 0.17 agents, tools, handoffs, guardrails, sessions, approvals, MCP, tracing, and runner limits.
Agents and runner limits
- Construct
Agentinstructions, model settings, tools, handoffs, and output type from trusted registries rather than request-controlled names. - On 0.17.0, which predates the 0.17.1 fix, an
OpenAIProviderbuilt withapiKey,baseURL,organization, orprojectstill sends its requests through a client set withsetDefaultOpenAIClient()whenever one exists, so give such a provider its ownopenAIClientinstead. - Set an explicit runner turn cap plus provider token, time, and cost budgets; a turn limit alone does not bound parallel tools or hosted-tool work.
- Set
toolExecution.maxFunctionToolConcurrency; when unset ornull, all local function calls in a turn may start concurrently. - Configure provider
modelSettings.parallelToolCallsseparately because the local concurrency option does not change provider tool selection. - Treat limit errors, cancellation, incomplete streams, and typed output as non-success until destination invariants validate the result.
Function and hosted tools
- Define local functions with
tool()and a bounded schema; validate parsed arguments again against current tenant and resource state inexecute. - Set
needsApproval: trueor a trusted predicate for high-impact calls and bind approval to the exact tool arguments shown to the reviewer. - Configure