惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
F
Fortinet All Blogs
Microsoft Azure Blog
Microsoft Azure Blog
腾讯CDC
Vercel News
Vercel News
Recent Announcements
Recent Announcements
博客园 - Franky
小众软件
小众软件
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
宝玉的分享
宝玉的分享
I
InfoQ
博客园 - 聂微东
Jina AI
Jina AI
J
Java Code Geeks
V
V2EX
U
Unit 42
Stack Overflow Blog
Stack Overflow Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
阮一峰的网络日志
阮一峰的网络日志
L
LangChain Blog
T
The Blog of Author Tim Ferriss
量子位

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How I cut my OpenAI Agent latency by replacing cloud sand...
Markov · 2026-04-28 · via DEV Community
Cover image for How I cut my OpenAI Agent latency by replacing cloud sandboxes with a local microVM

Markov

A few days ago, I was building a coding agent using the new OpenAI Agents SDK. Like everyone else, I plugged in one of the official cloud sandboxes (I won't name names, they are all generally good).

My agent was working, but it felt incredibly sluggish.

I looked at the logs. My agent was averaging about 15 tool calls per task. Because the sandbox was hosted in the cloud, the physical path looked like this:

My Agent Runtime → Internet → Cloud Sandbox → MicroVM → Internet → My Agent Runtime

Every single exec_command was doing two round trips across the public internet. That's 30 network hops per task. The cloud provider advertised a "90ms cold start", but what was actually killing my UX was the constant RTT overhead on every tool call.

I tried falling back to the SDK's default local option (bubblewrap on Linux). It was fast, but it relies on process-level syscall filters. Running untrusted LLM-generated code directly on my host kernel just felt like a disaster waiting to happen.

Finding the middle ground: BoxLite

I wanted the hardware isolation of a cloud VM, but the zero-latency of a local process. I found BoxLite. https://github.com/boxlite-ai/boxlite

BoxLite is essentially the SQLite of sandboxing. It's an embedded microVM that uses KVM (Linux) or Hypervisor.framework (macOS) to spin up a dedicated guest kernel right on your machine.

The best part? No daemons to configure, no Docker sockets, no root access. Just a pip install:

pip install boxlite-openai-agents

Enter fullscreen mode Exit fullscreen mode

The 1-Line Swap

I didn't have to rewrite my agent logic. I just changed the client in my RunConfig:

from boxlite_openai_agents import BoxLiteSandboxClient, BoxLiteSandboxClientOptions

# ... agent setup ...

await Runner.run(
    agent,
    "Write fizzbuzz.py for n=15 and run it.",
    run_config=RunConfig(
        sandbox=SandboxRunConfig(
            client=BoxLiteSandboxClient(), # <-- Changed this line
            options=BoxLiteSandboxClientOptions(
                image="python:3.12-slim"
            ),
        ),
    ),
)

Enter fullscreen mode Exit fullscreen mode

The Result

The latency dropped immediately. Because the microVM runs in the same process as the agent runtime, the internet hops went from 30 down to zero. The communication is all microsecond-level IPC.

Plus, because it uses QCOW2 snapshots, I stopped having to re-run pip install pandas on every session. I just snapshot the VM state and resume it the next day in under a second.

If you are building coding agents on your laptop and are tired of cloud latency and timeouts, definitely give local microVMs a try. It completely changed my workflow.