Microsoft Foundry SDK for JavaScript 2.7
Last reviewed Oct 25, 2026
Prompt Details
Prompt Composition
4prompts
- JavaScript ES2026102 lines · 3.1K tokens
- Node.js 24101 lines · 5.3K tokens
- TypeScript 746 lines · 1.5K tokens
- Microsoft Foundry SDK for JavaScript 2.748 lines · 2.1K tokens
Total297 lines · 12.1K tokens
CWE Coverage
- 20
- 22
- 59
- 73
- 77
- 78
- 79
- 88
- 89
- 95
- 113
- 117
- 200
- 201
- 208
- 209
- 214
- 250
- 295
- 297
- 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
- 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 7 prompts first. These rules cover the @azure/ai-projects 2.7 line, checked against 2.7.1, including project clients, agents, voice sessions, toolboxes, datasets, and preview operations. Run server components on a supported Node.js LTS runtime; decide separately whether a browser client may hold its own user-scoped credential.
Project identity and client boundaries
- Create
AIProjectClientwith a trusted HTTPS project endpoint andTokenCredential. Do not accept a request-suppliedoptions.endpoint,apiVersion, credential scope, proxy, transport,additionalPolicies, orrequestOptions; these can change the destination or behavior of project and beta operations. - Use a dedicated managed or workload identity for production services. If
DefaultAzureCredentialis necessary, constrain its production credential chain and verify which identity acquired the token. Grant that identity only the Foundry and connected-service roles its operations need. - Authorize the current user and tenant before every project operation; a successful call under a shared service identity is not proof that the user owns the agent, connection, dataset, session, or trace. Separate clients and mutable option objects across tenants.
- Keep
allowInsecureConnectionoff, retain URL encoding, and construct per-operation headers on the server. Caller-controlled headers andrequestOptions.skipUrlEncodingcan change generated requests. - Protect
connections.getWithCredentialsand bothconnections.getandgetDefaultwhenincludeCredentialsis