smolagents 1.26.0

Last reviewed Sep 20, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. Python 3155 lines · 3.8K tokens
  2. 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. Leave add_base_tools=False unless every added capability is needed; enabling it also gives a ToolCallingAgent the local PythonInterpreterTool.
  • 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, and client_kwargs in server configuration. Authorize the actual recipient of prompts and tool results, including every fallback in LiteLLMRouterModel; do not let callers redirect an authenticated model client.
  • Review custom_role_conversions and flatten_messages_as_text for 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 into agent.state, and sent to a code executor. Never pass