A method of determining a basal rate adjustment of insulin in a continuous glucose monitoring system of a person with diabetes, the method comprising: - receiving, by at least one computing device, a signal representative of at least one glucose measurement; - detecting, by the at least one computing device, a glucose state of the person based on the signal, the detected glucose state including a glucose level of the person and a rate of change of the glucose level; - calculating, by the at least one computing device, an adjustment to a basal rate of a therapy delivery device based on a control-to-range algorithm and at least one failsafe constraint to account for changes in the insulin sensitivity of the person with diabetes or inaccurate glucose measurement, wherein the therapy delivery device has a nominal basal rate representing an unadjusted basal rate set for the person with diabetes; wherein the failsafe constraint is calculated in accordance with a method as follows: - determining if the basal rate remains above 1.1x the nominal basal rate for a predetermined period of time, - alerting the person with diabetes to test their blood sugar and input the tested blood sugar into the continuous glucose monitoring system as an input blood sugar measurement, and - determining whether the input blood sugar measurement and the detected glucose level of the person with diabetes agree with each other within a predetermined metric of quality, wherein if the at least one computing device determines the input blood sugar measurement and the detected glucose level of the person with diabetes do not agree with each other within the predetermined metric of quality, the control-to-range algorithm is turned off or the aggressiveness is reduced until the sensor in the continuous glucose monitoring system is replaced or the sensor is recalibrated and confirmed to be accurate. - receiving, by at least one computing device, a signal representative of at least one glucose measurement; - detecting, by the at least one computing device, a glucose state of the person based on the signal, the detected glucose state including a glucose level of the person and a rate of change of the glucose level; - calculating, by the at least one computing device, an adjustment to a basal rate of a therapy delivery device based on a control-to-range algorithm and at least one failsafe constraint to account for changes in the insulin sensitivity of the person with diabetes or inaccurate glucose measurement, wherein the therapy delivery device has a nominal basal rate representing an unadjusted basal rate set for the person with diabetes; - determining if the basal rate remains above 1.1x the nominal basal rate for a predetermined period of time, - alerting the person with diabetes to test their blood sugar and input the tested blood sugar into the continuous glucose monitoring system as an input blood sugar measurement, and - determining whether the input blood sugar measurement and the detected glucose level of the person with diabetes agree with each other within a predetermined metric of quality, wherein if the at least one computing device determines the input blood sugar measurement and the detected glucose level of the person with diabetes do not agree with each other within the predetermined metric of quality, the control-to-range algorithm is turned off or the aggressiveness is reduced until the sensor in the continuous glucose monitoring system is replaced or the sensor is recalibrated and confirmed to be accurate.