Skip to main content
Glama
wesleyzhangwq

tiny-agent-sandbox

Tiny Agent Sandbox

A small, inspectable Docker-backed sandbox that agents can call as an MCP tool.

It runs Python, JavaScript, or shell snippets in a new container with no network, no host mounts, a read-only root filesystem, a non-root user, dropped capabilities, and hard resource/output limits. Results are returned as structured data for an agent to reason about.

WARNING

This is a learning and local-development project, not a production multi-tenant security boundary. Docker containers share a kernel. ReadSECURITY.md before using untrusted code.

What the agent sees

The MCP server exposes two tools:

  • sandbox_status() reports Docker readiness and missing runtime images.

  • run_code(language, code, timeout_seconds) returns stdout, stderr, exit status, timeout and truncation flags, duration, and the runtime image.

The agent cannot choose an image, command, mount, environment variable, network policy, or Docker flag. Those remain operator-controlled policy.

Related MCP server: dynamic-mcp

Quick start

Prerequisites: Docker, Python 3.11+, and uv.

git clone https://github.com/wesleyzhangwq/tiny-agent-sandbox.git
cd tiny-agent-sandbox

docker pull python:3.12-alpine
docker pull node:22-alpine
docker pull alpine:3.22

uv sync --no-editable
uv run --no-editable tas doctor
uv run --no-editable tas run python -c 'print(sum(range(10)))'

Start the MCP server over stdio:

uv run --no-editable tiny-agent-sandbox

Connect an MCP client

For clients that accept the common mcpServers JSON shape:

{
  "mcpServers": {
    "tiny-agent-sandbox": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/wesleyzhangwq/tiny-agent-sandbox",
        "tiny-agent-sandbox"
      ]
    }
  }
}

Pull the three runtime images before starting the client. Tool calls use --pull=never, so an agent cannot cause an image download.

Example tool input:

{
  "language": "python",
  "code": "import statistics\nprint(statistics.mean([2, 4, 9]))",
  "timeout_seconds": 5
}

Example structured result:

{
  "language": "python",
  "image": "python:3.12-alpine",
  "exit_code": 0,
  "stdout": "5\n",
  "stderr": "",
  "timed_out": false,
  "output_truncated": false,
  "duration_ms": 180
}

Default policy

Control

Default

Network

disabled

Root filesystem

read-only

Writable storage

64 MiB ephemeral /tmp (noexec, nosuid)

User

UID/GID 65534

Linux capabilities

all dropped

Privilege escalation

disabled

Memory / swap

256 MiB / 256 MiB

CPU

1 core

Processes

64

File descriptors

64

Wall time

5 seconds default, 30 seconds maximum

Input / combined output

64 KiB / 128 KiB

The fixed policy is assembled in src/tiny_agent_sandbox/runner.py. Timeout and output overflow remove the named container rather than merely terminating the Docker client.

Development

uv sync --no-editable --extra dev
uv run --no-editable ruff check .
uv run --no-editable pytest -m "not integration"

docker pull python:3.12-alpine node:22-alpine alpine:3.22
uv run --no-editable pytest -m integration

The preliminary ecosystem notes and design tradeoffs are in docs/research.md.

Roadmap

  • Optional gVisor (runsc) backend with explicit runtime detection.

  • Digest-pinned, operator-configurable runtime images.

  • Per-session workspaces with strict size and lifetime limits.

  • Egress proxy with destination allowlists and audit logs.

  • Concurrency quotas and OpenTelemetry execution traces.

License

Apache-2.0

Available Tools

2 tools
run_codeA

Run code without network or host mounts and return bounded stdout, stderr, and status.

