Skip to main content
Challenge

Sandboxed Memory Profiling for Agent Code Execution with LangChain and E2B

Quantify KV-cache memory consumption and execution runtime when executing agent code snippets. Construct a LangChain agent using the E2B sandbox environment to execute untrusted code while tracking real-time host memory allocation and runtime overhead.

EngineeringHosted by Vera
Challenge brief

What you are building

The core problem, expected build, and operating context for this challenge.

Build a stateful LangChain agent that executes dynamic Python code in isolated E2B sandboxes and monitors KV-cache and system memory footprints under concurrent runs.

Delivery guide

How work is evaluated

Evaluation

Evaluates E2B sandbox metrics capture accuracy during agent tool invocation.

Datasets

Challenge datasets

Public datasets, plus the private datasets you have access to.

Evaluation rubric

How submissions are scored

These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.

Dimensions
2 scoring checks
Binary
2 pass or fail dimensions
Ordinal
0 scaled dimensions
Dimension 1

Execution Success Test

Check that return_code is 0.

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 2

Memory Overhead Drift

Measures accuracy of reported memory footprint. • target: 0.98 • range: 0-1

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

What you should walk away with

  • Deploy code execution sandboxes using E2B integrated with LangChain agents.

  • Track dynamic host RAM and GPU KV-cache allocation during concurrent code execution.

  • Ensure execution safety and isolation for automated code generation tasks.

Resources and assets

Reference links and supporting material

Dataset notes

A test suite of 20 computational Python scripts with known memory requirements.

Challenge setup

Evaluates E2B sandbox metrics capture accuracy during agent tool invocation.

Challenge input

Python code snippet to execute

LangChain

Agent orchestration framework.

E2B

Isolated microVM execution environment.

Evaluated output

JSON containing return_code, peak_memory_mb, execution_time_s

Evaluation checks
  • Check that return_code is 0.
  • Measures accuracy of reported memory footprint. • target: 0.98 • range: 0-1
Configured evaluation evidence
  • Benchmark: E2B Code Interpreter Benchmark
  • Memory Overhead Drift target: 0.98
  • 1 public reference case
Configured runtime
  • Python execution harness
  • Python sandbox (unavailable on Versalist)

Summary shows the first task, up to three tools, and up to three evidence items. Open the technical recipe to view all configured items.

View technical recipe

Configured tools

Environment
  • E2B · Optional
Action Space
  • Langchain · Required
  • LangChain · Optional
  • E2B · Optional
Orchestration
  • Langchain · Required
  • LangChain · Optional

Evaluation contract

  • Execution Success Test · Weight 1
  • Memory Overhead Drift · Weight 1

Metrics

  • Memory Overhead Drift · Target 0.98

Benchmarks

  • E2B Code Interpreter Benchmark
  • security

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: Python code snippet to execute

    Output: JSON containing return_code, peak_memory_mb, execution_time_s

    Execution harness: Python

Evaluation tools

  • LangChain · Framework
  • E2B · Agent System Sandbox

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Sandboxed Memory Profiling for Agent Code Execution with LangChain and E2B