Simon Willison released llm 0.37.3 on November 16, 2026—a patch release that matters less for headline CVEs than for reliability of local agent plumbing: SQLite-backed prompt logs after Homebrew shipped SQLite 3.54.1, streamed multi-tool-call parsing on some OpenAI-compatible APIs (including Gemini), and graceful handling of malformed tool JSON from chat models. If your team runs Claude Code, Codex, or automation that shells out to llm for quick model calls, embeddings, or transcript storage, treat 0.37.3 as a supply-chain pin on the same tier as the November 11 key-routing advisories.
| Question | Short answer |
|---|---|
| Am I affected? | Yes if llm --version is below 0.37.3, you use llm logs, tool-capable models, or custom OpenAI-compatible endpoints from scripts agents run |
| Is there a fix? | pip install -U llm (or update Homebrew) to 0.37.3+ |
| Does data leave my machine? | llm still calls remote APIs when configured; this release fixes local log integrity and tool-call parsing, not network egress |
| Does this patch OpenAI API keys leaking? | No—that was 0.37.2; keep both upgrades |
What changed in 0.37.3
The authoritative list is Simon Willison's release note and the GitHub 0.37.3 tag. The items that most often intersect coding-agent workflows are below.
SQLite 3.54.1 and broken llm logs
Homebrew's llm package picked up SQLite 3.54.1, which corrected how nested json_array subqueries serialize. Willison documents the behavior change with a minimal query:
select json_object('a', (select json_array(1)))
On SQLite 3.54.0 that produced {"a":[1]}. On 3.54.1 the nested array becomes SQL text, yielding {"a":"[1]"}—which matches SQLite documentation and maintainer D. Richard Hipp's explanation that 3.54.0 was wrong. llm's logging SQL assumed the older shape, so tool results with attachments could be stored as strings where readers expected JSON objects. Users then hit:
AttributeError: 'str' object has no attribute 'get'
when running llm logs (issues #1879, #1880). Version 0.37.3 adapts logging; the documented workaround for raw SQL is wrapping with json():
select json_object('a', json((select json_array(1))))
For agent operators, the lesson is blunt: a language-runtime patch on your laptop can invalidate local audit trails even when no model weights change. That is adjacent to API keys showing up in logs and LiteLLM gateway compromises—different mechanism, same verify-your-pin habit.
Streamed tool calls merged on index-less chunks
Pull request #1862 fixes a parser bug for OpenAI-compatible streaming when the server omits the index field on tool-call chunks—a pattern reported on Gemini's OpenAI-compatible endpoint. Before 0.37.3, several tool calls in one assistant message could collapse into a single call, which is dangerous for agentic scripts that rely on llm to fan out parallel file edits, HTTP probes, or MCP-style tools.
The failure mode is not theoretical for teams that route Gemini or third-party OpenAI shims through llm instead of a heavier gateway. If your coding agent's shell recipe does:
llm -m gemini-pro '...' --tools ...
…you want one executed function per model-chosen tool, not a silently merged blob. After upgrading, re-run a known multi-tool prompt and compare llm logs output to what your agent actually executed.
Invalid JSON in tool arguments
Issue #1887 addresses crashes when models return truncated or malformed JSON in tool arguments—a frequent failure under token limits or aggressive stop sequences. 0.37.3 sends the decode error back as a tool result so the model can retry instead of killing the whole CLI session with JSONDecodeError. Agent harnesses that wrap llm in a retry loop become more predictable; harnesses that assumed "crash means stop" need to read logs again.
Async tools inside a running event loop
#1728 / #1733 fix async def tools when Jupyter or another asyncio loop is already running—previously the tool never ran and the model saw asyncio.run() cannot be called from a running event loop. Notebook-based agent eval notebooks and live demos that mix llm with coding agents in the same kernel are the audience.
Embedding and template hardening (secondary but real)
The same release improves embed_multi ID swaps (#1867), UTF-8 for extra-openai-models.yaml on Windows (#1889), and clearer validation errors for bad templates (#1861, #1852). Teams that embed repository chunks for RAG beside Claude Code indexers should still upgrade—stale embeddings after ID swaps look like "the agent forgot the repo."
Mechanism: why SQLite broke logging without touching llm's Python code
The regression is a dependency bump, not a malicious change. Packaging channels (especially Homebrew) refreshed SQLite underneath an unchanged llm wheel. llm stores conversational and tool metadata in a local SQLite database; readers use Python dict APIs on JSON columns. When nested JSON serializes as a string literal instead of structured JSON, downstream code that calls .get() on what it thinks is an object fails closed for the operator—your history looks empty or crashes even though the model calls succeeded.
That pattern mirrors why security teams track transitive updates on developer images: Node.js October security releases and Brotli CVE fallout showed how shared runtimes under MCP servers and agents create correlated risk. SQLite here is lower severity but the detection is the same: llm logs failing is a signal to pin versions, not to ignore.
What this means if you run AI coding agents
1. Pin and verify llm like any agent dependency.
llm --version
pip show llm | grep '^Version'
pip install -U 'llm>=0.37.3'
Add llm>=0.37.3 next to claude-code, @modelcontextprotocol/sdk, or litellm pins in devcontainer.json, Nix flakes, and CI images agents spawn from. npm-only scanners will not see PyPI drift until you inventory CLIs explicitly (AI asset inventory practices).
2. Reconcile logs after upgrade.
If you relied on llm logs for incident review around November 14–16, re-open entries that involved tools with attachments. Pre-0.37.3 rows may still contain stringified JSON; new runs should normalize. Cross-check against Beam's local event store if you run agent runtime monitoring in parallel—two partial truths are worse than one.
3. Re-test OpenAI-compatible providers you route through llm.
Especially multi-tool prompts on Gemini-compatible bases. Compare tool names and arguments in logs to ground truth on disk. Mis-merged calls can look like "the agent skipped a step" when the CLI parser was wrong.
4. Keep 0.37.2's credential lessons active.
GHSA-v9h7-jj4g-f862 and GHSA-r639-rr7r-x72w still define how extra-openai-models.yaml must be configured. 0.37.3 does not replace separate API keys per api_base or rotation after misconfiguration.
5. Notebook and CI asyncio paths.
If agents invoke llm inside pytest-asyncio, Jupyter, or VS Code interactive windows, retest async tools after upgrade—the thread-backed loop fix changes behavior from "silent no-op" to "actually runs."
6. Windows and template operators.
Release #585 / #1809 fixes llm chat failing on Windows over an invalid \e[d key binding—relevant when engineers run WSL-adjacent or native Windows agent setups. Template validation improvements (#1861, #1852) matter when agents generate llm templates as artifacts; a broken template previously blocked llm templates list for the whole user profile until manually repaired.
How to verify the upgrade worked (copy-paste checklist)
Work through this once per machine image after bumping llm:
- Version gate —
llm --versionmust print 0.37.3 or newer. If Homebrew and pip disagree, you may have two installs;which llmtells you which binary agents inherit in non-interactive shells. - Logs gate — Run
llm logs -n 5(or your usual filter). If you previously sawAttributeError: 'str' object has no attribute 'get', the command should complete. Spot-check any row with tool attachments from before the upgrade; legacy rows may still look odd even though new rows are fixed. - Multi-tool gate — Pick a model on an OpenAI-compatible endpoint you actually use (Gemini shim, local vLLM, corporate proxy). Send a prompt that should emit two distinct tool calls in one turn. Confirm
llm logsshows two call IDs, not one concatenated name/argument blob. - Bad JSON gate — Force a truncated tool schema or cut
--max-tokensaggressively on a tool-capable model. Expect a tool error message returned to the model, not a process exit withJSONDecodeError. - Async gate (optional) — In Jupyter, register an
async deftool and run one prompt. The tool should execute instead of returning the asyncio loop error cited in #1728.
Document the output in your team runbook. Security reviewers often ask for proof of patch, not assumptions—especially when agents re-install CLIs mid-sprint.
What people search when llm breaks beside agents
Queries around "simon willison llm" and CLI tool security tend to cluster into a few practical buckets: how to upgrade safely, whether logs are trustworthy, and whether a release overlaps with API key bugs. The table below maps those intents to this release.
| Search intent | Answer for 0.37.3 |
|---|---|
| Is llm safe after the 0.37.2 advisories? | 0.37.2+ is required for key-routing fixes; 0.37.3+ adds logging/tool reliability. You need both thresholds, not either/or. |
Why does llm logs crash after brew upgrade? | SQLite 3.54.1 JSON semantics—upgrade llm, not downgrade SQLite blindly. |
| Gemini tool calls wrong via llm | Check 0.37.3 merged-call fix (#1862) before blaming the coding agent. |
| Agent vs llm audit trail | Separate systems—agents may use Beam or IDE logs while llm keeps its own SQLite DB. Correlate timestamps manually after incidents. |
None of these replace reading upstream release notes; they shorten triage when an agent session "worked" but your local prompt DB disagrees.
Supply-chain context: llm in the agent stack
Simon Willison's llm is not a coding agent harness like Claude Code, but it sits in the same developer shell: quick model calls, embedding pipelines, RAG collections, and CI smoke tests that agents trigger with subprocess.run. When FFmpeg skills trend as MCP servers or Coral-style gateways multiply tool surfaces, teams still reach for llm because it is small, scriptable, and PyPI-installable.
That convenience makes silent parser bugs expensive. A merged tool call does not leak credentials like GHSA-v9h7, but it can still cause an agent wrapper to edit the wrong file or POST the wrong payload while logs show a single tool—exactly the ambiguity compliance-oriented audit trails are meant to eliminate. Patching llm is cheaper than re-litigating which component lied after the fact.
If you standardize on LiteLLM or another gateway for production agents, keep llm pins on jump boxes anyway: engineers still use it for one-off repros that later get copied into agent skills without passing through your gateway inventory.
What Beam can and cannot do here
Beam watches Claude Code and Codex through PreToolUse hooks, scans skills and MCP configs with 11 heuristic patterns plus an MCP version-pin check, and redacts secrets before local storage (agent hooks docs). It does not patch Simon Willison's SQLite schema, parse llm tool streams, or block Homebrew SQLite upgrades.
Concrete overlap: if an agent shells out to llm and llm executes a destructive shell tool, Beam can flag or deny the agent's shell proposal when policy is in enforce mode and hooks are wired—but only for supported adapters, with fail-open behavior on missing cached policy. Beam will not notice merged tool-call parsing inside llm unless the outcome surfaces as a normal command you can hook.
Use Beam for your coding agent's filesystem and network proposals; use pinned llm versions for CLI-side model routing and prompt databases. Neither replaces vendor-side containment stories like the July Hugging Face agent intrusion.
Frequently asked questions
What version of llm fixes the SQLite 3.54.1 logging crash?
0.37.3, per the release tag.
Why did Homebrew llm break after a SQLite update?
SQLite 3.54.1 fixed JSON subquery typing; llm's logging queries needed to match the documented behavior Willison describes in his November 16 post.
How do I upgrade llm to 0.37.3?
pip install -U llm or upgrade the Homebrew formula, then llm --version.
Does llm 0.37.3 affect Claude Code or Codex directly?
Only when those agents or their scripts invoke llm on the same machine.
What was the merged tool-call bug on Gemini-compatible endpoints?
Stream chunks without index caused multiple streamed tools to merge (#1862).
What happens when a model returns invalid JSON tool arguments now?
The tool is skipped and the error is fed back to the model (#1887).
Should I upgrade if I only use llm 0.37.2 for the API key security fixes?
Yes if you use logging, embeddings, tools, or OpenAI-compatible endpoints—not only chat completions.
Does Beam replace llm logging for compliance?
No. Beam is a separate on-device event pipeline; keep llm upgraded so your prompt history stays trustworthy.
Related reading
- llm 0.37.2 OpenAI key routing advisories
- API keys in logs and environment variables
- What AI agent monitoring tracks locally
- MCP security practical guide
- Node.js security release and MCP servers
- Beam: what we watch on-device
Release notes, SQLite behavior, and issue numbers reflect upstream sources as of November 17, 2026 UTC. Package versions on your machine may differ—verify before production use.

