Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

jackmpcollins/magentic
main @ 58b72cf
1
Fixes
0
CVEs
MEDIUM
Peak severity
0.0%
Coverage
Highlights
Denial of Service: 1 prior fix. Scrutinize any change in this area.
src/magentic/chat_model/openrouter_chat_model.py: most-fixed (1 issue). Treat as high-risk during review.
0 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Denial of Service: Upstream API providers like OpenRouter can return empty stream chunks or unexpected payload structures. Accessing `choices[0]` on an empty list without a prior length check causes an unhandled `IndexError`, crash-looping or interrupting the streaming response and leading to a denial of service.