Scripting Runtime for Cloud-Native and Agentic Workload Automation

Starkite is a single-binary, dependency-free runtime for high-performance, testable, and portable Starlark scripts. Use it to automate system operations, cloud-native workflows, and agentic tool loops in a secure, sandboxed execution environment.

# Access local file systems, processes, and host services
def main():
    print("Host:", os.hostname(), "| Load:", os.loadavg())

    # Check service status without shell overhead
    status = os.exec("systemctl is-active nginx").strip()
    if status != "active":
        print("Service down, restarting...")
        os.exec("systemctl restart nginx")
# Contact HTTP web services and process JSON responses
def main():
    resp = http.get("http://127.0.0.1:8080/healthz", timeout="2s")
    if resp.status_code == 200:
        data = json.decode(resp.body)
        print("Service OK. Version:", data.get("version"))
    else:
        fail("Endpoint probe failed:", resp.status_code)
# Manage containers and their lifecycles
def main():
    dockr = containers.config()
    c = dockr.run(
        "redis:alpine",
        name    = "cache",
        ports   = {"6379/tcp": 6379},
        detach  = True,
    )
    print("Started container:", c.id[:12])
# Control Kubernetes cluster resources and workloads
def main():
    k8s.deploy("web-api", image="nginx:alpine", replicas=3)
    k8s.scale("deployment", "web-api", replicas=5)

    for pod in k8s.list("pods", labels="app=web-api"):
        print(pod.metadata.name, "->", pod.status.phase)
# Run SSH commands across fleet of remote hosts
def main():
    fleet = ssh.config(
        hosts = ["node-1", "node-2", "node-3"],
        auth  = {"user": "ops", "key": "~/.ssh/id_ed25519"},
        jump  = {"host": "bastion.corp.net", "user": "admin"},
    )
    for res in fleet.exec("uptime"):
        print(res.host, "->", res.stdout.strip())
# Expose Starkite functions as MCP tools to LLMs
def get_pod_health(namespace="default"):
    """Return pod status summary for an AI agent."""
    pods = k8s.list("pods", namespace=namespace)
    return {p.metadata.name: p.status.phase for p in pods}

def main():
    # Register and serve function as MCP tools agent harnesses
    mcp.serve(tools=[get_pod_health])
// Register Starkite scripts as secure, sandboxed 
// tools in agent harness configurations
{
  "mcpServers": {
    "cluster-ops": {
      "command": "kite",
      "args": ["run", "./tools/k8s.star", "--allow-net"]
    }
  }
}
<!-- Use Starkite scripts in skills.md files -->
---
name: k8s-triage
description: Safely inspect cluster workloads via Starkite.
---

## Agent Execution Rule
Run operational scripts within strict capability bounds:
$ kite run ./scripts/triage.star --permissions=allow-local
# Use the Starkite configuration file to define 
# capabilities and sandbox boundaries for scripts
permissions:
  agent-job:
    allow:
      - "fs.read($CWD/**)"
      - "net.connect(api.k8s.local)"
    deny:
      - os.exec
# Run with capability-based permission profile
$ kite run ./agent_tool.star --permissions=agent-job

# Run with default script sandbox
$ kite run ./untrusted.star --permissions=agent-job --sandbox-opaque

# Use container isolation to sandbox running scripts
$ kite run ./eval.star --sandbox-driver=podman
Get Started
$ curl -fsSL https://starkite.run/install.sh | sh

Quick Install

Install the kite binary on your local machine using your preferred setup:

curl -fsSL https://starkite.run/install.sh | sh
brew install project-starkite/tap/kite
irm https://starkite.run/install.ps1 | iex

Running Starkite Scripts

1. Run via the kite CLI

Starkite scripts run through the kite CLI. The kite run command (or its implicit shorthand) accepts any .star file and forwards --var arguments to the script — suitable for ad-hoc invocation, CI pipelines, and pipeline composition with other tools.

$ kite run ./deploy.star

# shorthand — `run` is implicit
$ kite ./deploy.star --var image_tag=v1.0.0

# pipe results to other tools
$ kite ./manifest.star | kubectl apply -f -

2. Execute via shebang

A starkite script with a #!/usr/bin/env kite shebang and the executable bit set runs like any other shell program. The kite prefix is not required at the call site.

$ cat deploy.star
#!/usr/bin/env kite
print("rolling out v1.0.0")

$ chmod +x deploy.star
$ ./deploy.star
rolling out v1.0.0

One Binary. Complete Automation.

Standard Library

