Skip to main content

Architecture Overview

RunTools is built on four core primitives:
PrimitiveWhat it is
SandboxAn isolated Firecracker microVM — your compute environment
AgentAI logic — model, system prompt, tools, running inside a sandbox
ToolA server-side integration — GitHub, Gmail, Slack, or your own custom tools
WorkflowAn orchestration of multiple agents (coming soon)
These compose together: Agents need tools and a sandbox. Workflows orchestrate agents.

Project Structure

A RunTools project follows this structure:
my-project/
├── runtools.config.ts       # Project configuration
├── agents/
│   └── code-assistant.ts    # Agent definition (defineAgent)
├── tools/
│   └── my-tool.ts           # Custom tool definition (defineTool)
├── sandboxes/
│   └── dev-env.ts           # Sandbox definition (defineSandbox)
├── package.json
└── tsconfig.json
  • runtools.config.ts — Project-level settings (org, directories)
  • agents/ — Each agent is a TypeScript file using defineAgent() from the SDK
  • tools/ — Custom tools using defineTool() — deployed to your org via runtools deploy
  • sandboxes/ — Sandbox definitions using defineSandbox() — deployed via runtools deploy
Deploy everything with one command:
runtools deploy

Sandboxes

A Sandbox is an isolated Firecracker microVM with its own filesystem, network, and processes.

Key Properties

PropertyDescription
IsolatedEach sandbox runs in its own microVM with hardware-level isolation (KVM)
PausableSnapshot entire VM state to disk, resume in under a second
AccessiblePublic dev URLs via {port}-{sandboxId}.sandboxes.runtools.ai
SSH Accessssh sandbox-id@ssh.runtools.ai — key or password auth
DesktopFull XFCE4 desktop with VNC via desktop-ubuntu template

Lifecycle

StateDescription
creatingVM is booting (~5 seconds for cold start)
runningReady for commands, SSH, and VNC
pausedState saved to disk, zero compute cost
stoppedTerminated and cleaned up
Transitions: create → running → pause → paused → resume → running → destroy → stopped

Templates

TemplateDescription
base-ubuntuCLI environment with Bun, Node.js, common tools
desktop-ubuntuFull XFCE4 desktop + KasmVNC + Firefox ESR + Plank dock
Custom templates (Dockerfile-based) are planned but not yet available. Currently, use base-ubuntu for CLI environments and desktop-ubuntu for desktop/VNC use cases.

Agents

An Agent is an AI entity that runs inside a sandbox. It has a model, instructions, tools, and a sandbox to operate in.

Defining Agents

agents/code-assistant.ts
import { defineAgent } from '@runtools/sdk';

export default defineAgent({
  slug: 'code-assistant',
  name: 'Code Assistant',
  model: 'claude-sonnet-4',
  systemPrompt: `You are an expert software engineer.
You help users build applications by writing clean, well-documented code.`,
  tools: ['bash', 'read_file', 'edit_file', 'grep', 'web_search'],
});
Agents can also be created and managed from the dashboard via the Agent Builder UI.

Core Tools (Always Included)

Every agent gets these built-in tools — they cannot be removed:
ToolDescription
bashExecute shell commands in the sandbox
read_fileRead file contents with optional line range
edit_fileEdit files with string replacement
write_fileWrite new files
delete_fileDelete files
list_directoryList directory contents
file_searchFind files by name pattern
grepSearch file contents using ripgrep
web_searchSearch the web via Exa
get_dev_urlGet public URL for a dev server port

Marketplace Tools

Install additional tools from the marketplace:
ToolOAuth ProviderDescription
githubGitHubRepos, issues, PRs, code search
gmailGoogleSend, read, search emails
google-calendarGoogleEvents, scheduling, free/busy
google-sheetsGoogleRead, write, create spreadsheets
slackSlackMessages, channels, users
discordDiscordMessages, channels, servers
outlookMicrosoftEmail and calendar via Office 365
x-twitterXTweets, search, timeline
linkedinLinkedInPosts, profile, network
telegramTelegramMessages, photos, updates
All marketplace tools support OAuth auto-resolution — connect your account once and credentials are resolved automatically. You can also build and publish your own.

The Agent Loop

When you run an agent, the runtime executes a streaming loop:
  1. Prompt — User message + system prompt sent to the model
  2. Think — Model analyzes context, decides next action
  3. Tool Call — If needed, executes a tool and adds result to context
  4. Repeat — Continues until model returns a final text response (max 25 iterations, configurable up to 100)
Events streamed during execution: text-delta, tool-call, tool-result, thinking, done

Model Support

RunTools is model-agnostic. Supported providers and models:
ProviderModels
AnthropicClaude Opus 4.6, Opus 4.5, Sonnet 4.5, Sonnet 4, Haiku
OpenAIGPT-5.2, GPT-5.2 Pro, GPT-5, GPT-5 Mini, GPT-4.1, O4 Mini
GoogleGemini 3 Pro, Gemini 3 Flash, Gemini 2 Flash
xAIGrok 4, Grok 3
MistralMistral Large
DeepSeekDeepSeek, DeepSeek Reasoner
GroqLlama 4, Llama 3.3 70B

Tools

Tools are server-side integrations that agents can call. They run in the tools service (tools.runtools.ai), not inside sandboxes. Credentials are resolved automatically via OAuth or manual configuration.

Two Types

TypeDescription
Marketplace Tools10 official tools (GitHub, Gmail, Slack, Discord, and more) — install from the marketplace
Custom ToolsYour own tools — write with defineTool(), deploy with runtools deploy

Building Custom Tools

tools/my-database.ts
import { defineTool } from '@runtools/sdk';

export default defineTool({
  name: 'my-database',
  description: 'Query my application database',
  credentials: {
    required: ['databaseUrl'],
    schema: {
      databaseUrl: { type: 'string', description: 'PostgreSQL connection string' },
    },
  },
  actions: {
    query: {
      description: 'Execute a SQL query',
      parameters: {
        type: 'object',
        properties: { sql: { type: 'string', description: 'SQL query' } },
        required: ['sql'],
      },
      execute: async (params, credentials) => {
        // Your implementation
        return { rows: [] };
      },
    },
  },
});

Organizations and Projects

  • Organizations — top-level grouping. All resources (sandboxes, agents, tools, secrets, API keys, SSH keys) are org-scoped.
  • Projects — UI grouping within an org. Projects organize resources visually but don’t affect permissions. Every org has a default project.

Secrets & OAuth

Centralized credentials management:
  • Secrets — API keys and provider credentials, encrypted at rest with AES-256-GCM
  • Connected Apps — OAuth connections for automatic credential resolution (see OAuth)
  • SSH Keys — for sandbox access
  • Manage via dashboard (Credentials page), CLI (runtools secret set/list/delete), or API
  • Scoped by category: provider keys, tool keys, custom secrets

Next Steps

Sandboxes

Deep dive into sandboxes

Agents

Build your first agent

Tools

Explore the Tool Hub

CLI Reference

Manage everything from the command line