Skip to content

fix(security): patch deserialization, SQL injection, and path traversal vulnerabilities [SECT-601] - #8623

Merged
João Moura (joaomdmoura) merged 7 commits into
mainfrom
fix/security-sr-2026-0127
Oct 26, 2026
Merged

João Moura (joaomdmoura) merged 7 commits into
mainfrom
fix/security-sr-2026-0127

Conversation

@iris-clawd

@iris-clawd iris-clawd commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Security Patch — SR-2026-0127 / GHSA-wp6h-6xxh-g8fp

Fixes three security vulnerabilities:

1. Deserialization bypass in tool restoration (base_tool.py)

_resolve_tool_dict() used importlib.import_module() on attacker-controlled dotted paths from serialized checkpoint data without checking the _trusted_deserialize() guard. A malicious checkpoint could import and resolve arbitrary Python objects (e.g., os.system).

Additionally, cache_function strings were pre-resolved via _resolve_dotted_path() explicitly to bypass SerializableCallable's env-var guard.

Fix: Unregistered tool types now require CREWAI_DESERIALIZE_CALLBACKS=1. The cache_function pre-resolution block has been removed entirely — SerializableCallable's validator handles it with its own _trusted_deserialize() check.

2. NL2SQL read-only mode bypass via SQL comment injection (nl2sql_tool.py)

SQL comments (-- and /* */) could hide write commands from the read-only validator:

  • /* SELECT */ DELETE FROM users — block comment before write command
  • WITH d AS (/* read */ DELETE FROM users) SELECT 1 — block comment inside CTE body
  • -- comment\nDELETE FROM users — line comment before write command

The _extract_command(), _detect_writable_cte(), and _extract_main_query_after_cte() functions only checked the first token without stripping comments first.

Fix: Added _strip_sql_comments() helper that removes both -- line comments and /* */ block comments while preserving string literals. Applied to all three extraction points.

3. Tar extraction TOCTOU race condition (skills/main.py)

_safe_extractall() validated all archive members upfront but then called tf.extractall(dest) which extracts everything at once. Since symlinks and files are extracted in archive order, a symlink could be extracted first and a subsequent file could follow it outside the destination directory.

Fix: Replaced extractall() with phased member-by-member extraction: directories first, then regular files, then symlinks created manually via os.symlink() with re-verification of targets at creation time. This eliminates the TOCTOU window entirely.

Tests

  • Deserialization: 3 new tests verify that _resolve_tool_dict blocks unregistered tool types without the env var
  • NL2SQL: 7 new tests verify comment-based injection attempts are blocked in read-only mode
  • Tar extraction: 2 new tests verify phased extraction ordering and symlink target verification

Note

High Risk
Changes deserialization gates, SQL execution policy, and archive install paths—regressions could allow arbitrary imports, hidden writes, or path escape on older Python.

Overview
Addresses three security areas: checkpoint/tool deserialization, NL2SQL read-only validation, and skill archive extraction.

Tool restoration (base_tool.py): Serialized tool_type dicts no longer import arbitrary modules unless the type is under crewai. / crewai_tools. or CREWAI_DESERIALIZE_CALLBACKS=1. Non-BaseTool targets are rejected after import. The cache_function pre-resolution bypass is removed; the default cache path is stripped so restore works without the opt-in. JSON projects eagerly resolve tool_type via _resolve_tool_class so project-defined tools register before Pydantic hydration.

