Logo von Databricks Sandbox

Databricks Sandbox

Organisation
databricks
databricks-sandbox

Databricks Sandbox: on-demand serverless compute for running untrusted or agent-generated code and background tasks. Create/start/stop/delete sandboxes, run commands (synchronous execute_command_sync in all SDKs; streaming execute_command in the Python SDK only), and manage files through the Databricks SDK (Python, Java, Go, JavaScript). Use for Databricks Sandbox, serverless code-execution environments, or coding-agent runtimes.

Übersicht

Herausgeberdatabricks
Repositorydatabricks-agent-skills
Skill-Namedatabricks-sandbox
Sterne
376
Forks
96
Mitgelieferte Dateien
4
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • 4 mitgelieferte Dateien

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von databricks auf GitHub veröffentlicht. Prüfen Sie den Quellinhalt vor der Installation.

Installation

Installieren Sie den KI-Skill Databricks Sandbox in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner — liest SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/databricks/databricks-agent-skills/tree/main/plugins/databricks/antigravity/skills/databricks-sandbox
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill anlegen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format lesen kann, kann diesen Skill nutzen — kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/databricks/databricks-agent-skills.git /tmp/databricks-agent-skills
mkdir -p .claude/skills
cp -r /tmp/databricks-agent-skills/plugins/databricks/antigravity/skills/databricks-sandbox .claude/skills/databricks-sandbox
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Databricks Sandbox in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Databricks Sandbox automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Databricks Sandbox nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Keys.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Databricks Sandbox

Databricks Sandbox is a serverless, isolated compute environment for humans and agents to run untrusted code. Drive it from code with the Databricks SDK, available in Python, Java, Go, and JavaScript. Lifecycle, file operations, and synchronous execute_command_sync are available in all four SDKs; streaming execute_command is currently Python-only. The examples in this skill use the Python SDK.

SDK reference (Python): https://databricks-sdk-py.readthedocs.io/en/latest/workspace/sandbox/sandbox.html Product docs: https://docs.databricks.com/compute/serverless/sandbox SDK user guide: https://docs.databricks.com/compute/serverless/sandbox-usage-guide REST API reference: https://docs.databricks.com/api/sandbox/v1/sandbox

Other language SDKs: Java, Go, JavaScript.

For the full per-method signature table, see references/sdk-reference.md.

Environment Setup

  • Install the SDK with the sandbox extra: uv pip install "databricks-sdk[sandbox]>=0.154.0". The sandbox extra supplies the gRPC dependencies that streaming execute_command needs (the plain databricks-sdk package omits them); lifecycle, file operations, and unary execute_command_sync work without the extra. 0.154.0 is the first release with the file-operation methods used below.
  • Authentication, profiles, and ~/.databrickscfg are covered by the databricks-core skill. The sandbox client authenticates like any other WorkspaceClient.
  • Your workspace must be in a supported region (see Features with limited regional availability) and have the Databricks Sandbox preview enabled on the workspace Previews page.

Resource Naming

A sandbox's resource name is sandboxes/<sandbox_id>. create_sandbox takes the bare sandbox_id; every other call takes the full name.

Lifecycle

Lifecycle calls return before the transition finishes (create_sandbox returns while PENDING, stop_sandbox while STOPPING), so poll get_sandbox(name).status.state and wait for the target state before depending on it.

python
import time

from databricks.sdk import WorkspaceClient
from databricks.sdk.service.sandbox import ComputeSpec, Sandbox, SandboxSpec, SandboxState
from google.protobuf.duration_pb2 import Duration

w = WorkspaceClient()

def wait_for_state(name: str, state: SandboxState, timeout: float = 300) -> Sandbox:
    deadline = time.monotonic() + timeout
    while time.monotonic() < deadline:
        sandbox = w.sandbox.get_sandbox(name=name)
        if sandbox.status and sandbox.status.state == state:
            return sandbox
        time.sleep(2)
    raise TimeoutError(f"{name} did not reach {state}")

# Create returns while the sandbox is still PENDING; wait for RUNNING before use.
# A sandbox bills hourly while running; set inactivity_timeout so it auto-stops when
# idle.
# Sandboxes can be updated with update_sandbox. The only accepted update paths
# are display_name and spec.compute.inactivity_timeout.
created = w.sandbox.create_sandbox(
    sandbox=Sandbox(spec=SandboxSpec(compute=ComputeSpec(inactivity_timeout=Duration(seconds=3600)))),
    sandbox_id="my-sandbox",
)
name = created.name  # "sandboxes/my-sandbox"
wait_for_state(name, SandboxState.SANDBOX_STATE_RUNNING)

# Inspect
sandbox = w.sandbox.get_sandbox(name=name)
for s in w.sandbox.list_sandboxes():
    print(s.name)

# Stop keeps the home directory; it returns while STOPPING, so wait for STOPPED
# before starting again.
w.sandbox.stop_sandbox(name=name)
wait_for_state(name, SandboxState.SANDBOX_STATE_STOPPED)
w.sandbox.start_sandbox(name=name)
wait_for_state(name, SandboxState.SANDBOX_STATE_RUNNING)

# Delete is terminal.
w.sandbox.delete_sandbox(name=name)

Stopping preserves only the home directory (/home/sandbox-agent, which holds up to 100 GB); data written elsewhere does not survive a stop (up to 10 GB of non-home storage, cleared on stop). Deleting a sandbox is terminal.

A stopped sandbox (previously by stop_sandbox()) can be restarted by explicit start_sandbox() or by running execute_command / execute_command_sync against the sandbox. For sandbox creation or restart through create_sandbox() and start_sandbox(), wait for the sandbox status to reach Running before using it; execute_command / execute_command_sync auto-starts a stopped sandbox and wait for it to reach Running, and no sandbox status polling is required.

Running Commands

Pick the mode by workload:

ModeMethodUse for
Synchronousexecute_command_syncShort commands where you only need the final stdout/stderr/exit code
Streamingexecute_commandLong-running or interactive commands where you consume output as it is produced

Streaming execute_command (the CommandProcess handle) is currently available only in the Python SDK; execute_command_sync is available in all SDKs.

cmd runs directly (not through a shell), so to use shell features invoke /bin/bash -c "..." explicitly via args.

Synchronous

python
from google.protobuf.duration_pb2 import Duration

resp = w.sandbox.execute_command_sync(
    "sandboxes/my-sandbox",
    "/bin/bash",
    args=["-c", "echo hello && whoami"],
    execution_timeout=Duration(seconds=30),
)
print(resp.status, resp.exit_code, resp.truncated, resp.stdout, resp.stderr)
# Check resp.status for the terminal status: exit_code is unset when the command is
# killed (e.g. timed out) or fails to start. resp.truncated is True when the output
# hit the sync size cap - use execute_command (streaming) for large output.

Streaming

execute_command returns a CommandProcess handle once the command has started. Iterate stdout / stderr for live output and call wait() for the exit code; use it as a context manager to release the client-side stream and reader thread on exit. Closing the handle (or leaving the with block) tears down the client side only - the command keeps running in the sandbox. There is no per-command cancel API; to actually stop it, read its server-side PID from proc.pid and kill it with a separate command, e.g. w.sandbox.execute_command_sync(name, "/bin/kill", args=[str(proc.pid)]).

python
with w.sandbox.execute_command(
    "sandboxes/my-sandbox",
    "/bin/bash",
    args=["-c", "for i in 1 2 3; do echo line $i; sleep 1; done"],
) as proc:
    for line in proc.stdout:
        print(line, end="")
    exit_code = proc.wait()  # also available as proc.exit_code once finished

stdout / stderr default to StreamMode.PIPE (buffered for reading); pass StreamMode.DEVNULL to discard, or StreamMode.STDOUT on stderr to merge it into stdout. Pass text=False for bytes instead of decoded str. Reattach to a still-running command with connect_command(name, command_id), and review history with list_commands(parent="sandboxes/my-sandbox").

Files

Manage the sandbox filesystem without a shell. All methods take parent (the sandbox name) plus a path. Write under the sandbox user's home directory, /home/sandbox-agent (the only persisted, writable tree; /home itself is root-owned, and paths outside the home directory are cleared on stop).

python
w.sandbox.create_directory(parent="sandboxes/my-sandbox", path="/home/sandbox-agent/data", parents=True)
for entry in w.sandbox.list_directory_contents(parent="sandboxes/my-sandbox", path="/home/sandbox-agent/data"):
    print(entry.path)
w.sandbox.get_metadata(parent="sandboxes/my-sandbox", path="/home/sandbox-agent/data")
w.sandbox.rename_path(parent="sandboxes/my-sandbox", source="/home/sandbox-agent/a", destination="/home/sandbox-agent/b")
w.sandbox.delete_path(parent="sandboxes/my-sandbox", path="/home/sandbox-agent/b", recursive=True)

Use the sandbox execute_command APIs to move data in and out; native API/SDK support for uploading and downloading file contents (local <-> sandbox) is not yet available.

When to Use

  • Agent / untrusted code execution - run model-generated code off the host, in isolation.
  • Ephemeral build/test environments - create, use, delete.

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-Skill Databricks Sandbox?

Databricks Sandbox: on-demand serverless compute for running untrusted or agent-generated code and background tasks. Create/start/stop/delete sandboxes, run commands (synchronous execute_command_sync in all SDKs; streaming execute_command in the Python SDK only), and manage files through the Databricks SDK (Python, Java, Go, JavaScript). Use for Databricks Sandbox, serverless code-execution environments, or coding-agent runtimes.

Warum Databricks Sandbox in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Databricks Sandbox besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Databricks Sandbox in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/databricks/databricks-agent-skills/tree/main/plugins/databricks/antigravity/skills/databricks-sandbox ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Databricks Sandbox nutzen?

Jedes Modell, das Sie in TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Databricks Sandbox verwenden?

So viele Sie möchten. Solange ein Modell Skills unterstützt, können Sie Databricks Sandbox damit verwenden – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama und weitere – alles in TypingMind mit Ihren eigenen API-Schlüsseln.

Ist der KI-Skill Databricks Sandbox kostenlos?

Der Skill wird von databricks auf GitHub veröffentlicht. Die Lizenzbedingungen finden Sie im Repository. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: eine Datei namens SKILL.md mit einem Namen und einer Beschreibung sowie allen Skripten, Vorlagen oder Referenzdateien, die das Modell möglicherweise benötigt. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und benötigen daher weder Server noch API-Schlüssel oder Laufzeitumgebung. Sie funktionieren mit jedem Modell.

Alle

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