Haystack 2.31
Last reviewed Sep 24, 2026
Prompt Details
Prompt Composition
2prompts
- Python 3155 lines · 3.8K tokens
- Haystack 2.31116 lines · 4.8K tokens
Total271 lines · 8.6K tokens
CWE Coverage
- 20
- 22
- 23
- 36
- 59
- 73
- 78
- 89
- 95
- 117
- 201
- 208
- 209
- 214
- 250
- 295
- 319
- 328
- 338
- 347
- 367
- 379
- 409
- 416
- 426
- 427
- 470
- 488
- 502
- 522
- 532
- 611
- 639
- 674
- 732
- 770
- 772
- 776
- 807
- 829
- 862
- 916
- 918
- 941
- 1104
- 1333
- 1395
- 1427
Prompt Preview
Apply the Python 3 prompt first. These rules cover Haystack 2.31 pipelines, prompt templates, agents and tools, retrieval, converters, model providers, telemetry, and deployment, and were checked against 2.31.0.
Version scope and runtime
- Install
haystack-aifrom the application's lock file and run it on Python 3.10 through 3.14, the interpreter versions this release classifies; its package metadata requires Python 3.10 or newer without declaring an upper bound. - Treat 2.31 as a maintenance line that receives only security patches and critical bug fixes until the end of October 2026, and schedule the 3.x migration before that date.
- Do not carry Haystack 3.x behavior into this deployment: 2.31 has no deserialization module allowlist, no
unsafedeserialization switch, and still executes tool calls throughToolInvoker. - Enforce application controls for pipeline loading, URL fetching, and document-borne prompt injection; Haystack's security policy assigns these input-validation and trust boundaries to the application.
Pipeline definitions and serialization
- Treat every pipeline YAML, JSON, or dict as executable source: when a component
typeis not already registered,Pipeline.from_dict(),Pipeline.loads(), andPipeline.load()import its named module before requiring the class to appear in the component registry. - Remember that 2.31 keeps no allowlist over the modules a definition may name, so importing one executes its top-level code even when the registry lookup afterwards fails.
- Apply the same controls to serialized tools, toolsets, snapshot