
Gatekeeper is an autonomous options trading agent built on Alpaca's Trading API and CLI. Claude Opus 5 reads the market and proposes a defined-risk vertical spread; fourteen deterministic Python gates then decide whether that trade is allowed to exist. The model never states a dollar risk figure. It proposes strikes and a quantity, and the risk layer derives max loss from the contract specs, silently resizes to fit the budget, or rejects outright. Risk rules in a prompt fail quietly; risk rules in code fail loudly. The strategy is a barbell. A core sleeve sells credit spreads against the direction of the move, winning slowly and often. A satellite sleeve buys debit spreads with it, losing small and often but paying multiples when a trend actually runs. Two different bets, not the same bet twice. The agent's own regime call is a binding control rather than a comment. Classifying the tape as bull, bear or sideways mechanically sets its risk budget and forbids trade directions, and can only ever reduce risk. Calling bear locks it out of selling puts and cuts its size to a third, which is precisely how short-premium accounts avoid dying. Everything targets Thursday expiry, never Friday. The deadline is Friday 11:00 ET and options expire at 16:00 ET, so a Friday spread would still be open at peak gamma at the exact moment P&L is judged. One day of theta buys an unarguable final number. Exits are equally deterministic: assignment risk, expiry flatten, stop loss and profit target, all priced from the unfavourable side of both quotes so a rule never fires on an optimistic mark. It runs unattended on Cloud Run and Cloud Scheduler, journaling every cycle to Firestore and a public dashboard: the market snapshot, the model's verbatim reasoning, all fourteen gate verdicts, the order and the fill. 101 tests.
4 Sep 2026