Skip to content

Stop the LangGraph checkpointer from loading arbitrary types - #147

Merged
tonibergholm-codento merged 1 commit into
mainfrom
strict-checkpoint-deserialization
Nov 20, 2026
Merged

tonibergholm-codento merged 1 commit into
mainfrom
strict-checkpoint-deserialization

Conversation

@tonibergholm-codento

Copy link
Copy Markdown
Collaborator

The LangGraph checkpointer resumed threads with LangGraph's default serializer settings, which rebuild any importable Python type named in a stored checkpoint. Anyone who can write a checkpoint the SDK later loads could run code in the agent process.

The checkpointer now uses the serializer's strict mode, which keeps LangGraph's safe type list, including langchain messages. It also rejects envelope types other than msgpack, null, bytes and bytearray. The dependency floor moves to langgraph>=1.1 and langgraph-checkpoint>=4.0.1, the first checkpoint release with the strict option.

Checkpoints that store custom classes outside the safe list now load as plain data instead of those objects.

Proof: new tests reject pickle and json envelopes and confirm that a non-allowlisted type is not rebuilt. They fail without the fix. The suite passes on the installed versions and at the declared floor, and ruff and mypy --strict pass.

Reviewed with sol-loop: 1 round with gpt-6.2-sol. Sol verdict: approved

Created with Claude Opus 5.5 and Claude Sonnet 5.5 in Claude Code.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5161c7be-8b87-4239-b316-ca386368e934
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T07:40:33.332757Z e6c419d New commits
🔒 Security Review ✅ Completed 2026-11-20T07:42:17.054251Z e6c419d New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tonibergholm-codento
tonibergholm-codento force-pushed the strict-checkpoint-deserialization branch 3 times, most recently from 3975b48 to 4c0f395 Compare November 20, 2026 07:34
Checkpoints are read from files that anyone with commit or write access to
the branch can change, but the checkpointer used JsonPlusSerializer with its
permissive default, which rebuilds any importable type named in the data. The
checkpointer now allows only langgraph's built-in safe msgpack types, and the
envelope loader rejects serialisation tags that dumps_typed never emits
(pickle, json).

The langgraph extra now requires langgraph-checkpoint>=4.0.1, the first
release with the allowed_msgpack_modules argument, and langgraph>=1.1, the
first line that accepts checkpoint 4.x.
@tonibergholm-codento
tonibergholm-codento force-pushed the strict-checkpoint-deserialization branch from 4c0f395 to e6c419d Compare November 20, 2026 07:39
@tonibergholm-codento
tonibergholm-codento merged commit 96ffa16 into main Nov 20, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant