← back

[Full Workshop] How to add secure code interpreting in your AI app: Vasek Mlejnsky

1.2K views · Feb 06, 2025 · 108:15 min · Watch on YouTube ↗
Takeaway

Adding secure AI code execution to an app is now a few-hundred-line integration with e2b sandboxes plus Vercel AI SDK function calling.

Summary

  • Vasek Mlejnsky (e2b co-founder) live-codes a Claude Sonnet 3.5 'AI artifacts' clone that runs Python in secure sandboxes via function calling.
  • e2b sandboxes are Ubuntu VMs that spin up in hundreds of milliseconds; the code-interpreter SDK wraps a Jupyter server supporting Python, JS, R, Java (beta) with stdout/stderr/chart outputs.
  • Stack: Next.js + Vercel AI SDK for streaming + Anthropic API + e2b code-interpreter SDK; user prompt -> Claude generates code -> sandbox executes -> chart/result streamed back.
  • Pitches e2b as soon-to-be self-hostable on AWS/GCP/Azure for enterprises wanting full sandbox control.
code-interpretersandboxese2b
Original description
In this workshop, I'll show you how to add secure AI code execution that supports any LLM in your AI app using E2B. AI-powered code execution improves reasoning of LLMs and allows you to build AI-based dashboards where users can chat with their data, generative UI, or coding agents like Devin.

We'll be using a prepared repository with Next.js app from E2B's cookbook: https://github.com/e2b-dev/e2b-cookbook/tree/main/examples/anthropic-power-artifacts

Tech stack:

Anthropic's Sonnet 3.5 (get your API key here - https://console.anthropic.com/)
E2B's Code Interpreter SDK (get your API key here - https://e2b.dev/docs/getting-started/api-key)
Next.js
Vercel's AI SDK

Recorded live in San Francisco at the AI Engineer World's Fair. See the full schedule of talks at https://www.ai.engineer/worldsfair/2024/schedule & join us at the AI Engineer World's Fair in 2025! Get your tickets today at https://ai.engineer/2025

About Vasek
Vasek is building cloud for AI agents. He is the CEO of E2B.dev, a 100% open-source cloud runtime for AI agents, that he co-founded with his high-school friend Tom. They have been building dev tools together before. E2B has customers from various fields, from bioinformatics, through programming and data analysis, to a big American sport organization. Vasek has always been a big fan of startups - when he needs recharge he rewatches an episode of Silicon Valley Series. He is excited about any new dev tool, and he also relaxes running or playing tennis.