Repository navigation
Stop the LangGraph checkpointer from loading arbitrary types - #147
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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
force-pushed
the
strict-checkpoint-deserialization
branch
3 times, most recently
from
November 20, 2026 07:34
3975b48 to
4c0f395
Compare
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
force-pushed
the
strict-checkpoint-deserialization
branch
from
November 20, 2026 07:39
4c0f395 to
e6c419d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.1andlanggraph-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.