Skip to content

Conversation

embersax
Copy link
Contributor

@embersax embersax commented Sep 5, 2025

Description:

Summary

This PR adds the foundation for E2B sandbox integration to provide secure code execution capabilities for
MLE-agent.

Changes

  • Added e2b-code-interpreter>=2.0.0 dependency to pyproject.toml
  • Created mle/function/sandbox_execution.py with:
    • SandboxExecutor class for managing E2B sandboxes
    • execute_in_sandbox convenience function
    • check_sandbox_availability utility function
  • Maintains full compatibility with existing execute_command interface

Context

Currently, MLE-agent executes code directly on the host system using subprocess.Popen, which poses security
risks when running untrusted code. This PR lays the groundwork for optional secure execution using E2B's
cloud-based sandboxes.

Future Work

  • Modify execution.py to support use_sandbox parameter
  • Update DebugAgent to leverage sandbox execution
  • Add configuration options for E2B API key

Testing

The implementation is designed to be fully backward compatible. E2B is an optional dependency that gracefully
fails if not available.

- Add e2b-code-interpreter dependency (>=2.0.0) to pyproject.toml
- Create sandbox_execution.py with SandboxExecutor class
- Provide basic sandbox execution functionality
- Maintain compatibility with existing execute_command interface

This is the foundation for integrating E2B's secure sandbox environment.
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant