Skip to content
VS Code

LLM Sandbox for VS Code

io.github.vndee/llm-sandbox

Securely run LLM-generated code in isolated containers across 7 languages and 3 container backends.

client:VS Code transport:stdio runtime:pypi

Install LLM Sandbox in VS Code

.vscode/mcp.json

{
  "inputs": [
    {
      "type": "promptString",
      "id": "backend",
      "description": "BACKEND",
      "password": true
    },
    {
      "type": "promptString",
      "id": "docker-host",
      "description": "DOCKER_HOST",
      "password": true
    },
    {
      "type": "promptString",
      "id": "kubeconfig",
      "description": "KUBECONFIG",
      "password": true
    },
    {
      "type": "promptString",
      "id": "namespace",
      "description": "NAMESPACE",
      "password": true
    },
    {
      "type": "promptString",
      "id": "commit-container",
      "description": "COMMIT_CONTAINER",
      "password": true
    },
    {
      "type": "promptString",
      "id": "keep-template",
      "description": "KEEP_TEMPLATE",
      "password": true
    },
    {
      "type": "promptString",
      "id": "sandbox-network-mode",
      "description": "SANDBOX_NETWORK_MODE",
      "password": true
    },
    {
      "type": "promptString",
      "id": "sandbox-read-only",
      "description": "SANDBOX_READ_ONLY",
      "password": true
    },
    {
      "type": "promptString",
      "id": "sandbox-cap-drop",
      "description": "SANDBOX_CAP_DROP",
      "password": true
    },
    {
      "type": "promptString",
      "id": "sandbox-security-opt",
      "description": "SANDBOX_SECURITY_OPT",
      "password": true
    },
    {
      "type": "promptString",
      "id": "sandbox-memory",
      "description": "SANDBOX_MEMORY",
      "password": true
    },
    {
      "type": "promptString",
      "id": "sandbox-cpus",
      "description": "SANDBOX_CPUS",
      "password": true
    }
  ],
  "servers": {
    "llm-sandbox": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "llm-sandbox"
      ],
      "env": {
        "BACKEND": "${input:backend}",
        "DOCKER_HOST": "${input:docker-host}",
        "KUBECONFIG": "${input:kubeconfig}",
        "NAMESPACE": "${input:namespace}",
        "COMMIT_CONTAINER": "${input:commit-container}",
        "KEEP_TEMPLATE": "${input:keep-template}",
        "SANDBOX_NETWORK_MODE": "${input:sandbox-network-mode}",
        "SANDBOX_READ_ONLY": "${input:sandbox-read-only}",
        "SANDBOX_CAP_DROP": "${input:sandbox-cap-drop}",
        "SANDBOX_SECURITY_OPT": "${input:sandbox-security-opt}",
        "SANDBOX_MEMORY": "${input:sandbox-memory}",
        "SANDBOX_CPUS": "${input:sandbox-cpus}"
      }
    }
  }
}

VS Code prompts for each input the first time the server starts, so no secret is written to the file. VS Code docs

LLM Sandbox in other clients