@tanstack/ai-sandbox weekly downloads statistics
By tanstack (53 listings) · npm · AI SDKs
Provider-agnostic sandbox layer for TanStack AI — run harness adapters inside isolated sandboxes (defineSandbox, defineWorkspace, withSandbox) with a uniform SandboxHandle, workspace bootstrap, policy, and resumable lifecycle.
@tanstack/ai-sandbox has 135,913 recorded weekly downloads on npm, a decrease of 17.7% over the past 30 days, ranking #592 of 3,247 tracked listings.
About @tanstack/ai-sandbox
@tanstack/ai-sandbox
Provider-agnostic sandbox layer for TanStack AI. Run coding-agent harness adapters (Grok Build, Claude Code, Codex, OpenCode, Gemini CLI) inside an isolated environment with a real filesystem, shell, and cloned repo — and stream their work back through chat().
import { chat } from '@tanstack/ai'
import { grokBuildText } from '@tanstack/ai-grok-build'
import {
createSecrets,
defineSandbox,
defineWorkspace,
githubRepo,
withSandbox,
} from '@tanstack/ai-sandbox'
import { dockerSandbox } from '@tanstack/ai-sandbox-docker'
const sandbox = defineSandbox({
id: 'repo-agent',
provider: dockerSandbox({ image: 'node:22' }),
workspace: defineWorkspace({
source: githubRepo({ repo: 'owner/repo', ref: 'main' }),
packageManager: 'pnpm',
setup: ['corepack enable', 'pnpm install'],
scripts: { test: 'pnpm test', build: 'pnpm build' },
secrets: createSecrets({
XAI_API_KEY: process.env.XAI_API_KEY ?? '',
}),
}),
lifecycle: { reuse: 'thread', snapshot: 'after-setup' },
})
const stream = chat({
threadId: 'my-thread',
adapter: grokBuildText('grok-build'),
messages: [{ role: 'user', content: 'Fix the failing test.' }],
middleware: [withSandbox(sandbox)],
})
Installation
npm install @tanstack/ai @tanstack/ai-sandbox @tanstack/ai-grok-build
Pick a provider package for where the sandbox runs:
| Package | Use when |
|---|---|
@tanstack/ai-sandbox-local-process | Dev loop on your host (no isolation) |
@tanstack/ai-sandbox-docker | Isolated containers, snapshots, resume |
@tanstack/ai-sandbox-cloudflare | Cloudflare Workers + Containers |
@tanstack/ai-sandbox-vercel | Vercel Sandbox |
@tanstack/ai-sandbox-daytona | Daytona cloud sandboxes, snapshots |
@tanstack/ai-sandbox-upstash-box | Upstash Box cloud sandboxes, snapshots |
@tanstack/ai-sandbox-sprites | Sprites stateful sandboxes |
@tanstack/ai-sandbox-blaxel | Blaxel cloud sandboxes and previews |
@tanstack/ai-sandbox-boxd | boxd microVMs, live fork, snapshots |
@tanstack/ai-sandbox-e2b | E2B microVMs, snapshots and fork |
@tanstack/ai-sandbox-railway | Railway sandboxes, private networking |
Install the provider you select separately. For Blaxel:
npm install @tanstack/ai-sandbox-blaxel
Harness adapters are separate packages. The default path is Grok Build (@tanstack/ai-grok-build); others include @tanstack/ai-claude-code, @tanstack/ai-codex, and @tanstack/ai-opencode. All require withSandbox(...) middleware — chat() fails fast without it.
Three moving parts
| Part | What it is | How you configure it |
|---|---|---|
| Provider | Isolation primitive — host, container, cloud VM | dockerSandbox(), localProcessSandbox(), … |
| Workspace | What the agent boots into — repo, setup, secrets, skills | defineWorkspace({ … }) |
| Harness adapter | Which agent CLI runs and how output is translated | grokBuildText() (default), claudeCodeText(), codexText(), … |
defineSandbox() binds provider + workspace (+ optional policy, lifecycle, hooks). withSandbox(definition) is the chat() middleware that creates or resumes the sandbox for each run.
Core APIs
Workspace
Describe the working tree once, portably:
import {
bearer,
createSecrets,
defineWorkspace,
fileSkill,
gitSkill,
githubRepo,
mcpSkill,
} from '@tanstack/ai-sandbox'
const secrets = createSecrets({
GH: process.env.GH_TOKEN ?? '',
TOKEN: process.env.API_TOKEN ?? '',
})
defineWorkspace({
source: githubRepo({ repo: 'owner/app' }), // shallow clone by default
setup: ({ serial, parallel }) => {
serial('pnpm install')
parallel(['pnpm build', 'pnpm typecheck'])
},
scripts: { test: 'pnpm test' }, // surfaced in AGENTS.md; policy aliases
instructions: 'Run tests before proposing changes.',
skills: [
gitSkill({ repo: 'owner/skills', secret: secrets.GH }),
mcpSkill('api', {
url: 'https://mcp.example.com',
headers: { Authorization: bearer(secrets.TOKEN) },
}),
fileSkill({ path: '.hints.md', content: '# Hints\nPrefer pnpm.' }),
],
plugins: ['@anthropic/plugin-foo'], // Claude Code only; other harnesses warn+skip
secrets,
})
Skills and plugins are projected into each harness's native format at run time (.grok/config.toml, .mcp.json, .codex/config.toml, opencode.json, …). Bootstrap writes AGENTS.md and clones gitSkill repos; harness adapters handle the rest.
Policy
Guard what the agent may run:
import { defineSandbox, defineSandboxPolicy } from '@tanstack/ai-sandbox'
import type { SandboxProvider, WorkspaceDefinition } from '@tanstack/ai-sandbox'
declare const provider: SandboxProvider
declare const workspace: WorkspaceDefinition
const policy = defineSandboxPolicy({
default: 'allow',
})…
Description from the npm listing.
- ai
- ai-sdk
- typescript
- tanstack
- sandbox
- harness
- agent
- coding-agent
- isolation
- workspace
- tanstack-intent
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (592)Similar npm AI SDKs plugins
All 20 @tanstack/ai-sandbox alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@tanstack/ai-sandbox. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.