by Olli Technology

The fortress for AI-built apps

Thành trì cho ứng dụng thời AI

Developers and AI coding agents build and run full apps on Coloa: React frontend, TypeScript functions, Postgres and file storage. Security, audit and cost limits are enforced by the platform, not left to the code. On your own infrastructure.

One Rust binary Laptop · VPS · local cloud · air-gapped Standard Postgres + S3 TypeScript, Go, Python
An agent's code tries to send a payment key to evil.example: the pre-deploy check flags it, the gateway blocks it at runtime, the audit log records it, and the agent can't allow the host itself.

Real output. An agent's code tries to send the payment key to evil.example: the pre-deploy check flags it, the gateway blocks it, the audit log records it, and the agent can't allow the host itself.

6 / 6agent-style attacks stopped, measured from real runs
0.6 msper function call, each in a fresh WebAssembly sandbox
0 sdowntime when services update: old version drains first
450+automated checks, end-to-end against real Postgres, S3 and Docker
Why Coloa

AI agents write code fast. Nothing stops them doing damage.

Firewalls, repo permissions, database rules and secret managers each cover one slice. None of them can tell the agent writing the code from the app running it from the human approving it. Coloa can, everywhere: network, secrets, data, deploys and spend.

The same six attacks, written the way an agent would write them, against a typical self-built stack and against Coloa:

AttackTypical stackColoa
Send the payment key to an attacker✗ real key stolen✓ blocked; still refused even if a human allows the host by mistake
Forget the "only my rows" filter✗ Bob sees Alice's orders✓ Bob sees only his own (Postgres row-level security)
Agent gives itself more access✗ reads the production database✓ refused; in the sandbox it sees no secrets or database login
Drop a production column✗ column and data gone✓ production untouched; needs human approval and a snapshot
Card numbers in debug logs✗ logged in clear✓ masked as [sensitive]
An LLM call in a loop✗ 20/20 calls paid, no cap✓ stopped at the monthly cap after 3

Every cell comes from a real run of tests/attacks.sh. Typical stack: secrets in environment variables, the app connecting to Postgres as the owner, plain log files, open egress, no spending cap.

Strengths

Safe by default, fast, and cheap to run

The rules live in the platform, so they hold no matter who or what writes the code.

Secrets never reach code

Functions and agents only hold a placeholder like __COLOA_SECRET_PAY_KEY__. The gateway swaps in the real value only on the way to that secret's own hosts.

The database enforces access

Rules in schema.coloa compile to Postgres row-level security. Deny by default; sensitive fields never reach the browser and are masked in logs.

Agents can only ask

Coding agents (Claude Code, Cursor, Codex, Gemini) run in a sandbox with their own identity. They deploy previews and request promotion; only people promote, approve, add hosts or set secrets.

Tamper-evident audit

Every agent, function and human action is recorded before traffic flows, in a hash chain anchored outside the project, with a compliance report built in.

Spend stops at the cap

Functions, queries, egress, LLM tokens and storage are metered per request and per team, forecast, and cut off at a hard monthly cap. Cost is a feature, not an afterthought.

Fast, in any language

Functions in TypeScript, Go or Python run in WebAssembly, a fresh sandbox per request (well under a millisecond for TypeScript and Go, about 20 ms for a whole CPython). Long-running Go and Python services run in Docker, non-root and resource-limited, with signed user identity.

Changes you can undo

Every change lands in a preview with its own database. Production changes show the exact migration plan, take a snapshot first, roll back in one command, and update services without downtime.

Built for teams

One server hosts many apps. Roles (admin, auditor, owner, developer, viewer), single sign-on with a second factor, organisation-wide policy, and one console across every app.

Your infrastructure, your data

One Rust binary on a laptop, a VPS, a local cloud or air-gapped. Standard Postgres and S3-compatible storage, encrypted backups, and coloa export to leave any time.

How it works

One process between your code and everything it touches

Code, agents and people never reach the network, the secrets or the data directly. Every path goes through Coloa, which checks it, records it and meters it.

Who acts

AI coding agentin a Docker sandbox, no direct network
Developerspush previews, request promotion
Owners and approverspromote, approve, set policy
End usersuse the app in the browser

Coloa: one Rust binary

App serverTS functions in WebAssembly, React frontend
Gatewayegress allowlist, secrets, leak blocking
Policy engineschema rules → row-level security
ServicesGo, Python, legacy, in Docker
Deployspreviews, approvals, snapshots
Audit and meteringhash chain, cost per request

Agents talk to it through MCP tools and a session token; people through the CLI and the console.

What it protects

Postgresqueried as the signed-in user
S3-compatible storagefile uploads, checked by the same rules
Outside APIsLLMs, payments, only allowed hosts
Your budgethard monthly caps
Secrets never reach code. The gateway inserts real values only for each secret's hosts.
The database enforces access. Rules compile to Postgres row-level security.
Agents work in a sandbox with their own identity. They can deploy previews and ask.
Everything is audited before traffic flows, in a chain anchored outside the project.
Spend stops at the cap. LLM tokens, functions, queries and egress are metered per request.
Production changes need a person. The exact plan is shown, and a snapshot is taken first.
Scale

From one laptop to many apps, then many nodes

App code holds no state: data lives in Postgres and S3-compatible storage, never on the machine running the code. That's what lets the same app move from a laptop to a shared server to a cluster without changes.

Available

1. Laptop

coloa dev: one app, its own Postgres in Docker, hot reload.

Available

2. One VM, many apps

coloa server: every team's apps on one machine, isolated from each other, with roles, backups and one console.

Available

3. Many nodes

Identical replicas behind a load balancer, sharing one Postgres and S3: all serve apps, one leads changes, another takes over if it fails. No extra control plane to run.

Available

4. Kubernetes

A Helm chart runs Coloa in your cluster: one replica, or several with autoscaling, behind an Ingress or straight from a load balancer. Next: services on Kubernetes, then an operator for local clouds and large companies.

Available Many apps on one server

apps.example.vnone name per app and preview
▼
coloa serverone process, routing by host name
shopcrmhrreportspr-1.shoppr-2.crm……
▼
Postgreslocal, or managed
S3 storagefiles, backups
DockerGo/Python services
  • Isolated per app: own database login that can't open another app's data, own gateway and secrets, own audit log, own budget.
  • Idle apps cost almost nothing. Functions don't run as long-lived processes: each request gets a fresh WebAssembly instance in about 0.6 ms, so a hundred quiet apps use no CPU.
  • Busy services can't starve the rest: each container has memory and CPU limits (512 MB and 1 CPU unless set), and runs as non-root.
  • Every request is metered per app and per team, with forecasts and hard caps, so you see which app needs a bigger machine.
  • Grow vertically or out: a bigger VM, Postgres moved to a managed service (COLOA_DATABASE_URL), files and backups to S3, then more replicas sharing that Postgres.
  • Passkeys for every app's users: sign in with Face ID, Touch ID, Windows Hello or a security key. Nothing to phish, guess or reuse from another site's breach; an app can turn passwords off entirely.

On the roadmap Many nodes

Load balancer
▼ ▼ ▼
Coloa noderouter, functions, gateway
Coloa nodeautoscaled
Coloa nodescale to zero
▼
Postgresreplicas + pooler
S3
Valkeysessions, limits, counters
▲
Control plane3 nodes, Raft: deploys, policy, secrets, quotas
  • Same binary, new role: coloa node --role worker|control.
  • Functions and routers scale by adding instances and nodes; jobs by queue length; databases with replicas and a connection pooler.
  • Budget caps become shared counters synced every few seconds; audit chains per node, merged and anchored centrally.
  • Safer deploys: migrate once (expand, then contract) after a snapshot, canary 5%, then 100% or automatic rollback.
  • Per-app settings in one place:
scale:
  functions: { min: 0, max: 50, target_concurrency: 100 }
  jobs: { max_workers: 10 }
