kosa8 docs Dashboard
esc
↑ ↓ move↵ openRuns in your browser; nothing you type is sent anywhere.

Get started

Quickstart

kosa8 is Zero Trust cybersecurity infrastructure for AI agents. Three steps, about a minute, to your first sandbox. Choose a language once: every tabbed example in these docs switches with it, and remembers.

1. Sign up (free) and get an API key#

Sign up at app.kosa8.com: free, no card. The Starter tier gives $10 of usage, 2 sandboxes running at once, no time limit (see pricing). Then make a key under API keys. It is shown once and starts with k8c_live_. Every SDK and the CLI read it from KOSA8_API_KEY.

Optional. Fills k8c_live_… into the snippets on this page so you can paste them as they are. Kept in this browser tab only, never sent anywhere.
export KOSA8_API_KEY=k8c_live_…

Prefer not to handle keys? kosa8 login signs the CLI in through your browser instead.

2. Install#

curl -fsSL https://kosa8.com/install.sh | sh     # macOS and Linux
brew install azmxai/kosa8/kosa8                  # or with Homebrew
irm https://kosa8.com/install.ps1 | iex          # Windows PowerShell
# Nothing to install: curl and jq are all you need.
curl --version | head -1 && jq --version
pip install kosa8        # Python 3.9+, or: uv add kosa8
npm install @kosa8/sdk   # Node.js 18 or later
go get github.com/kosa8ai/kosa8-go@latest
gem install kosa8        # or in a Gemfile: gem "kosa8"
<!-- Maven (Java 17+); Gradle: implementation("com.kosa8:kosa8:0.6.0") -->
<dependency>
  <groupId>com.kosa8</groupId>
  <artifactId>kosa8</artifactId>
  <version>0.6.0</version>
</dependency>

3. Run code in a sandbox#

Create a sandbox from the python template, run a command, read its output, delete it:

kosa8 run --cloud python:3.12-slim python3 -c 'print(6 * 7)'
# Create a sandbox from the python template
SBX=$(curl -s https://api.kosa8.com/v1/sandboxes \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"template":"python","ttl_s":600}' | jq -r .sandbox.id)

# Run a command in it
curl -s https://api.kosa8.com/v1/sandboxes/$SBX/exec \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"cmd":["python3","-c","print(6 * 7)"]}'

# Delete it
curl -s -X DELETE https://api.kosa8.com/v1/sandboxes/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY"
from kosa8 import Kosa8Cloud

cloud = Kosa8Cloud()  # reads KOSA8_API_KEY

with cloud.sandboxes.create(template="python", ttl_s=600) as box:
    r = box.exec(["python3", "-c", "print(6 * 7)"])
    print(r.exit_code, r.stdout)  # 0 42
# the sandbox is deleted when the block ends
import { Kosa8Cloud } from '@kosa8/sdk';

const cloud = new Kosa8Cloud(); // reads KOSA8_API_KEY

const box = await cloud.sandboxes.create({ template: 'python', ttlS: 600 });
try {
  const r = await box.exec(['python3', '-c', 'print(6 * 7)']);
  console.log(r.exitCode, r.stdout); // 0 42
} finally {
  await box.delete();
}
package main

import (
	"context"
	"fmt"
	"log"

	kosa8 "github.com/kosa8ai/kosa8-go"
)

func main() {
	ctx := context.Background()
	cloud, err := kosa8.NewCloud(kosa8.CloudOptions{}) // reads KOSA8_API_KEY
	if err != nil {
		log.Fatal(err)
	}

	box, err := cloud.Sandboxes.Create(ctx, kosa8.CloudCreateOptions{Template: "python", TTLSeconds: 600})
	if err != nil {
		log.Fatal(err)
	}
	defer box.Delete(ctx)

	r, err := box.Exec(ctx, []string{"python3", "-c", "print(6 * 7)"}, nil)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Print(r.Stdout) // 42
}
require "kosa8"

cloud = Kosa8::Cloud.new # reads KOSA8_API_KEY

box = cloud.sandboxes.create(template: "python", ttl_s: 600)
begin
  r = box.exec(["python3", "-c", "print(6 * 7)"])
  puts r.exit_code, r.stdout # 0, 42
ensure
  box.delete
end
import com.kosa8.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Kosa8Cloud cloud = Kosa8Cloud.builder().build(); // reads KOSA8_API_KEY

        CloudSandbox box = cloud.sandboxes().create(
            new CloudOptions.Create().template("python").ttlSeconds(600));
        try {
            CloudExecResult r = box.exec("python3 -c 'print(6 * 7)'");
            System.out.println(r.exitCode() + " " + r.stdout()); // 0 42
        } finally {
            box.delete();
        }
    }
}

You should see 42. The sandbox was a microVM in us-ash1 (Ashburn, Virginia), and it is gone. The ttl_s of 600 is a safety net: even if your program crashed before the delete, kosa8 would delete the sandbox ten minutes later.

Even shorter: one call, no sandbox to manage#

POST /v1/run takes a warm sandbox, runs your code, returns the output and deletes the sandbox, all in one request:

kosa8 run -q "python3 -c 'print(6 * 7)'"
curl -s https://api.kosa8.com/v1/run \
  -H "Authorization: Bearer $KOSA8_API_KEY" -H 'Content-Type: application/json' \
  -d '{"code": "print(6 * 7)", "language": "python"}' | jq -r '.run.stdout'

It takes files, returns files and streams. See One-call run.

No account yet: the agent trial#

An AI agent with no key, no account and no browser can see kosa8 run code before anyone signs up. POST https://api.kosa8.com/v1/try/agent takes {"language": "python" | "node" | "bash", "code": "…"}, needs no Authorization header and never shows a CAPTCHA:

curl -s https://api.kosa8.com/v1/try/agent \
  -H 'Content-Type: application/json' \
  -d '{"language": "python", "code": "print(1+1)"}'

The answer is {run: {status, exit, stdout, stderr, duration_ms, view_url, …}, claim, quota}: run.stdout is 2, view_url is a public card of the run, and claim.token moves the run into the person's account once they sign up. GET /v1/try/agent describes the call, its limits and the budget left, in JSON.

  • Each run is a fresh sandbox with no network, at most 60 s and 8 KiB of code, deleted after the run.
  • Each network (an IPv4 address or an IPv6 /64) gets 5 minutes of run time per 24 hours and 10 runs an hour. Then the answer is 402 signup_required with limit, upgrade_url and agent_message: the agent tells the person that sentence word for word (sign up free, Starter: $10 of usage, no card, with kosa8 login or at app.kosa8.com/signup).
  • A daily cap across all agents answers 503 no_capacity with Retry-After: not a limit on you, try later.

After sign-up, use step 1's key with POST /v1/run above: internet access, longer runs, your own sandboxes.

An agent with no CLI gets a key: three calls#

An agent that cannot run kosa8 login can start the same browser sign-in over plain HTTP. No key is needed.

# 1. Start: name is optional (what the agent calls itself, at most 60 characters)
curl -s https://api.kosa8.com/v1/auth/device \
  -H 'Content-Type: application/json' \
  -d '{"client": "agent", "name": "Claude Code"}'
# {"device_code": "…", "user_code": "BCDF-GH23",
#  "verification_uri": "https://app.kosa8.com/device",
#  "verification_uri_complete": "https://app.kosa8.com/device?code=BCDF-GH23",
#  "interval": 2, "expires_in": 600,
#  "token_url": "https://api.kosa8.com/v1/auth/device/token",
#  "agent_message": "To let this AI agent use kosa8, open … and press Approve."}

# 2. Give the person verification_uri_complete (or agent_message, word for word).
#    They sign in or sign up free (Starter, no card), see that an AI agent asked
#    for access and which key it gets, and press Approve.

# 3. Poll every interval seconds until 200
curl -s https://api.kosa8.com/v1/auth/device/token \
  -H 'Content-Type: application/json' \
  -d '{"device_code": "…"}'
# 428 authorization_pending, then 200 {"api_key": "k8c_live_…", "org": {…}, "email": "…", "plan": "starter", …}

Keep device_code and the key secret. A denied sign-in answers 403 access_denied; after ten minutes, 410 expired_token. The key is named kosa8 AI agent: <name>, holds the approver's scopes without admin (for an owner: sandboxes:write, functions:deploy, keys:manage, audit:read), and can be revoked any time under API keys.

When the Starter allowance or a limit is reached, the 402 names the cheapest plan that fits and its price. If the approver is an owner, the agent's key can ask for a checkout link, POST /v1/billing/checkout {"plan": "pro"} → {url, plan, agent_message}, for the person to open and pay. The key cannot pay, change or cancel a plan, open billing, or raise the spending cap.

Where next#

Something wrong or missing? Write to contact@kosa8.com.

The kosa8 weekly

Agent security news, one industry deep-dive and a hands-on challenge, every Monday. Unsubscribe in one click.

© 2026 kosa8 · kosa8.com · Zero Trust cybersecurity infrastructure for AI agents · Local models served by llamay · Agent gateway: MAQPNA