1Month › Portfolio › Alfred
Technical Review

Alfred BuilderOps Console

One console for solo builders over their cloud, their tools and their app's own data - multi-tenant on Postgres row-level security, credentials in a Cloud KMS-wrapped vault, and read-only cloud access granted without a single access key.

20 Read-Only Integrations
2 Data Planes
5 min Alert Cadence
257 Passing Tests

Product Overview

Alfred is an operational assistant for solo builders. A one-person product still runs on a cloud account, a CI, two app stores, an error tracker and a database - and nobody is watching all of them at once. Alfred connects to each one read-only, discovers what is actually running, proposes the alerts the builder never set up, and evaluates them every five minutes.

"Built for solo builders - not enterprises."
☁️
Provider Plane

Cloud compute, VMs, databases, registries, cost and budgets across GCP, AWS and Azure, plus 17 SaaS tools

🗄️
App Data Plane

Sign-ups, users, logs and security events read straight from the app's own Postgres

🔭
Auto-Discovery

A census of the connected cloud project, confirmed by the builder before anything is watched

🔔
Proposed Alerts

Rules derived from what the scan found - including the budget cap you never set

👀
Read-Only by Design

Alfred observes and nudges; the fix stays in the builder's own console

🧪
Public Demo

A fixture-backed, view-only workspace - no sign-up

⚙️

Tech Stack

Layer Technology Version
Web App Next.js (App Router, server actions) + React + Tailwind CSS Next.js 16.2, React 19.2, Tailwind 4
Language TypeScript, Node.js TS 5.9, Node 22
ORM Prisma with the pg driver adapter v7.8
Database PostgreSQL 16 with row-level security Cloud SQL
Identity WorkOS sign-in + Alfred-issued EdDSA session JWTs @workos-inc/node 10, jose 6
Key Management Cloud KMS (vault key-encryption key) + Secret Manager @google-cloud/kms 5
Compute Cloud Run behind a global HTTPS load balancer me-west1
Scheduling Cloud Scheduler → secret-gated cron routes 3 jobs
Testing Vitest + in-process PGlite for real-Postgres RLS tests Vitest 4

No AWS or Azure SDK: AWS requests are signed with a hand-written SigV4 signer, which keeps the dependency surface of a credential-handling app small.

🏗️

Architecture

One Pooled App, Two Data Planes

Clients
🖥️ Console
browser, WorkOS sign-in
⏱️ Cloud Scheduler
3 cron jobs
▼
Cloud Run - me-west1
alfred-prod
Next.js 16 · pages, API, server actions, crons
▼
Alfred's Own Data
🐘 Cloud SQL
PostgreSQL 16 + RLS
🔑 Cloud KMS
vault KEK
🗝️ Secret Manager
JWT + service secrets
▼ read-only
The Builder's World
☁️ Provider plane
GCP · AWS · Azure · 17 SaaS
🗄️ App Data plane
the app's own Postgres

Two Provider Contracts

Clouds implement one CloudProvider interface - listComputeServices, listVirtualMachines, listManagedDatabases, listRegistries, getCostBreakdown, listBudgets, health - so the Infra pages are cloud-agnostic. SaaS tools implement a single SaaSConnector.fetch(), registered in one index. Adding an integration is one module, not a new page.

src/
├── app/(app)/          # console pages: infra, mobile, observability, app-ops, alerts
├── app/api/            # auth, health, cron/{evaluate,cost-snapshot,demo-refresh}
├── lib/cloud/          # CloudProvider: gcp, aws (SigV4), azure + discovery + token minting
├── lib/connectors/     # 17 SaaS connectors behind one SaaSConnector contract
├── lib/appdata/        # read-only reader for the builder's own Postgres
├── lib/vault/          # envelope encryption, Cloud KMS wrap/unwrap
├── lib/alerts/         # rules, metrics, engine, delivery channels, uptime probe
└── lib/db/, lib/tenant/  # tenant-scoped Prisma client + AsyncLocalStorage context
🧱

Tenant Isolation

Alfred is one pooled application with isolated data. Isolation is enforced by the database, not by remembering a WHERE clause:

🛡️
Row-Level Security on Every Tenant Table

Each policy compares "tenantId" to a transaction-local setting. FORCE ROW LEVEL SECURITY is on the sensitive tables - the vault, alert rules and events, discovery scans and cost snapshots.

🎫
Tenant Id From the Session, Never the Client

The id comes from a verified EdDSA session JWT (signature, issuer, expiry, claim shape) into an AsyncLocalStorage context, then into set_config(…, true) for that one transaction.

👤
Non-Owner Runtime Role

The app connects as a role that does not own the tables and cannot bypass RLS - asserted before the first tenant query, so a misconfigured deploy fails loudly instead of silently seeing everything.

🚪
Default-Deny API

