smolagents 1.26.0
Last reviewed Sep 20, 2026
Prompt Details
Prompt Composition
2prompts
- Python 3155 lines · 3.8K tokens
- smolagents 1.26.063 lines · 3.1K tokens
Total218 lines · 6.9K tokens
CWE Coverage
- 20
- 23
- 36
- 59
- 73
- 78
- 89
- 95
- 117
- 201
- 208
- 209
- 214
- 250
- 287
- 295
- 306
- 319
- 328
- 338
- 347
- 362
- 367
- 379
- 409
- 416
- 426
- 427
- 434
- 470
- 488
- 502
- 532
- 538
- 611
- 674
- 732
- 749
- 770
- 772
- 776
- 807
- 829
- 862
- 916
- 918
- 1104
- 1333
- 1395
- 1426
- 1427
Prompt Preview
Apply the Python 3 baseline first. These rules cover smolagents 1.26.0 on a maintained Python release satisfying Python >=3.10; verify compatibility of the chosen model, MCP, UI, and executor extras with that interpreter. Confine CodeAgent's intentional execution of model-authored Python to the isolated execution boundary below.
Agent configuration and model boundaries
- Keep
instructions,prompt_templates,tools,managed_agents, and executor settings in trusted application configuration. Leaveadd_base_tools=Falseunless every added capability is needed; enabling it also gives aToolCallingAgentthe localPythonInterpreterTool. - Treat tasks, retrieved pages, tool observations, errors, memory, and managed-agent reports as untrusted data even when included in later planning or model messages. Do not let their instructions change tool permissions or application policy.
- Fix model IDs, providers,
base_url/api_base, credentials, andclient_kwargsin server configuration. Authorize the actual recipient of prompts and tool results, including every fallback inLiteLLMRouterModel; do not let callers redirect an authenticated model client. - Review
custom_role_conversionsandflatten_messages_as_textfor the selected model adapter. Test the outgoing messages so user or tool content is never promoted into trusted instructions through role conversion or concatenation. - Pass only necessary agent-visible data through
run(additional_args=...): values are stringified into the task, merged intoagent.state, and sent to a code executor. Never pass