
Guardrail is a pre-trade risk layer for autonomous trading agents. People are wiring LLMs straight into brokerage APIs, where a hallucinated or reckless order has nothing between it and execution. Guardrail makes the control structural: the model physically cannot reach the broker. For each symbol, the agent pulls live news and price bars through Alpaca's CLI and returns only a direction: bullish, bearish, or skip. It never chooses the contract, strike, expiry, or size; those are deterministic (nearest expiry ≥7 days, at-the-money, one contract). Every proposal passes through a pure-Python rules engine defined as plain YAML: drawdown halt, symbol allowlist, minimum days to expiry, contract limit, close-window, and a 20% position cap. First block wins. Approved single-leg options orders execute on Alpaca paper trading as limit orders; blocked ones never leave the machine. Every decision, whether approved, blocked, or skipped, is logged to SQLite and shown on a live dashboard. 22 tests cover the engine.
4 Sep 2026