NL2SQL (nl2sql_tool.py): Read-only mode rejects any statement containing --, /*, or (MySQL/MariaDB only) #, instead of parsing/stripping comments—avoiding bypasses via quoting and dialect quirks. With allow_dml=True, commented statements are treated as writes for commit detection.

Tar fallback (_safe_extractall in CLI skills + skill cache): On Python without tarfile filter="data", symlink and hardlink members are blocked entirely (with a Python upgrade hint); only files and directories pass path checks before extractall. Tests cover link chains, hardlink-to-symlink cases, and traversal member names.

Reviewed by Cursor Bugbot for commit dfe4f74. Bugbot is set up for automated code reviews on this repo. Configure here.

@linear

linear Bot commented Oct 26, 2026

Copy link
Copy Markdown

SECT-601

@strix-security

strix-security Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Strix Security Review

✅ No open security findings. All previously reported findings have been resolved.

PR summary: Hardens three areas of the framework: checkpoint/tool deserialization now refuses to resolve non-first-party `tool_type` paths without an explicit opt-in and no longer pre-resolves `cache_function` strings, NL2SQL read-only mode now rejects any statement containing SQL comment markers instead of trying to strip them, and the skill-archive extraction fallback used on older Pythons now refuses symlink and hardlink members entirely.

Review summary

Re-review of the security patch at dfe4f740aec5. Both findings from the previous review are fixed in the current code, verified by execution rather than inspection: the NL2SQL read-only bypass (comment gate skipping only single-quoted literals) is closed because the validator now refuses statements containing comment markers outright with no quoting logic to disagree with, and every payload from the earlier report — quoted-identifier --, backtick and dollar-quote variants, the MySQL # CTE form, /*!50000 */, and comments between AS and ( — is rejected across sqlite, PostgreSQL, MySQL and MariaDB URIs; the skill-archive extraction finding is closed because both _safe_extractall copies refuse symlink/hardlink members before any extraction and resolve-check every remaining member, and 17 adversarial archives wrote nothing outside the destination. The deserialization hardening also holds: no non-first-party module import is reachable from checkpoint tool_type data without the opt-in (confirmed with an importlib tracer), cache_function dotted strings flow through the _trusted_deserialize gate, and the project-file pre-import is bounded by a BaseTool subclass check. The PR's own test suites pass for the touched areas.

One out-of-diff observation worth a separate change: read-only mode still accepts comment-free write statements on PostgreSQL through helpers this PR did not modify — EXPLAIN (ANALYZE true) DELETE FROM users (the option-value form ANALYZE [ boolean ] is not normalised by _resolve_explain_command) and WITH d AS MATERIALIZED (DELETE FROM users RETURNING *) SELECT 1 (_AS_PAREN_RE cannot match AS MATERIALIZED (). Both reproduce identically on the pre-PR version of the file, so they are not regressions introduced here, but they break the same read-only contract this PR is hardening and are cheap to fix alongside it.

3 resolved findings
Ruled out (4)
  • Can a write still be hidden from read-only validation behind a quoted identifier, dollar-quote, or MySQL `#` comment?
    The new gate is a raw substring refusal with no quoting logic at all, and every prior payload plus backtick, dollar-quote and identifier variants is rejected across sqlite, PostgreSQL, MySQL and MariaDB URIs.
  • Does the case-sensitive `db_uri` scheme comparison let a `#` comment slip past the MySQL/MariaDB marker check?
    A mixed-case scheme such as `MySQL:​//` does skip the marker, but SQLAlchemy rejects non-lowercase dialect names so engine creation raises and no statement is ever executed.
  • Can a malicious skill archive still write outside the destination through symlink or hardlink members?
    Both extractors refuse link members before any extraction and resolve-check every remaining file and directory member; 17 adversarial archives (including hardlink-to-dangling-symlink and pre-existing in-destination symlink chains) wrote nothing outside the destination.
  • Can an attacker-controlled checkpoint `tool_type` still cause an import or object instantiation outside the first-party packages?
    The prefix gate plus a post-import registry re-check refused `os.system`, `subprocess.Popen` and `builtins.eval` with an importlib tracer recording zero imports.
Review history (4)
  • Review 4 · dfe4f74 · Oct 26 18:45 UTC · Fixed 2
  • Review 3 · 9ef3c23 · Oct 26 18:24 UTC · Found 1 new Medium Vulnerability
  • Review 2 · 1edf182 · Oct 26 17:48 UTC · Fixed 1
  • Review 1 · 482fbda · Oct 26 15:26 UTC · Found 1 High Vulnerability and 1 Medium Vulnerability

Review 4 on this PR · dfe4f74 · requested Oct 26 18:27 UTC by @joaomdmoura


Reviewed by Strix
Re-run review · Configure security review settings

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread lib/cli/src/crewai_cli/skills/main.py Resolved

@strix-security strix-security Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strix flagged 2 new security findings below. See the pinned summary comment for the full PR status.

Comment thread lib/cli/src/crewai_cli/skills/main.py Resolved
iris-clawd and others added 4 commits October 26, 2026 10:11
…al vulnerabilities

Fixes three security issues reported in SR-2026-0127 / GHSA-wp6h-6xxh-g8fp:

1. Deserialization bypass: _resolve_tool_dict() now requires
   CREWAI_DESERIALIZE_CALLBACKS=1 for unregistered tool types, and stops
   pre-resolving cache_function strings that bypassed the env-var guard.

2. NL2SQL read-only bypass: SQL comment stripping prevents comment-based
   injection that could hide write commands from the read-only validator.

3. Tar extraction TOCTOU: Member-by-member extraction with post-creation
   symlink target verification eliminates race conditions in archive
   unpacking.

Linear: SECT-601
The gate on unregistered tool types also refused crewai's own tools when a
checkpoint was resumed in a fresh process, refused tools declared as dicts
in JSON project files, and, with the cache_function pre-resolution removed,
refused the default cache function on every serialized tool.

- crewai. and crewai_tools. tool types import without the opt-in. Any
  import now only registers classes, so a target that is not a BaseTool
  subclass is refused even with CREWAI_DESERIALIZE_CALLBACKS=1.
- The default cache_function path restores without importing anything;
  any other path still goes through SerializableCallable's gate.
- The JSON loader resolves dict tool_type through its trusted class-ref
  path, as it already does for "module:Class" strings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le comments

Comment stripping ran in three helpers but not in the EXPLAIN resolver or
the CTE matcher, so a comment after EXPLAIN or between AS and "(" still hid
a write. It also deleted MySQL/MariaDB executable comments, whose contents
the server runs, so "/*!50000 DROP TABLE t */ SELECT 1" passed as SELECT.

Each statement is now normalized once, where validation and the commit
decision start, so every check reads the same text. Comments become a
space, since DELETE/**/FROM is a DELETE; executable comments are kept
verbatim and fail closed as an unrecognised command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The phased extraction still let a dest-relative symlink be followed by a
later ".." member, and a hardlink to a dangling symlink member is
re-created by tarfile as that symlink at the hardlink's path, after its
target was checked against a different directory.

The fallback only runs on Pythons without filter="data" (before 3.10.12,
3.11.4, 3.12), so it now refuses symlink and hardlink members outright,
with a message naming the versions that handle them, checks every other
member's path, and extracts with extractall.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joaomdmoura

Copy link
Copy Markdown
Collaborator

I rebased on main and pushed three commits: 0e14ca7, d082e0e and 1edf182. Besides the review findings, the deserialization change had regressions that no review caught. All of them were reproduced on the previous head:

  • Checkpoint resume broke for every tool. Every serialized tool carries cache_function: "crewai.tools.base_tool._default_cache_function". With the pre-resolution removed, restoring any agent that has a tool failed without CREWAI_DESERIALIZE_CALLBACKS=1, including FileReadTool. The default now restores without importing anything. Any other cache_function path still goes through SerializableCallable's gate.
  • Fresh-process resume broke for crewai's own tools. The registry only knows classes that have already been imported, so a resume that hadn't imported crewai_tools refused them. crewai. and crewai_tools. tool types now import without the opt-in. Every import now only registers classes, so a target that is not a BaseTool subclass, such as os.system, is refused even with the opt-in set.
  • JSON projects with dict-form tools broke. This is the red test_load_agent_accepts_serialized_tool_dict. Project files are trusted and already import "module:Class" refs, so the JSON loader now resolves dict tool_type through the same class-ref path.

Verification

  • Full lib/crewai suite: no failures that main doesn't also have in my local run. Those failures are optional extras not installed locally.
  • NL2SQL tests pass with the sqlalchemy extra.
  • lib/cli skills tests and the mirrored lib/crewai/tests/cli tests pass.
  • ruff check and format are clean across lib/.
  • Every new test fails on the previous head, except the upgrade-hint test, which only changes a message.

Out of scope, needs a ticket: crewai.skills.cache._safe_extractall (lib/crewai/src/crewai/skills/cache.py:168) is the same fallback, with the link handling this PR replaces in the CLI. It should get the same change.

Strix (@strix-security) please re-review.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1edf182. Configure here.

Stripping comments only honoured single-quoted literals, so a comment
marker inside a double-quoted or backtick identifier or a dollar quote
truncated the statement: WITH "a--" AS (SELECT 1) DELETE FROM users was
validated as a lone CTE and executed. Any stripper has to match every
database's quoting rules, and each mismatch is a bypass.

Read-only mode now refuses statements with -- or /* outside single-quoted
literals; the scan can only end a literal early, never late, so it errs
toward refusing. With allow_dml=True, commented statements are committed
as writes. _strip_sql_comments is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joaomdmoura

Copy link
Copy Markdown
Collaborator

Pushed 9ef3c23 for the NL2SQL re-review finding. Read-only mode now refuses commented statements instead of stripping comments; details are in the thread. Strix (@strix-security) please re-review.

Skipping single-quoted literals let a quote inside an identifier open a
fake literal that swallowed a real comment, and MySQL's # comment was not
detected: WITH "q'" AS (SELECT 1 --') SELECT 1 / ) DELETE FROM users and
WITH a AS (SELECT 1 #) SELECT 1 / ) DELETE FROM users both passed.

Read-only mode now refuses -- and /* anywhere, including inside string
literals, and # when db_uri is MySQL or MariaDB (on PostgreSQL # is a JSON
operator). allow_dml=True keeps committing commented statements as writes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
crewai.skills.cache._safe_extractall is the same fallback the CLI uses,
with the link-target validation the CLI copy dropped: a dest-relative
symlink can still carry a later member's write outside the cache
directory. Apply the same link-refusing version and note that the two
copies must change together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joaomdmoura

Copy link
Copy Markdown
Collaborator

The latest push addresses both Strix re-review findings:

  • NL2SQL: comment markers are refused anywhere in read-only mode, as described in the thread.
  • Skill cache: crewai.skills.cache._safe_extractall gets the same link-refusing fallback as the CLI copy. Its docstring now says the two copies must change together. I did not merge them: one package importing the other here is a separate call.

Strix (@strix-security) please re-review.

@github-actions github-actions Bot added size/XL and removed size/L labels Oct 26, 2026

@alex-clawd alex-clawd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. All three fixes are sound, and in two places the implementation is stronger than what the description claims. Flagging that gap because the PR body is what ends up in the advisory.

1. Deserialization guard — correct, and the registry re-check is the good part

The important detail is that resolution no longer trusts the import:

importlib.import_module(dotted.rpartition(".")[0])
tool_cls = _TOOL_TYPE_REGISTRY.get(dotted)
if tool_cls is None:
    raise ValueError(f"Tool type '{dotted}' is not a BaseTool subclass")

The old code did getattr(import_module(mod), cls_name) and returned whatever came back, so os.system resolved to a callable. Now the registry is the authority, and it is only populated through BaseTool.__init_subclass__, so a non-tool attribute cannot come out the other end even when the module imports fine.

I checked the _FIRST_PARTY_TOOL_PACKAGES prefix for bypasses:

crewai.tools.base_tool.MyTool   allowed   (intended)
crewai_tools.tools.foo.FooTool  allowed   (intended)
crewai_evil.Tool                blocked
crewai_tools_evil.Tool          blocked
crewaiX.Tool                    blocked
os.system / subprocess.Popen    blocked

The trailing dot in both prefixes is doing real work — without it crewai_evil would match. Worth keeping a comment on that if anyone ever edits the tuple.

One input slips the prefix test: "crewai." on its own passes startswith, imports the crewai package, then fails the registry lookup and raises. Harmless, since importing crewai is already happening, but it is the one case where the gate is passed by something that is not a real first-party path.

Removing the cache_function pre-resolution is the right call — that block existed specifically to hand SerializableCallable a resolved callable so its env-var guard would not fire, which is the definition of a bypass. Keeping the default-path special case means resume still works without the opt-in, and the default needs no import at all.

json_loader.py is the necessary counterpart: project files are trusted, so pre-registering the class there keeps declarative projects working without weakening the checkpoint path. Good separation — the trust boundary is where the data comes from, not what the data says.

2. NL2SQL — the implementation is better than the description

The PR body says a _strip_sql_comments() helper was added that removes comments "while preserving string literals." That is not what shipped, and the thing that shipped is the safer design:

def _has_sql_comment(sql: str, db_uri: str) -> bool:
    markers = ["--", "/*"]
    if db_uri.split(":", 1)[0].split("+", 1)[0] in ("mysql", "mariadb"):
        markers.append("#")
    return any(marker in sql for marker in markers)

Refuse rather than strip. The docstring explains exactly why, and it is the correct instinct:

that has to agree with every database's quoting rules (identifiers, backticks, dollar quotes, MySQL /*! */), and any disagreement lets a write hide from the validator

A comment stripper is a parser, and a parser that disagrees with the database by one edge case reintroduces the bug. MySQL's /*! ... */ executable comments alone would make stripping unsafe — content inside them runs. Refusing is coarser and occasionally annoying, but it cannot be out-parsed.

Two details I liked:

  • # is only a comment marker on MySQL/MariaDB and is a JSON operator on PostgreSQL, so it is gated on the dialect. Getting that backwards would have broken valid Postgres queries.
  • _is_write_stmt treats a commented statement as a write, with the reasoning that committing a read is harmless. Failing toward the restrictive side in the transaction path is right.

Please update the PR body before this becomes an advisory. It currently describes a stripping approach and names a function that does not exist.

3. Tar extraction — also not what the description says

The body describes "phased member-by-member extraction: directories first, then regular files, then symlinks created manually via os.symlink() with re-verification." The code does something simpler and stronger: it refuses link members outright.

if member.issym() or member.islnk():
    raise ValueError(
        f"Blocked link member {member.name!r}: installing skills that "
        "contain links needs Python 3.10.12+, 3.11.4+, or 3.12+"
    )

This is the better fix. Phased extraction with re-verification still has to reason about ordering and about what the filesystem looks like at each step; refusing links removes the TOCTOU window by removing the feature on a fallback path that only runs on old Python. The error message tells the user the exact versions that restore support, which keeps it from being a dead end.

Note this is a real behavior change, not just a hardening: test_allows_benign_relative_symlink became test_refuses_links_with_upgrade_hint. A skill archive containing an entirely benign internal symlink now fails to install on Python < 3.10.12 / < 3.11.4. That is the right trade for a security fallback, but it should be in the release notes rather than discovered by a user.

Both copies — crewai_cli/skills/main.py and crewai/skills/cache.py — were updated identically, and the second now carries a "change both together" comment. Worth considering whether that duplication should collapse into one shared helper at some point, since two copies of a security control will eventually drift.

Summary

All 28 checks green, including CodeQL, Bugbot, Strix, and pip-audit across four Python versions. Test coverage matches the three fixes: 3 deserialization, 7 NL2SQL comment-injection, and the rewritten extraction tests.

Only ask before merge: reconcile the PR description with what the code actually does for #2 and #3. The shipped behavior is better in both cases, and the advisory should say so accurately.

@joaomdmoura
João Moura (joaomdmoura) merged commit ed0abf2 into main Oct 26, 2026
61 checks passed
@joaomdmoura
João Moura (joaomdmoura) deleted the fix/security-sr-2026-0127 branch October 26, 2026 21:19
João Moura (joaomdmoura) added a commit that referenced this pull request Oct 27, 2026
…store

A tool cache_function that could not be saved (a lambda or bound method)
is now restored as a named never-cache function instead of the BaseTool
default, so a guard on a state-changing tool fails closed.

A classmethod reached through a subclass is now saved under the class it
is bound to, so it rebinds to that class after a restore instead of the
parent that defines it.

The checkpointing docs (en/ar/ko/pt-BR) say the construction warning
fires only when a callback is passed in, not when set as an attribute.
A tool cache_function path stays behind CREWAI_DESERIALIZE_CALLBACKS, as
#8623 made it; only the default restores without the opt-in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
João Moura (joaomdmoura) added a commit that referenced this pull request Oct 28, 2026
…store

A tool cache_function that could not be saved (a lambda or bound method)
is now restored as a named never-cache function instead of the BaseTool
default, so a guard on a state-changing tool fails closed.

A classmethod reached through a subclass is now saved under the class it
is bound to, so it rebinds to that class after a restore instead of the
parent that defines it.

The checkpointing docs (en/ar/ko/pt-BR) say the construction warning
fires only when a callback is passed in, not when set as an attribute.
A tool cache_function path stays behind CREWAI_DESERIALIZE_CALLBACKS, as
#8623 made it; only the default restores without the opt-in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
João Moura (joaomdmoura) added a commit that referenced this pull request Oct 28, 2026
…store

A tool cache_function that could not be saved (a lambda or bound method)
is now restored as a named never-cache function instead of the BaseTool
default, so a guard on a state-changing tool fails closed.

A classmethod reached through a subclass is now saved under the class it
is bound to, so it rebinds to that class after a restore instead of the
parent that defines it.

The checkpointing docs (en/ar/ko/pt-BR) say the construction warning
fires only when a callback is passed in, not when set as an attribute.
A tool cache_function path stays behind CREWAI_DESERIALIZE_CALLBACKS, as
#8623 made it; only the default restores without the opt-in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
João Moura (joaomdmoura) added a commit that referenced this pull request Oct 28, 2026
…ing restore (#8596)

* fix(checkpoint): save unrestorable callbacks as null instead of breaking restore

A restore builds the crew from the checkpoint file, so callbacks survive
only as dotted paths to module-level functions. Bound instance methods were
saved as "mod.Class.method", which resolves to the unbound function and
crashed the resumed run with a missing-argument TypeError. Partials and
callable instances made the serializer raise, so no checkpoint was written
at all.

callable_to_string now returns None for bound instance methods and for
callables without __module__/__qualname__, matching how lambdas and closures
were already handled. Classmethods still round-trip. The construction-time
warning now uses the same rule and says the callback is dropped and will
not run after a restore. The checkpointing docs (en, ar, ko, pt-BR) explain
what a restore does not bring back and the CREWAI_DESERIALIZE_CALLBACKS
opt-in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(checkpoint): restore tools and agents whose callables were saved as null

A checkpoint saves a callable it cannot name (a lambda, closure, bound
method, partial or callable instance) as null. Restoring then failed with
"Expected a callable or dotted-path string, got NoneType" when that null
sat in a tool's cache_function or an agent's callbacks list. Those fields
now restore without it: a null cache_function falls back to the tool's
default, and null entries are dropped from BaseAgent.callbacks, the same way
Crew already drops them from its kickoff callback lists.

The docs now say that such a tool cache_function falls back to the
default, and the pt-BR anchor keeps its accents to match the heading slug.
This also reverts an unrelated edit to TestCheckpointReusedExecutor that
the previous commit made.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(checkpoint): never cache after losing a tool cache_function on restore

A tool cache_function that could not be saved (a lambda or bound method)
is now restored as a named never-cache function instead of the BaseTool
default, so a guard on a state-changing tool fails closed.

A classmethod reached through a subclass is now saved under the class it
is bound to, so it rebinds to that class after a restore instead of the
parent that defines it.

The checkpointing docs (en/ar/ko/pt-BR) say the construction warning
fires only when a callback is passed in, not when set as an attribute.
A tool cache_function path stays behind CREWAI_DESERIALIZE_CALLBACKS, as
#8623 made it; only the default restores without the opt-in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(checkpoint): pass the callable-instance class directly to the parametrize list

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(checkpoint): restore a saved never-cache function without the opt-in

A restored tool whose cache_function was lost is saved by name as
_never_cache_function on the next checkpoint. Only the default path was
exempt from CREWAI_DESERIALIZE_CALLBACKS, so restoring that second
checkpoint raised "Refusing to resolve callback path". Both of crewAI's
own cache functions now restore by name, without an import or the opt-in.
Any other path still goes through the gate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants