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

Guides

Migrate from Modal

Change import modal to import kosa8.compat.modal as modal, set KOSA8_API_KEY, and your modal.Sandbox code runs on kosa8.

# Before: import modal
import kosa8.compat.modal as modal               # reads KOSA8_API_KEY

app = modal.App.lookup("my-app", create_if_missing=True)
sb = modal.Sandbox.create(app=app, image=modal.Image.debian_slim(), timeout=300)
p = sb.exec("python3", "-c", "print(6 * 7)")
print(p.returncode, p.stdout.read().strip())     # 0 42
sb.terminate()

How it maps#

Modalkosa8 Cloud
Sandbox.create(...)Create. image from Image.from_registry or debian_slim, timeout the ttl, idle_timeout sleep after idle, cpu and memory a size, Secret.from_name org secrets
sandbox.exec(*args)Exec; the process has finished when it returns
terminateDelete
snapshot_filesystemA snapshot, usable as image=
filesystem.*, set_tagsThe files API, labels

What is different#

  • Output arrives when a command ends, not line by line. For live output use kosa8's streamed exec.
  • Image builds (pip_install, run_commands), GPUs, volumes, tunnels and stdin raise kosa8.compat.Unsupported. Install once and keep a snapshot instead.
  • Modal Functions are not mirrored; kosa8 has its own functions. Only the synchronous Sandbox API (Modal 1.6.4) is mirrored, not .aio.

Something wrong or missing? Edit this page, or 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 · AI Agent Sandbox: Secure and Sovereign for Enterprise · Local models served by llamay · Agent gateway: MAQPNA