The first shipped piece: a default-deny egress proxy with credential injection and a hash-chained audit log. Useful on its own in front of any sandbox (Docker, E2B, Modal) and the base layer for everything else.
| Crate | What |
|---|---|
crates/coloa-audit |
Append-only JSONL log; hash = sha256("coloa-audit-v1\n" ‖ canonical entry), prev links entries; file lock so CLI + gateway share one chain |
crates/coloa-config |
coloa.yaml model (unknown sections such as budget: preserved), host matching, .coloa/secrets.json store (0600) |
crates/coloa-gateway |
The proxy (hyper + reqwest/rustls): policy, DNS/SSRF filter, injection, leak blocking, response redaction |
crates/coloa-sandbox |
Docker sandbox: internal network + single-port relay so the gateway is the only way out |
crates/coloa |
coloa CLI binary |
coloa init [dir] [--name app]
coloa egress allow <host> [--port N]... [--no-tls] [--allow-private] # human only
coloa egress remove <host> | list
coloa secret set NAME --host <host>... # value from hidden prompt or stdin; human only
coloa secret rm NAME | list
coloa gateway [--listen 127.0.0.1:4100]
coloa run [--as agent:claude] -- <cmd> # sets *_PROXY, secret placeholders, COLOA_ACTOR (not enforced)
coloa run --sandbox docker --image <img> [--as agent:x] -- <cmd> # enforced
coloa sandbox down
coloa audit tail [-n 20] | verify
| Guarantee | How |
|---|---|
| Deny by default | No rule in egress.allow → 403 egress_not_allowed. Ports checked too. No allow-all mode exists |
| DNS / SSRF control | Gateway resolves names itself and drops private, loopback, link-local (169.254.169.254), CGNAT, reserved and NAT64-mapped-private addresses unless the rule sets allow_private. Connects only to the addresses it checked (no rebinding window) |
| Secrets never reach code | Code holds __COLOA_SECRET_NAME__; gateway substitutes in headers (incl. inside Authorization: Basic), URL and body, only for hosts in the secret’s hosts |
| No exfiltration of real values | A real secret value (≥ 8 bytes) headed to a host it isn’t scoped to → 403 secret_leak |
| No echo-back | When a secret was injected, the response (headers + streamed body) is scanned and the value replaced by its placeholder; Accept-Encoding is stripped so the body is scannable |
| Agents can’t widen their own policy | egress allow, secret set/rm refuse when COLOA_ACTOR starts with agent: (and the refusal is audited) |
| Nothing unrecorded | Each decision is sealed in the audit log before traffic flows; if the write fails the request fails (503) |
| Live policy | coloa.yaml / secrets are re-read when they change; a broken edit keeps the last good version |
Denials return 403 with header x-coloa-denied: <code> and a one-line fix an agent can relay to a human.
| App calls | Path | Injection / redaction / leak scan |
|---|---|---|
http://api.stripe.com/... |
Absolute-form proxy request; gateway originates TLS upstream (tls: true, default) |
✅ |
https://api.stripe.com/... |
CONNECT tunnel |
❌ (end-to-end encrypted) — allowlist, DNS filter and audit still apply |
So: call APIs that need secrets via http:// through the gateway; the hop from app to gateway is local and the gateway→internet hop is TLS. TLS interception with a per-project CA is an open question.
app container ── on coloa-<app> (docker network --internal: no route, no external DNS)
│ HTTP_PROXY=http://<relay>:4100
relay (alpine/socat, pinned) ── forwards exactly one port ──▶ host.docker.internal:<gateway port>
└▶ coloa gateway ──▶ internet
| Escape attempt | Result (tested in crates/coloa/tests/docker_sandbox.rs) |
|---|---|
| Ignore proxy, connect directly | No route |
| DNS exfiltration | External names don’t resolve |
Read .coloa/secrets.json |
.coloa/ hidden behind an empty tmpfs |
Edit coloa.yaml to widen egress |
Mounted read-only |
Plant .git/hooks/* to run on the host later |
.git/ mounted read-only |
| Privilege escalation | --cap-drop ALL, no-new-privileges, PID limit, runs as the project owner’s uid |
Run the test with COLOA_TEST_DOCKER=1 cargo test -p coloa --test docker_sandbox.
On Linux Docker Engine, host.docker.internal is the bridge address, so start the gateway with --listen 172.17.0.1:4100; the CLI’s preflight check explains this if it fails.
coloa run without --sandbox docker only routes cooperative clients (it prints a warning). Use the Docker sandbox for enforcement.package.json scripts, Makefiles) that a human may later run on the host; review agent changes like any PR.COLOA_ACTOR, proxy username) are attribution, not authentication.~/.coloa/master.key or COLOA_MASTER_KEY).Accept-Encoding on injected requests.coloa audit anchor, automatic every 10 min under coloa dev/serve/server), except for entries written since the last anchor.coloa.yaml through the CLI rewrites the file and drops YAML comments.usage from OpenAI/Anthropic/Gemini responses passing through (cost MVP).schema.coloa, Postgres proxy, TS functions in WASM.Crate crates/coloa-meter. Every egress request, LLM call and (later) function invocation is appended to .coloa/usage/usage-YYYY-MM.jsonl; processes tail the file, so the gateway and app server share one month-to-date total (caps can overshoot by in-flight requests).
llm: true are parsed for usage (JSON and SSE streams). Recorded per actor and model.pricing: in coloa.yaml (VND defaults are placeholders; set real numbers). LLM prices by longest model prefix.coloa budget set 2000000 --on-cap read_only|pause|throttle|notify_only. At the cap the gateway returns 429 budget_exceeded (read_only still lets GET/HEAD to non-LLM hosts through; throttle allows throttle_rps; notify_only audits once).coloa budget agent agent:claude 200000 → 429 token_budget_exceeded for that agent’s LLM calls for the rest of the day.coloa cost [--month YYYY-MM] [--json] — cost by function/host/model, by env and team, tokens per actor, forecast vs budget.