agentrec architecture
System design

How agentrec runs on Cloudflare

Two planes. The eBPF agent runs on your Linux hosts — it can't run on Cloudflare, because it needs a kernel. Everything else — site, docs, console, API, and database — is the control plane, and it all lives on Cloudflare's edge.

CLOUDFLARE · GLOBAL EDGE Cloudflare Pages agentrec.io static: site · /docs · /app console · /install.sh · CDN Worker — agentrec-api *.workers.dev REST API · auth (Bearer) findings engine (server-side) R2 — agentrec-recordings recording payloads · evidence D1 — agentrec-db SQLite · APAC orgs · tokens sessions · findings Operator browser · console UI reads with token YOUR LINUX HOST CI runner · k8s node · VM agentrec agent eBPF probes attribution + tag map records a session, ships JSON on finish GET site + console XHR: /v1/sessions Bearer · CORS POST /v1/ingest HTTPS + token payload
agent ingest (the core path) browser + data-plane reads
The agent lives on your Linux host and ships recordings to the Worker; the browser loads static assets from Pages and reads the API. The Worker is the only thing that touches D1 and R2 — payloads in R2, summary + findings in D1.
01

What's hosted where

Four Cloudflare resources make up the control plane. The agent is the one piece that runs on your infrastructure, not Cloudflare's.

Cloudflare Pages

Static hosting + CDN

agentrec.io

Serves the marketing site (/), docs (/docs), the console SPA (/app), and the agent installer (/install.sh) from Cloudflare's global edge.

livefree tier
Cloudflare Worker

API + findings engine

api.agentrec.io

The control plane: /v1/signup, /v1/ingest, /v1/sessions, /v1/findings. Validates tokens, classifies findings server-side, and is the only component with a binding to D1.

live~100k req/day free
Cloudflare D1

Edge SQLite database

agentrec-db · region APAC

Tables: orgs, ingest_tokens, sessions (recording payload inline for now), findings. Reached only through the Worker's binding.

livefree tier
Cloudflare R2

Object storage

agentrec-recordings

Holds the raw recording payloads (and, ahead, evidence-export packs). D1 keeps only a pointer + summary, so storage costs stay ~50× lower than inline in D1.

livezero egress
Data plane · your infra

agentrec agent (eBPF)

Docker image · Helm/DaemonSet · install.sh

Runs on your Linux hosts (CI runners, k8s nodes, VMs) with hostPID + eBPF privileges. Records an attributed session and POSTs it to the Worker. Never runs on Cloudflare — it needs a kernel.

liveLinux 5.8+ / BTF
02

How a request moves

Two paths cross the boundary into Cloudflare: the agent writing a recording, and the operator reading it back.

Ingest — agent → cloud

  1. The agent records a session with eBPF and marshals it to JSON.
  2. It POSTs to /v1/ingest with Authorization: Bearer ar_live_… over HTTPS.
  3. The Worker looks the token up in D1 to resolve the org (401 if unknown).
  4. It runs the findings engine — credential reads, docker.sock, curl|sh — and dedupes.
  5. The payload is written to R2; the summary + findings go to D1; a summary returns to the agent.

View — browser → cloud

  1. The browser loads the console from Pages (static, cached at the edge).
  2. The console calls the Worker (/v1/sessions, /v1/findings) with the token — CORS-enabled.
  3. The Worker reads D1 and returns JSON.
  4. The console renders the attributed timeline and findings, entirely client-side.
Why this split The valuable logic — attribution correlation and the findings engine — lives in the Worker, not the shipped agent. The agent stays a thin collector, so the classifier improves server-side without redeploying a single agent, and the IP that matters never leaves Cloudflare.
03

Live vs. planned

Live now
  • Pages: site, docs, console, installer
  • Worker API + server-side findings
  • D1: summary + findings index
  • R2: recording-payload storage (pointer in D1)
  • Queues: buffered ingest → async consumer
  • Durable Objects: per-org WebSocket live tail
  • Agent auto-upload (CI/wrapper + push)
  • Roles: ingest / read-only / full API keys, revocable; gated org creation
  • Team & audit log: members with roles + a who-did-what activity trail
  • Ingest rate limiting: per-credential upload cap (Durable Object)
  • SSO: console gated by Cloudflare Access (one-time PIN / your IdP); JWT verified server-side
  • Enforcement (beta): --enforce kills a task on a forbidden action (kernel)
  • Node-wide capture (beta): watch DaemonSet auto-records agents by name
  • Alerts: per-org webhook on critical findings
Planned / next
  • TLS visibility: decrypted request previews (per-arch BPF build)
  • Managed cloud offering & billing