Microsoft Foundry SDK for Java 2.4.0
Last reviewed Oct 28, 2026
Prompt Details
Prompt Composition
2prompts
- Java 25113 lines · 2.8K tokens
- Microsoft Foundry SDK for Java 2.4.079 lines · 4K tokens
Total192 lines · 6.9K tokens
CWE Coverage
- 20
- 22
- 59
- 78
- 79
- 88
- 89
- 95
- 117
- 190
- 201
- 208
- 209
- 214
- 295
- 297
- 323
- 327
- 338
- 347
- 362
- 367
- 378
- 427
- 459
- 470
- 471
- 494
- 502
- 532
- 611
- 639
- 653
- 681
- 732
- 770
- 772
- 776
- 789
- 807
- 838
- 841
- 862
- 863
- 915
- 916
- 918
- 922
- 942
- 1333
- 1426
- 1427
Prompt Preview
Apply the Java 25 baseline first. These rules cover com.azure:azure-ai-projects:2.4.0, its azure-ai-agents:2.4.0 integration, and service API v1. The SDK supports JDK 8 and later; these rules target Java 25 deployments.
Clients, transport, and preview boundaries
- Configure
AIProjectClientBuilderand the separateAgentsClientBuilderwith an explicitTokenCredentialand a trusted project endpoint at<resource>.services.ai.azure.com/api/projects/<project>over HTTPS. Keep the resource, project, cloud authority, and token audience under deployment control; the builders' default token scope uses HTTPS, hostai.azure.com, and path/.default. - Resolve names passed to
buildAgentScopedOpenAIClientor its async counterpart from an authorized agent allowlist. The builder checks only that the name is nonempty before incorporating it into the URL path. - Centralize preview access.
allowPreview(false)controls supported preview behavior on non-beta clients; clients built throughbeta()add their ownFoundry-Featuresheader regardless. Restrict beta-client construction and caller-supplied feature headers as well as the flag. - Prefer
httpClient(...)and reviewedaddPolicy(...)customizations to replacing the whole pipeline. When usingpipeline(...), explicitly supply the required authentication, retry, logging, and transport policies; separately configured builder policies and credentials are not automatically inserted into that pipeline. - Keep the generated OpenAI client's retry count at zero when using the builder's Azure pipeline adapter, and