Skip to main content
The Compute primitive runs agent-owned Docker workloads on managed cloud compute (AWS ECS/Fargate). You bring an image; Naïve owns the AWS credentials and scopes every task to your tenant — your agents never hold an AWS key (the same model as Apps with Vercel/Supabase). Three resource types:
  • service — a long-running container (daemon, bot, webhook receiver, MCP server, custom API). Optional public HTTPS URL; scale to zero on demand with stop/scale (you only pay while running).
  • job — a container that runs to completion once (ETL, backup, scrape, render).
  • schedule — a job on a cron/rate expression (“cron for code”). Distinct from the cron primitive, which schedules AI agent prompts.
Creating a workload and opening a shell (exec/ssh) are sensitive — depending on the user’s Account Kit they may require human approval (the call returns status: "pending_approval"). Compute is billed by running time (vCPU-seconds + GB-seconds) in credits; a service scaled to zero costs ~nothing.

Create a workload

// Long-running service with a public URL
const svc = await naive.compute.create({
  name: "bot",
  type: "service",
  image: "ghcr.io/me/bot:latest",
  port: 8080,
});

// One-off job, and a nightly scheduled job
await naive.compute.create({ name: "ingest", type: "job", image: "me/etl:latest", command: ["python", "ingest.py"] });
await naive.compute.create({ name: "nightly", type: "schedule", image: "me/etl:latest", schedule_expr: "cron(0 9 * * ? *)" });
Scope follows the client you hold: naive.compute.* (your default user) vs naive.forUser(id).compute.* (an end-user).

Lifecycle, runs & logs

await naive.compute.list();
await naive.compute.run(jobId);          // trigger a job/schedule now
await naive.compute.runs(jobId);
await naive.compute.logs(id, { limit: 200 });
await naive.compute.stop(svc.id);        // scale a service to zero
await naive.compute.start(svc.id);
await naive.compute.scale(svc.id, 3);

Secrets

Encrypted env vars are injected into the workload’s tasks at start:
await naive.compute.setSecret(id, "OPENAI_API_KEY", "sk-...");
await naive.compute.listSecrets(id);

Interactive shell (ECS Exec)

naive compute ssh <id>          # interactive shell into a running task
naive compute exec <id> "ls -la"  # one-off command
Shell access uses ECS Exec over SSM (no port 22, no keys). The CLI requires the AWS session-manager-plugin, and the image must contain /bin/sh. Sessions are approval-gated and transcript-logged.

CLI

naive compute create --name bot --type service --image ghcr.io/me/bot:latest --port 8080
naive compute run <id>
naive compute logs <id> --limit 200
naive compute ssh <id>

Pair with a Queue

A compute service that long-polls a Queue (naive queue receive → process → naive queue ack) is a cheap autoscaling worker.