Microsoft Agent Framework for Python 1.23

Last reviewed Oct 25, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. Python 3155 lines · 3.8K tokens
  2. Microsoft Agent Framework for Python 1.2379 lines · 4.2K tokens
Total234 lines · 8K tokens

CWE Coverage

  • 20
  • 23
  • 36
  • 59
  • 78
  • 79
  • 89
  • 95
  • 117
  • 201
  • 208
  • 209
  • 214
  • 250
  • 295
  • 306
  • 319
  • 328
  • 338
  • 347
  • 352
  • 362
  • 367
  • 379
  • 409
  • 416
  • 426
  • 427
  • 470
  • 488
  • 502
  • 522
  • 532
  • 611
  • 639
  • 674
  • 732
  • 770
  • 772
  • 776
  • 807
  • 829
  • 862
  • 916
  • 918
  • 922
  • 942
  • 1104
  • 1333
  • 1395
  • 1426
  • 1427

Prompt Preview

Apply to the Python 1.23 API scope and the optional integrations used by the application, after the Python 3 baseline. When using MCP transports or hosting, also apply the MCP SDK for Python 2 prompt. Treat beta and experimental packages and APIs (including A2A, shell tools, DevUI, FIDES, and declarative agents) as separately reviewed capabilities, not as stable merely because Core is stable.

Prompt injection and tool authorization

  • Keep Agent.instructions and system/developer Message content application-controlled. Treat user input, retrieved documents, memory, skills, MCP descriptions, tool results, and other agents' responses as untrusted data for prompt injection; none grants permission or changes the caller's authority.
  • Enforce tool authorization inside each protected tool or mandatory function middleware, checking the authenticated principal, operation, validated arguments, and resource immediately before side effects. Tool schemas, model-selected names, tool_choice, and approval flags are not access checks.
  • Fail closed in policy middleware: do not call call_next after denial, and raise MiddlewareFailure when a violation must abort the whole run. Ordinary function-middleware exceptions become tool-error results and can let the loop continue; MiddlewareTermination is early-termination control flow, not an authorization decision. Cancellation cannot undo a synchronous sibling tool already performing side effects. Apply per-model-call checks in ChatMiddleware and per-tool checks at the tool boundary.
  • Register only needed tools. Review