← All builds

CoachRhythm

Live

Safety filter runs before the model

2026

  • Next.js 15
  • TypeScript
  • Supabase (Postgres RLS)
  • Claude API
  • Playwright

A programming assistant for personal trainers that turns a client intake — injuries, available equipment and goals — into a complete training plan. I'm a certified personal trainer, so the failure I cared about most was the obvious one: programming something that hurts a person.

Exercises are screened against each client's logged injuries by a deterministic filter that runs before the model is prompted, so the model only ever programs from an already-filtered pool. Its output then clears a second deterministic pass — movement balance, pull-to-push volume, recovery spacing, rep ranges, progression — with no LLM in the verification path. A failed check gets one retry; plans that still fail are saved as flagged drafts rather than presented as finished.

Trainers work from a 543-exercise library tagged by movement pattern, equipment and contraindication, and multi-tenant isolation is enforced in Postgres row-level security and proven by a two-tenant test suite rather than assumed.

What I'd do differently

I didn't want safety to depend on the model following instructions, because when that fails it fails silently — a plan that breaks a constraint looks the same as one that respects it. The cost is that filtering first sometimes leaves the model a thin pool and a duller program. For a client with an injury, I'd rather ship the duller program.