Primitive/compute4 min read

Introducing /compute: Run Docker containers, workers & cron jobs from one call

Spin up agent-owned Docker workloads on managed cloud compute — long-running services with public URLs, run-to-completion batch jobs, and scheduled (cron-for-code) jobs — metered by the second, isolated per tenant, with an interactive shell. No AWS account, no cluster, no DevOps.

/compute /compute /compute /compute /compute /compute /compute /compute /compute /compute
/compute /compute /compute /compute /compute /compute /compute /compute /compute /compute
/compute /compute /compute /compute /compute /compute /compute /compute /compute /compute
/compute /compute /compute /compute /compute /compute /compute /compute /compute /compute
/compute /compute /compute /compute /compute /compute /compute /compute /compute /compute
/compute /compute /compute /compute /compute /compute /compute /compute /compute /compute
/compute /compute /compute /compute /compute /compute /compute /compute /compute /compute
/compute /compute /compute /compute /compute /compute /compute /compute /compute /compute
/compute /compute /compute /compute /compute /compute /compute /compute /compute /compute
/compute /compute /compute /compute /compute /compute /compute /compute /compute /compute
/compute /compute /compute /compute /compute /compute /compute /compute /compute /compute
/compute /compute /compute /compute /compute /compute /compute /compute /compute /compute
/compute /compute /compute /compute /compute /compute /compute /compute /compute /compute
/compute /compute /compute /compute /compute /compute /compute /compute /compute /compute
Primitive/compute
TL;DR
  • /compute run your own Docker images on managed cloud compute (AWS ECS/Fargate) from a single CLI call or API request
  • Three types compute_service (long-running daemon/bot/API with an optional public URL), compute_job (run-to-completion batch), compute_schedule (cron-for-code)
  • Per-second billing in credits services scale to zero on demand, so idle workloads cost ~nothing
  • Hard multi-tenant isolation each workload runs in its own Firecracker microVM with its own network and a per-tenant IAM role
  • Interactive shell `naive compute ssh <id>` drops you into a running container over ECS Exec (no SSH keys, no open ports)
  • No AWS account Naïve owns the cluster and credentials; your agents never hold a cloud key
  • Composes with /queue a compute worker long-polls a queue for a cheap autoscaling pipeline

Today we're launching /compute — the primitive that lets your agent run its own Docker containers. Long-running services, background workers, batch jobs, and scheduled jobs, on managed cloud compute, billed by the second, with a real shell. One CLI call and your agent has a running container — no AWS account, no cluster, no DevOps.

The problem: agents can write code but can't run it

Naïve already lets an agent ship a web app (managed Next.js + a database) and call serverless edge functions. But a huge class of work doesn't fit either box:

  • A Discord/Telegram bot or webhook receiver that needs to stay running.
  • A background worker chewing through a queue for hours.
  • A scheduled batch job — nightly backups, ETL, report generation, media rendering.
  • A custom API or MCP server that isn't serverless-friendly.

Edge functions are request-scoped and short-lived; app hosting is for frontends. Neither runs an arbitrary container for minutes or days. The missing primitive is "here's a Docker image, run it" — as a call your agent can make.

How /compute works

You bring an image; Naïve owns the cluster and the cloud credentials. Three resource types cover the space:

  • service — a long-running container. Optional public HTTPS URL, scale to zero on demand (you only pay while running).
  • job — runs to completion once, then stops. Logs and exit code are captured.
  • schedule — a job on a cron/rate expression. This is cron for code, distinct from the cron primitive, which schedules AI agent prompts.

This is the Company → Employee → Primitive model: the Company owns the infrastructure, an agent calls the primitive, and /compute binds a Docker image to a running, billed, isolated workload.

CLI: image to running container in one call

# Long-running service (optionally expose a public URL with --port)
naive compute create --name bot --type service --image ghcr.io/me/bot:latest --port 8080
 
# One-off batch job
naive compute create --name ingest --type job --image me/etl:latest --command "python ingest.py"
naive compute run <id>
 
# Cron-for-code: run a job on a schedule
naive compute create --name nightly --type schedule --image me/etl:latest --schedule "cron(0 9 * * ? *)"
 
# Lifecycle, logs, secrets, shell
naive compute logs <id> --limit 200
naive compute stop <id>            # scale a service to zero
naive compute secret set <id> OPENAI_API_KEY sk-...   # auto-redeploys
naive compute ssh <id>             # interactive shell over ECS Exec

