API Guard Pattern: Why Calling Functions Directly Is Forbidden

QuantGPT uses threading.local to enforce a runtime guard: all backtest calls must go through the API boundary. Direct function calls raise an exception. Not because the function is dangerous — but because a system without boundaries can’t be audited.

April 28, 2026 · 3 min