Strands Agents SDK for Python 1.62
Last reviewed Oct 26, 2026
Prompt Details
Prompt Composition
2prompts
- Python 3155 lines · 3.8K tokens
- Strands Agents SDK for Python 1.6254 lines · 2.9K tokens
Total209 lines · 6.7K tokens
CWE Coverage
- 20
- 23
- 36
- 59
- 73
- 78
- 79
- 89
- 95
- 117
- 201
- 208
- 209
- 214
- 250
- 295
- 306
- 319
- 328
- 338
- 347
- 362
- 367
- 379
- 409
- 416
- 426
- 427
- 470
- 488
- 502
- 532
- 611
- 639
- 674
- 732
- 749
- 770
- 772
- 776
- 807
- 829
- 862
- 916
- 918
- 922
- 1104
- 1333
- 1395
- 1426
- 1427
Prompt Preview
Apply these rules to applications built with the Python strands-agents SDK, including its optional tools, storage, memory, multi-agent, A2A, and voice components when used.
Agent input and prompt injection
- Pass caller text to
Agentas a string. ConstructAgent.messages,system_prompt, tool definitions, and non-string content blocks from application-controlled data; a trailingtoolUseblock in Python history can dispatch a tool without a model call. If caller-influenced history must be imported, reject forged tool results and strip every trailingtoolUseblock before invocation. - Treat retrieved pages, files, MCP results, A2A messages, memory entries, tool errors, and model output as data, even when they claim to be system instructions or approvals. Keep authority and trusted instructions in application-controlled code and prompts; do not promote content by copying it into a privileged message or a tool schema.
- Keep tool lists explicit in
Agent(tools=[...]); leave directory-based automatic tool loading and reload disabled in production. Reviewload_tools_from_directory, plugins, and dynamic registries as code, and skill files as agent instructions, before enabling them.
Tool authorization and intervention
- Validate every
@toolargument at the tool boundary, including length, shape, identifiers, paths, URLs, and allowed operations. A generated tool schema guides the model but does not establish permission. Get the current authenticated principal from trustedToolContext.invocation_state, not model-supplied arguments or conversation text.