crewAIInc / crewAIInc/crewAI

[FEATURE] Attribute CrewAI traffic to E2B via the SDK integration API in the E2B sandbox tools

Open
#7,310 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request vendor-pitch
Dominant language
Python
Stars
58.8k
Forks
8.5k
Avg merge
1d 15h
Merged PRs (30d)
109

Description

Feature Area

Integration with external tools

Is your feature request related to a an existing bug? Please link it here.

NA

Describe the solution you'd like

CrewAI's E2B sandbox tools currently create and connect to E2B sandboxes without identifying
themselves, so E2B has no way to distinguish traffic originating from CrewAI from any other
consumer of the SDK. E2B ships a first-class API for this — ConnectionConfig.set_integration(),
available since e2b 2.32.0 — and CrewAI is not using it.

Proposal: register a versioned integration identifier in the shared E2B base tool, immediately
before every sandbox acquisition (both Sandbox.create(...) and Sandbox.connect(...)).

Concretely:

  1. Define a module-level constant in e2b_base_tool.py:

    E2B_INTEGRATION = f"crewai-tools/{version('crewai-tools')}"
    
  2. Add a small _set_integration() helper that calls
    ConnectionConfig.set_integration(E2B_INTEGRATION), and invoke it on both sandbox
    acquisition paths before the sandbox is created or connected.

  3. Raise the optional e2b dependency floor to >=2.32.0,<3.0.0 in
    lib/crewai-tools/pyproject.toml, since set_integration does not exist below 2.32.0.
    The upper bound keeps CrewAI off an unreleased major.

  4. Cover both code paths with unit tests asserting the integration is registered before
    create/connect, so the ordering can't silently regress.

Describe alternatives you've considered
  1. Have users call ConnectionConfig.set_integration() themselves. Requires per-project
    setup code, is undocumented for most users, and would leave the majority of CrewAI E2B
    traffic unattributed. It also puts an E2B implementation detail into user crews.

  2. Set the integration in each concrete E2B tool instead of the shared base tool. Duplicates
    the same three lines across tools and is easy to forget when a new E2B tool is added. The base
    tool is the single choke point through which every sandbox is created or connected.

  3. Environment-variable based attribution (e.g. exporting an integration name). Out-of-band,
    not guaranteed to be present, and again shifts the burden to every user's environment rather
    than shipping correct behavior by default.

  4. Do nothing and rely on the SDK's default user agent. It does not identify CrewAI and
    carries no crewai-tools version, so it can't distinguish CrewAI traffic or track which
    CrewAI versions are in use.

  5. Keep the current e2b ~=2.20.0 pin and guard the call with hasattr/try-except. This was
    raised in review on the PR. It avoids bumping the floor, but silently no-ops on older SDKs,
    which means attribution is unreliable exactly where it matters. Given e2b is an optional
    extra and 2.32.0 is well within the supported 2.x line, a floor bump with an explicit
    <3.0.0 ceiling is the cleaner contract. Happy to switch to a guarded call if maintainers
    prefer not to move the floor.

Additional context

Implementation already exists as PR #6682, which was reviewed and approved but auto-closed by the
bot for not linking an issue. This issue is being filed to satisfy that requirement; the PR will
be reopened with Closes #<this issue> in the body.

Files touched by the proposed change:

  • lib/crewai-tools/pyproject.tomle2b bumped from ~=2.20.0 to >=2.32.0,<3.0.0
    (lock resolves 2.20.3 -> 2.34.0)
  • lib/crewai-tools/src/crewai_tools/tools/e2b_sandbox_tool/e2b_base_tool.py
    E2B_INTEGRATION constant plus _set_integration() on both sandbox acquisition paths
    (also lets an obsolete # type: ignore on the e2b import be dropped)
  • lib/crewai-tools/tests/tools/test_e2b_sandbox_tool.py — two tests asserting call ordering
    for the create and connect paths

Validation performed on the PR branch: ruff, mypy (clean), lock file check, wheel build, and a
manual run against e2b 2.32.0.

Scope: optional e2b extra only. No effect on users who don't install it, and no change to
sandbox behavior for users who do.

Willingness to Contribute

Yes, I'd be happy to submit a pull request

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/crewai-tools/src/crewai_tools/tools/e2b_sandbox_tool/e2b_base_tool.py and the existing PR #6682, then inspect the dependency change in lib/crewai-tools/pyproject.toml. Run lib/crewai-tools/tests/tools/test_e2b_sandbox_tool.py and confirm both sandbox acquisition paths register the versioned integration before create or connect.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.