Every command returns structured JSON with the workload status, run ids, and next steps.

API: full lifecycle

// Create a job and run it
const job = await fetch("https://api.usenaive.ai/v1/compute", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.NAIVE_API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    name: "ingest",
    type: "job",
    image: "public.ecr.aws/docker/library/busybox:latest",
    command: ["sh", "-c", "echo hello && sleep 5"],
  }),
}).then((r) => r.json());
 
await fetch(`https://api.usenaive.ai/v1/compute/${job.id}/run`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.NAIVE_API_KEY}` },
});

Billed by the second, scales to zero

/compute is metered on running time — vCPU-seconds plus GB-seconds — converted to credits and debited continuously, on the same balance as every other primitive. A service you stop (or scale 0) accrues almost nothing; a job is billed only while its task runs. No idle servers quietly draining your balance.

Hard multi-tenant isolation

Every workload runs as a Fargate task: its own Firecracker microVM with a dedicated kernel (the same primitive AWS uses to multi-tenant Lambda), its own network interface with a default-deny egress allowlist, and a least-privilege per-tenant IAM role. Resources are named and tagged per tenant, every read/write is ownership-guarded (cross-tenant access returns a 404), and — critically — your agents never hold an AWS credential. They call Naïve; Naïve calls the cloud.

A real shell, the safe way

naive compute ssh <compute-id>

naive compute ssh opens an interactive shell into a running container over ECS Exec / AWS Systems Manager — no port 22, no SSH keys, no inbound access. Naïve brokers a short-lived, task-scoped session and your terminal connects directly; no cloud credentials ever touch your machine. Shell and exec are approval-gated by default, and every session is transcript-logged.

Composes with /queue

/compute and /queue are made for each other: create an SQS queue, run a service worker that long-polls it, process each message, and acknowledge it. Combined with scale-to-zero and queue depth, that's a cheap autoscaling pipeline — producer/consumer fan-out with retries, no orchestration code.

What you can build with /compute

Always-on bots and webhook receivers — a Discord bot, a Stripe webhook handler, an MCP server, running as a managed service with a public URL.

Background workers — scrapers, ETL pipelines, embedding/indexing jobs, media transcoding — pulled off a queue and scaled with demand.

Scheduled operations — nightly backups, digests, report generation, data syncs, all as cron-for-code with no separate scheduler.

Heavy one-off jobs — render a video, run a migration, batch-process a dataset, then shut down and stop billing.

Get started

Drop this into any coding agent to wire up Naïve:

Read https://usenaive.ai/skill.md and use it to set up Naïve in my project.

Frequently Asked Questions
What is /compute?+
/compute is Naïve's container primitive. It runs agent-owned Docker images on managed cloud compute (AWS ECS/Fargate) as long-running services, one-off jobs, or scheduled jobs — all via the CLI, SDK, MCP, or API, with no AWS account or cluster management.
What are the three compute types?+
compute_service is a long-running container (a daemon, bot, webhook receiver, MCP server, or custom API) with an optional public HTTPS URL and on-demand scale-to-zero. compute_job runs a container to completion once (ETL, scraping, rendering). compute_schedule runs a job on a cron/rate expression — 'cron for code', distinct from the cron primitive which schedules AI agent prompts.
How is /compute billed?+
By running time — vCPU-seconds plus GB-seconds, converted to credits and metered continuously. A service scaled to zero accrues almost nothing, and a job is billed only while its task runs.
How are tenants isolated?+
Each workload runs as a Fargate task — its own Firecracker microVM with a dedicated kernel, its own network interface with a default-deny egress allowlist, and a least-privilege per-tenant IAM role. Every resource is scoped to the owning tenant; cross-tenant access returns a 404.
Can I get a shell into a running container?+
Yes. naive compute ssh <id> opens an interactive shell over ECS Exec / AWS Systems Manager — no port 22, no SSH keys, no inbound access. One-off commands are available via naive compute exec, and both are approval-gated by default.
How do I get started with /compute?+
Install the CLI with npm install -g @usenaive-sdk/cli, register, then run naive compute create --name worker --type service --image your/image:latest. The full guide is at usenaive.ai/docs/getting-started/compute.
SD
Sean DorjeCo-founder

Co-founder of Naïve. Previously building the autonomous business stack.

@seandorje