Microsoft Agent Framework for Python 1.16
Last reviewed Oct 28, 2026
Prompt Details
Prompt Composition
2prompts
- Python 3155 lines · 3.8K tokens
- Microsoft Agent Framework for Python 1.1666 lines · 2.5K tokens
Total221 lines · 6.3K tokens
CWE Coverage
- 20
- 23
- 36
- 59
- 78
- 79
- 89
- 95
- 117
- 201
- 208
- 209
- 214
- 250
- 295
- 306
- 312
- 319
- 328
- 338
- 347
- 362
- 367
- 379
- 409
- 416
- 426
- 427
- 470
- 488
- 502
- 522
- 532
- 611
- 639
- 674
- 732
- 770
- 772
- 776
- 807
- 829
- 838
- 862
- 916
- 918
- 1104
- 1333
- 1395
- 1426
- 1427
Prompt Preview
Apply the Python 3 baseline first. These rules cover Microsoft Agent Framework for Python 1.16 agents, functions, middleware, threads, workflows, checkpoints, human approval, observability, and deployment.
Agent and client configuration
- Construct agents, model clients, instructions, service endpoints, and execution settings from trusted configuration.
- Keep user text, retrieved content, memory, and tool results distinct from authoritative instructions.
- Allowlist model deployments and capabilities and bound tokens, turns, time, retries, parallelism, and spend.
- Set
FunctionInvocationConfiguration(max_iterations=..., max_consecutive_errors_per_request=..., terminate_on_unknown_calls=True)with iteration and error budgets below their defaults of 40 and 3; unknown-call termination defaults toFalse. Leaveinclude_detailed_errors=Falseso tool failures do not expose internals to the model. - Give each agent a distinct least-privilege identity and only the functions required for its role.
- Validate
AgentResponse.text/value, streamedAgentResponseUpdatecontent, and surfaced function or MCP results against the destination's schema, size, allowed values, and authorization before rendering or active use. Buffer bounded streams when validation needs a complete result;response_formatparses shape but does not authorize actions or sanitize sinks. - Render generated text as plain text by default. When HTML or Markdown markup is needed, encode text for its exact HTML body, HTML attribute, or Markdown context, or sanitize allowed rich markup; neutralize text