Every /api/* route requires a session unless it is on a short allowlist (health, auth, signed webhooks, secret-gated crons). Pages and server actions gate themselves, with a role check on every mutation.

Tested against real Postgres semantics: the RLS suite runs on in-process PGlite, so cross-tenant reads are proven blocked by the database itself - without Docker or a local server.
🔐

Credential Vault

Envelope Encryption

① Per-secret data key
  • Fresh random 256-bit key per secret
  • AES-256-GCM, 12-byte IV
  • AAD binds the ciphertext to tenant / provider / name
→
② Wrapped by Cloud KMS
  • The data key is encrypted by the key-encryption key in Cloud KMS
  • The KEK never leaves KMS
→
③ Guarded reads
  • Decrypts are audit-logged - secret names, never values
  • Fails closed: production refuses the local dev key

The AAD binding means a ciphertext copied into another tenant's row will not decrypt. The vault table itself sits under forced RLS.

🤝

Keyless Cloud Connect

For GCP and AWS the builder grants access instead of pasting a key. Alfred mints short-lived credentials on demand, so there is no long-lived cloud key to steal.

Cloud What the builder does How Alfred reads What Alfred stores
GCP Pastes one gcloud command: Viewer on the project, plus Billing Viewer when a billing account is linked Impersonates Alfred's reader service account; 1-hour tokens, every mint audited Identifiers only
AWS One-click CloudFormation stack creating a read-only role (6 read actions) GCP-issued OIDC token → web-identity anchor role → the builder's role, with an ExternalId Account id, region; the ExternalId in the vault
Azure Pastes a short-lived ARM token Direct read with that token The token, in the vault
Scope of the "keyless" claim: it covers the GCP and AWS grants only. Azure and the 17 SaaS connectors hold tokens the builder pastes, envelope-encrypted in the vault above. Alfred only ever reads through them.
🔌

Integrations

20 read-only integrations, plus a read-only connection to the app's own database:

Domain Integrations Count
Clouds GCP, AWS, Azure 3
Code & Deploy GitHub, Vercel, Expo / EAS 3
App Stores App Store Connect, Google Play 2
Error Tracking Sentry, GlitchTip, Honeybadger, Rollbar, Bugsnag 5
Observability Datadog, Better Stack, Axiom, SigNoz, Grafana Cloud, New Relic 6
Data Upstash 1
Total 20

The App Data Plane

The builder's own Postgres is read through a connection string and a schema mapping - no SDK and no change to the builder's app. Each read opens a fresh client inside BEGIN TRANSACTION READ ONLY, with 8-second statement and connect timeouts, and re-runs the SSRF check on the target host. Identifiers are mapped and quoted, values are always parameterized, and every list is capped at 500 rows.

🔔

Discovery & Alerts

From Scan to Proposed Rules

① Discover
  • GCP: Cloud Asset census, Cloud Run services with public/private detection, enabled APIs, billing
  • AWS: Cost Explorer spend by service
→
② Propose
  • Uptime per public Cloud Run service
  • Budget at 80%, with a "you never set a budget cap" nudge
  • Cost anomaly: a material month-over-month jump, naming the service
→
③ Confirm
  • The builder confirms on one screen; private services are explained, not proposed
  • The client sends only ids - the server recomputes every rule body

Only rules the engine can actually evaluate are ever proposed - a checkbox never promises a check that doesn't exist.

The Engine

Job Schedule What it does
Evaluate every 5 minutes Collects metrics per tenant - sign-ups, budget %, failed deploys, error rate and fatals, monthly cost, cost anomaly, uptime - and evaluates every enabled rule
Cost snapshot daily Writes monthly per-service cost snapshots that the anomaly rule reads
Demo refresh daily Re-dates the demo workspace's history relative to now

Each tenant is evaluated under a Postgres advisory lock, so overlapping runs cannot double-fire. Notifications go out only after the transaction commits, to Telegram and the in-app feed.

Cost-aware by design: AWS Cost Explorer bills the customer per call, so cost reads are cached and alerts read the stored snapshots, never the live API.
🛡️

Security Hardening

🌐
SSRF Guard

Every host the builder supplies - the app database, self-hosted GlitchTip or SigNoz, the probe targets - is resolved and blocked if any address is private, CGNAT, cloud metadata or IPv4-mapped.

📍
Pinned Uptime Probe

Probes only *.run.app hosts the builder opted in, re-validates host and DNS on every probe, follows no redirects, reads no body, and times out after 5 seconds.

⏱️
Rate Limiting

Per-tenant, per-connector token buckets on SaaS reads, so one tenant can't exhaust a shared API; the public demo entry is rate-limited per IP.

🔏
Secret-Gated Crons

Cron routes demand a shared secret, compared in constant time.

🐳
Minimal Runtime

Multi-stage Node 22 image running as a non-root user.

📜
Public Security Page

A plain-language security page and an RFC 9116 security.txt, fact-checked against the code before publishing.

🧪

Quality

Testing

257 passing tests in 45 files (Vitest, run Sep 27, 2026). Three more are integration tests against a live Postgres; they skip themselves when none is reachable, so the suite is green on any machine without Docker. Typecheck, lint and the full suite form the gate before every release, and a release is an explicit, owner-approved step - pushing code never deploys it.

💡

Key Architectural Decisions

Pooled App, Isolated Data

One deployment for every tenant, with isolation enforced by Postgres RLS. The tenant id is never client-supplied - a client-supplied id is an IDOR waiting to happen.

Grants Over Keys

Cloud access is a grant the builder can revoke in their own console, and credentials are minted on demand. The goal is "nothing long-lived to steal, and receipts for every read".

AWS Web-Identity Anchor

Alfred's GCP identity federates into AWS, so no AWS key exists anywhere. The server-side pairing of tenant, account and ExternalId is the control.

Read the App's Database, Not an SDK

A read-only connection plus a schema mapping means zero code changes in the builder's app.

Propose Only What Can Be Evaluated

Every proposed rule maps to a metric the engine really computes. A proposal the engine can't check would be a false promise.

Snapshots for Cost Alerts

Cost APIs can bill per call, so alerts read stored monthly snapshots instead of hitting the cloud every five minutes.

Try Alfred

Explore the live demo workspace - no sign-up

🌐 Visit Site 🔐 Security