region: vn-hcm

The roadmap part is designed (see Architecture) but not built yet. Everything marked "Available" is in the code and covered by the tests.

The console

One place for the security officer and the team lead

What each app may do, what agents tried, what is waiting for approval, and where the money goes.

Get started

Run it on your laptop, or for your whole team on a VM

The same binary does both. Start on a laptop to build an app; move to a VM when a team and real users need it.

Install what it needs

macOS or Linux with Docker (for Postgres and services), Rust 1.89 or newer, Node.js 20+, and the Postgres client tools (for snapshots and backups).

# macOS (Homebrew); on Linux use your package manager
brew install node libpq && brew link --force libpq
curl https://sh.rustup.rs -sSf | sh
rustup target add wasm32-wasip1

Build Coloa

git clone https://github.com/olli-ai/coloa.git && cd coloa
(cd console && npm install && npm run build)   # the console UI, embedded in the binary
cargo build --release
export PATH="$PWD/target/release:$PATH"

Create an app and run it

Templates: react-ts (React + Vite frontend), go (functions in Go), python (functions in Python), shop (plain HTML), blank.

coloa init myshop --template react-ts && cd myshop
coloa dev        # Postgres, functions with hot reload, gateway, console
# app      http://127.0.0.1:4000
# console  http://127.0.0.1:4001/#token=…  (printed once)

Write the app

Describe data and who may touch it in schema.coloa:

table orders {
  owner      user  @owner
  item       text
  total      money @default(0)
  card_last4 text  @sensitive @optional   // never sent to the browser, masked in logs

  allow read, update: owner == auth.user
  allow read:         auth.role == "staff"
  allow create:       auth.user != null
}

Write functions in plain TypeScript (functions/orders.ts serves /api/orders):

export default async function (req: ColoaRequest) {
  return await db.from("orders").select("id, item, total")
    .order("created_at", { ascending: false });
}

Or in Go (functions/orders.go; Go 1.24+ on your machine builds it, the server only runs it):

//go:build ignore

package main

import "github.com/olli-ai/coloa/sdk/go/coloa"

func main() { coloa.Run(handle) }

func handle(req *coloa.Request, ctx *coloa.Context) (any, error) {
	return coloa.From("orders").Select("id, item, total").Order("created_at", true).All()
}

Or in Python (functions/orders.py; the standard library and your own modules, no pip packages):

from coloa import db

def get(req, ctx):
    return db.table("orders").select("id, item, total").order("created_at", desc=True).all()

Work on the React frontend with hot reload; build it to serve and ship it:

cd web && npm install && npm run dev   # calls coloa dev for /api and /auth
npm run build                          # web/dist is served and shipped

Allow what it may reach

Outbound traffic is denied by default. Secret values are read from a prompt, never from the command line.

coloa egress allow api.stripe.com
coloa secret set STRIPE_KEY --host api.stripe.com

Check, preview, promote

coloa check                    # every policy, schema and cost check a deploy runs
coloa deploy --preview pr-1    # → http://pr-1.myshop.localhost:4000
coloa promote pr-1             # people only: shows the plan, snapshots first
coloa rollback <snapshot>      # if needed

Optional: let an AI agent code it

The agent gets its own identity and MCP tools. It can deploy previews and ask for promotion; it can't change policy or ship to production.

coloa agent connect claude-code    # writes .mcp.json and AGENTS.md
coloa run --sandbox docker --as agent:claude-code --image <agent image> -- claude

Prepare the VM

A Linux VM (for example Ubuntu 24.04) with Docker Engine and the Postgres client tools. Point a domain and its wildcard at the VM, e.g. apps.example.vn and *.apps.example.vn: each app answers at <app>.apps.example.vn, each preview at <preview>.<app>.apps.example.vn.

sudo apt install -y docker.io postgresql-client
sudo useradd -m -G docker coloa
# build as on a laptop (or copy the binary from a Linux build machine), then:
sudo install target/release/coloa /usr/local/bin/
For HTTPS, get a certificate covering apps.example.vn and *.apps.example.vn (for example Let's Encrypt with a DNS challenge). Coloa serves it directly with --tls-cert and --tls-key.

Choose where data lives

By default Coloa runs its own Postgres in Docker on the VM. To use a managed database or another server, set COLOA_DATABASE_URL. Uploaded files go to a local folder, or to any S3-compatible storage with COLOA_STORAGE.

# /etc/coloa/env (mode 600, owned by coloa); every line is optional
COLOA_DATABASE_URL=postgres://admin:…@db.internal:5432/postgres
COLOA_STORAGE=s3://coloa-files/prod?endpoint=https://s3.example.vn
COLOA_BACKUP_TO=s3://coloa-backups/prod?endpoint=https://s3.example.vn
AWS_ACCESS_KEY_ID=…
AWS_SECRET_ACCESS_KEY=…

Run it as a service

One process hosts every app, with daily encrypted backups.

# /etc/systemd/system/coloa.service
[Unit]
Description=Coloa server
After=docker.service
Requires=docker.service

[Service]
User=coloa
EnvironmentFile=/etc/coloa/env
ExecStart=/usr/local/bin/coloa server --home /var/lib/coloa \
  --listen 0.0.0.0:443 --domain apps.example.vn \
  --tls-cert /etc/coloa/fullchain.pem --tls-key /etc/coloa/privkey.pem \
  --backup-every 24 --backup-keep 14
AmbientCapabilities=CAP_NET_BIND_SERVICE
Restart=always

[Install]
WantedBy=multi-user.target
sudo mkdir -p /var/lib/coloa && sudo chown coloa /var/lib/coloa
sudo systemctl enable --now coloa
Behind a reverse proxy instead, use --listen 127.0.0.1:7700 and set protection.trust_forwarded in each app, so sign-in limits see real client addresses.

Make the first admin, then add people

On the VM, once. Admins then manage everyone else from their own laptop or the console's Members page.

sudo -u coloa coloa server --home /var/lib/coloa token an    # prints the token once
sudo -u coloa coloa server --home /var/lib/coloa grant an admin

# from the admin's laptop
export COLOA_SERVER=https://apps.example.vn COLOA_TOKEN=<an's token>
coloa remote token minh                       # a developer
coloa remote grant minh owner --app myshop    # may create and manage myshop
coloa remote token claude --agent --app myshop  # an AI agent, limited to one app
RoleScopeMay
adminservereverything on every app; grant roles, issue and revoke tokens
auditorserverread every app's audit, logs and cost; change nothing
ownerone apppromote, approve, roll back, secrets, egress, push
developerone apppush previews, request promotion, read
viewerone appread

Developers ship from their laptops

export COLOA_SERVER=https://apps.example.vn COLOA_TOKEN=<minh's token>
cd myshop
(cd web && npm run build)                    # if the app has a React frontend
coloa push --preview pr-1                    # → https://pr-1.myshop.apps.example.vn
coloa remote request-promotion pr-1          # developers and agents ask…
coloa remote --app myshop approve apr_0001   # …an owner approves (or in the console)
coloa remote promote pr-1                    # owners may promote directly

Production is at https://myshop.apps.example.vn. The console for every app is at https://apps.example.vn/#token=….

Keep the backup key safe, and know how to restore

The first backup creates /var/lib/coloa/backup.key. Copy it off the VM (a password manager): without it no backup can be restored. To rebuild on a new VM:

coloa remote backup     # on demand, admins

# on the new VM, into an empty home
sudo -u coloa env COLOA_BACKUP_KEY=<key> coloa server --home /var/lib/coloa \
  restore "s3://coloa-backups/prod/coloa-backup-<time>.cbk?endpoint=https://s3.example.vn"

Restore recreates every app's databases, files, roles and tokens, re-seals secrets for the new machine and verifies every audit chain. It never overwrites an existing database unless you ask.