Microsoft Foundry SDK for Python 2.6
Last reviewed Sep 12, 2026
Prompt Details
Prompt Composition
2prompts
- Python 3155 lines · 3.8K tokens
- Microsoft Foundry SDK for Python 2.697 lines · 3.8K tokens
Total252 lines · 7.5K tokens
CWE Coverage
- 20
- 23
- 36
- 59
- 78
- 89
- 95
- 117
- 201
- 208
- 209
- 214
- 250
- 295
- 306
- 319
- 328
- 338
- 347
- 367
- 379
- 409
- 416
- 426
- 427
- 470
- 488
- 502
- 522
- 532
- 611
- 639
- 674
- 732
- 770
- 772
- 776
- 799
- 807
- 829
- 862
- 916
- 918
- 922
- 1104
- 1333
- 1395
- 1426
- 1427
Prompt Preview
Apply the Python 3 baseline first. These rules cover azure-ai-projects 2.6: project clients, connections, agents, hosted sessions, tools and toolboxes, routines, Microsoft 365 publishing, content safety, Agent Insights, and telemetry.
Client construction and authorization
- Construct
AIProjectClientwith a project endpoint selected from trusted configuration and an explicit production credential; never let request data, model output, or a tool argument select the endpoint, tenant, authority, credential, or token scope. - Apply the same destination policy to
get_openai_client(base_url=...)andsend_request; keep API-key overrides, custom transports, and authentication policies in trusted configuration. - Prefer a directly configured
ManagedIdentityCredentialorWorkloadIdentityCredentialin production. IfDefaultAzureCredentialis unavoidable, exclude developer, interactive, and other credentials that must not satisfy the chain. - Create separate clients, projects, identities, quotas, storage, and telemetry destinations for distinct environments and mutually untrusted tenants.
- Grant the narrowest Azure control-plane and data-plane roles at the smallest practical scope. Separate connection administration, agent authoring, publishing, monitoring, and invocation identities.
- Use the Foundry Agent Consumer role for invoke-only principals where it supplies the required data actions; do not give an application Contributor merely so it can invoke an agent.
- Treat every project, agent, deployment, connection, dataset, index, file, session, monitor, and