Microsoft Foundry SDK for Python 2.5
Last reviewed Sep 12, 2026
Prompt Details
Prompt Composition
2prompts
- Python 3155 lines · 3.8K tokens
- Microsoft Foundry SDK for Python 2.556 lines · 1.4K tokens
Total211 lines · 5.2K tokens
CWE Coverage
- 20
- 23
- 36
- 59
- 78
- 89
- 95
- 117
- 201
- 208
- 209
- 214
- 250
- 295
- 319
- 328
- 338
- 347
- 367
- 379
- 409
- 416
- 426
- 427
- 470
- 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 Microsoft Foundry SDK for Python 2.5 project endpoints, Azure identity, connections, model clients, project assets, evaluations, tracing, networking, and operations.
Project client and identity
- Construct
AIProjectClientwith a fixed trusted project endpoint and an explicitly selected production credential. - Prefer
ManagedIdentityCredentialorWorkloadIdentityCredentialin production; ifDefaultAzureCredentialis required, exclude developer and interactive credentials that could silently satisfy the chain. - Assign least-privilege Azure roles at the narrowest project, resource, and data scope; review the agent's
instance_identityand downstream tool permissions separately from the project client's credential. - Separate Foundry projects, identities, quotas, networks, and storage across environments and mutually untrusted tenants.
- Do not accept endpoint, subscription, resource group, project, tenant, authority, or credential selection from request data.
Connections and model clients
- Keep
connections.get(..., include_credentials=False)andget_default(..., include_credentials=False)at their safe default; enable credential return only inside a narrow adapter and never return, log, trace, cache, or send the resulting credential-bearingConnectionto a model. - Do not return connection secrets, keys, tokens, or full connection objects through APIs, logs, traces, or model context.
- Allowlist model deployments and capabilities before obtaining or using an inference or OpenAI-compatible client.