The timeout may be 1-30 seconds. Output is truncated at the operator-controlled limit. Images must already exist locally; this tool never pulls an image on the agent's behalf.

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYes
languageYes
timeout_secondsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
imageYes
stderrYes
stdoutYes
languageYes
exit_codeYes
timed_outNo
duration_msYes
output_truncatedNo

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full disclosure burden, and it does well: it states no network/host mounts, bounded output with operator-controlled truncation, 1-30 sec timeout, and that images must already exist locally (never auto-pulls). These are genuine behavioral disclosures beyond the schema about constraints, safety, and dependence on pre-existing resources.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short, focused sentences. Each sentence earns its place: first states purpose and return type, second explains timeouts, third explains the image dependency. Zero waste, efficient and scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is relatively simple (3 params, 2 required, output schema provided), and the description covers the key behavioral constraints (no network, no mounts, local images, timeout, truncation). It adequately covers the safety and resource-dependence properties the agent would need to know before invoking. The output schema handles return-value documentation, so the description needn't explain that further.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for parameter documentation. The schema covers 3 params (code, language, timeout_seconds) with enum for language. The description mentions timeout range (1-30 sec) and output truncation which contextualizes the timeout_seconds parameter. However, no additional detail is given for what the output schema returns beyond 'stdout, stderr, and status', which is stated. With 0% coverage, some description of parameter semantics is needed; it partially provides it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Run code') plus resource constraints ('without network or host mounts') and return values ('bounded stdout, stderr, and status'). It's clear what the tool does. However, it doesn't explicitly distinguish from its sibling 'sandbox_status', though the purpose is different enough that this is mostly implicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains important constraints (no network/host mounts, timeout range 1-30 sec, requires local images) which imply when this code runner is/isn't appropriate. However, there's no explicit when-to-use vs the sibling 'sandbox_status', and no guidance on when NOT to use it or what the sandbox_status tool is for.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sandbox_statusA

Report Docker daemon readiness and any missing allowlisted runtime images.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNo
imagesYes
missing_imagesYes
server_versionNo
daemon_availableYes
docker_availableYes

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the behavioral burden. It conveys this is a read-only status operation (reports, doesn't modify). However, it doesn't mention whether it performs any setup actions, caches results, or has delays. The read-only implication is reasonably clear given 'report'.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence that efficiently conveys the tool's purpose with zero waste. It names both things it reports on (daemon readiness and missing images) without redundancy. This is appropriately concise for a zero-parameter status tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter status check tool with an output schema present, the description is largely complete. It identifies what the tool checks (daemon readiness, missing images). It doesn't describe return value format, but the output schema exists to cover that. Could mention whether readiness implies run_code will succeed, but overall adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so there is nothing the description needs to add about parameters. The baseline for 0-parameter tools is 4 per the rubric, and the description correctly contains no parameter-specific information since none exist.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool reports Docker daemon readiness and missing allowlisted runtime images. The verb 'report' with specific resources (Docker daemon readiness, runtime images) is specific. It distinguishes itself from run_code by being a status/read tool rather than an execution tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The context implies this is a readiness/health check tool—likely to be called before run_code to verify the sandbox environment. However, it doesn't explicitly state when to use it (e.g., 'check before running code') or contrast with alternatives. The usage pattern with run_code is implied but not stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv0.1.0
    • First observedrun_code
    • First observedsandbox_status

TDQS

A3.8/5.0
Disambiguation4/5

The two tools serve clearly distinct purposes: run_code executes code while sandbox_status reports environment readiness. There is no meaningful overlap between them, so an agent can easily distinguish which to use.

Naming Consistency5/5

Both tools follow a consistent verb_noun pattern: run_code and sandbox_status. The naming style is uniform snake_case with clear, descriptive verbs and nouns.

Tool Count3/5

With only 2 tools, the surface feels thin for a sandbox server that presumably supports code execution. A richer surface might include file operations, image management, or environment configuration, but for a narrowly-scoped execution sandbox two tools can be reasonable.

Completeness3/5

The core execute-and-check lifecycle is covered: run code and check readiness. However, there are notable gaps such as no image listing, no stop/cleanup of sandboxes, and no way to provision or configure runtimes beyond status reporting.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wesleyzhangwq/tiny-agent-sandbox'

If you have feedback or need assistance with the MCP directory API, please join our Discord server