Bug: E2B sandbox authentication failure (401 Unauthorized)

Author: anchapinCreated Feb 23, 2026Updated Feb 23, 2026

Description

When running the LiveBench agent test, the wrap-up workflow fails to collect artifacts from the E2B sandbox due to authentication errors.

Error Messages

``` Response 401 ❌ Error listing artifacts: Failed to create E2B sandbox: 401: Unauthorized, please check your credentials. - authorization header is malformed ```

Root Cause

The `E2B_API_KEY` environment variable is either:

  • Not set in `.env` file
  • Invalid or expired
  • Malformed (incorrect format, extra spaces, quotes, etc.)

Impact

  • Agents cannot create artifacts in the sandbox
  • Wrap-up workflow fails to collect and submit work
  • All work submissions fail even if evaluation issues are fixed

Proposed Solution

  1. Add better error handling and validation for `E2B_API_KEY` in `livebench/tools/productivity/code_execution_sandbox.py`
  2. Add early validation at startup to check if E2B credentials are configured
  3. Add helpful error message with link to get API key (https://e2b.dev/)
  4. Consider graceful degradation when E2B is not available

Related

This was discovered during test runs. The error occurs in:

  • `livebench/tools/productivity/code_execution_sandbox.py` (line 77)
  • `livebench/agent/wrapup_workflow.py` (line 112)