Thirty built-in modules cover everyday automation: container runtimes (Docker/Podman), remote SSH fleets, files, processes, databases (SQL), HTTP client and server, JSON, YAML, CSV, gzip/zip, hashing, regex, templating, time, UUIDs, structured logging, retries, and concurrency. Every module is built directly into the runtime, eliminating the need for a Python venv, Node install, or external package manager.

Browse modules
#!/usr/bin/env kite

# Spin up an HTTP API server in a few lines
def health(req):
    return {"status": 200, "body": {"ok": True}}

def echo(req):
    return {"status": 200, "body": req.body}

http.serve({
    "GET /health": health,
    "POST /echo":  echo,
}, port=8080)

Cloud-Native

Starkite delivers unified infrastructure automation across three tiers without external CLI dependencies: direct container engine management over Docker and Podman daemon sockets (containers), agentless remote server fleet orchestration through SSH bastions (ssh, fleet), and cluster platform engineering with declarative controllers and admission webhooks (k8s).

Explore Cloud-Native
#!/usr/bin/env kite

# Orchestrate multi-tier cloud-native infrastructure
def main():
    # 1. Start ephemeral container dependency
    dockr = containers.config()
    db = dockr.run("postgres:16-alpine", detach=True, ports={"5432/tcp": 0})
    defer(lambda: (dockr.stop(db), dockr.delete(db)))

    # 2. Deploy matching Kubernetes service
    k8s.deploy(name="app-backend", image="ghcr.io/org/app:v1", replicas=2)

    # 3. Verify fleet node connectivity over SSH
    nodes = ssh.config(hosts=["edge-1", "edge-2"], auth={"user": "deploy"})
    for r in nodes.exec("systemctl status app-agent"):
        print(r.host, "Agent status:", r.ok)

Agentic AI

Supercharge your AI-native automation. Starkite integrates with LLMs and agent harnesses through standard protocols:

  • MCP Tool Serving: Expose Starlark functions as instant tools for external agents (Claude, Cursor, IDEs).
  • Sandboxed Execution: External agents run deterministic, dependency-free Starlark scripts within explicit capability boundaries.
  • Deterministic Tooling: Because Starlark is hermetic and sandboxed, AI agents can generate and execute scripts safely without environment drift.

Because Starlark is dependency-free and sandboxed, AI agents can generate and run scripts safely without complex setup.

MCP Integration
#!/usr/bin/env kite

# Expose cluster operations as MCP tools
def list_pods(namespace):
    """List pods in a namespace."""
    pods = k8s.list("pods", namespace=namespace)
    return [{"name":  p["metadata"]["name"],
             "phase": p["status"]["phase"]} for p in pods]

def restart_deployment(name, namespace):
    """Restart a deployment."""
    k8s.rollout("deployment", name,
        action="restart", namespace=namespace)
    return "restarted %s/%s" % (namespace, name)

mcp.serve(
    name  = "k8s-ops",
    tools = [list_pods, restart_deployment],
)

Security

Two layers of defense apply to every script. Permission profiles gate module calls at the API layer under a deny-by-default policy (os.exec denied, fs.read allowed). Pluggable OS-level sandboxing isolates the script across native kernel primitives (Landlock/Seatbelt) and container runtimes. Named profiles are defined in ~/.starkite/config.yaml and apply to any invocation via a single command-line flag.

Read the security model
# Named profile from ~/.starkite/config.yaml
$ kite run ./job.star --permissions=ci --sandbox-profile=ci

# Built-in ladder profile — no config file needed
$ kite run ./job.star --allow-fs

# Deny-all permissions + strict sandbox for untrusted code
$ kite run ./untrusted.star --permissions=deny-all --sandbox-opaque
Error: permission denied: os.exec is not allowed

Built-in Script Testing

Write tests

Test files end in _test.star and define test_* functions. Each test verifies conditions through the built-in assert(cond, msg), with optional setup() and teardown() hooks running before and after every test. The skip() built-in marks the current test as skipped.

def test_addition():
    assert(2 + 2 == 4, "basic math should work")

def test_string_contains():
    assert("kite" in "starkite", "starkite should contain kite")

def test_list_length():
    items = ["a", "b", "c"]
    assert(len(items) == 3, "list should have 3 items")

Run tests

The kite test command discovers every _test.star file under the given path, runs each test_* function, and reports pass/fail counts. The --verbose flag prints each test name as it runs. The exit code is non-zero on any failure.

$ kite test ./tests/
Found 1 test file(s)
============================================================
Tests: 3 passed, 0 failed, 3 total
Time:  9ms
============================================================

Ready to Start?

Get Started
$ curl -fsSL https://starkite.run/install.sh | sh