Text this: Optimal control for safety-critical systems