@sandagent/sdk — Run Claude in a Sandbox with Vercel AI SDK Streams

Published: (February 5, 2026 at 07:14 AM EST)
1 min read
Source: Dev.to

Source: Dev.to

Overview

sandagent/sdk is a TypeScript/JavaScript SDK for running Claude agents in a sandboxed environment (local or cloud). It exposes Vercel AI SDK‑compatible streaming, allowing you to:

  • Run AI agents in a controlled sandbox without exposing API keys
  • Stream messages using the Vercel AI SDK protocol
  • Use optional React chat hooks for building UI
  • Expose the sandboxed agent as an SDK‑compatible model

npm:

Example: Create a Sandboxed Session & Stream Messages

The following example demonstrates how to create a sandboxed session and stream messages in a way compatible with the Vercel AI SDK. The React chat hooks can be used to integrate real‑time UI components seamlessly.

import { SandAgentClient } from "@sandagent/sdk";

const client = new SandAgentClient({ apiKey: process.env.SANDAGENT_API_KEY });

// Create a sandboxed agent session
const session = await client.createSession("example-session", {
  model: "claude-2",
});

// Stream messages
const stream = client.streamMessages(session.id, { prompt: "Hello!" });
for await (const chunk of stream) {
  console.log(chunk);
}
Back to Blog

Related posts

Read more »

Ghibli moment for 3D Printing

Getting Started I bought my first 3D printer this week to make parts for the robot I'm building. The print head moves slowly, laying down each thin line of pla...