Diabetics are often advised to exercise to lose weight, yet working out can often be a double-edged sword for people with the condition. On the one hand, weight loss can help lessen the severity of some of the symptoms and, in some cases, put diabetes in remission.

On the other, exercise presents a possible danger to many diabetics because it affects blood sugar levels. When we exercise, our body draws on reserved sugar in our muscles and liver (aka glycogen).

Blood sugar levels are affected because sugar from the blood is used to restore those glycogen stores, which can lead to disorientation and discourage some patients from continuing an exercise regimen.

Although doctors advise diabetics to exercise, there’s been very little universal guidance on how to do it safely. Until now, that is. Researchers from Swansea University drew up a landmark agreement on how diabetics should tackle workouts, addressing everything from carbohydrate intake to the severity of workouts.

Top diabetes research groups, including the American Diabetes Association and the Juvenile Diabetes Research Foundation, have endorsed the agreement.

“On the basis of the evidence, we can now recommend how to safely use these devices and support people with type 1 diabetes,” Dr. Richard Bracken, a researcher at Swansea University’s School of Exercise Sciences and Lifestyle, said in a statement. “It will help them to obtain the health benefits of exercise, whilst minimizing wide fluctuations in their blood glucose level.”

This article will go over some of the highlights from the report, which is extensive. For full details, click here.

Before working out, diabetics should check their blood sugar levels to see if it’s safe to start exercising. The Mayo Clinic suggests a blood sugar range from 5.6 to 13.9 mmol/L.

The researchers advise eating carbs that are low on the glycemic index 30-60 minutes before exercise.

During exercise, ensure your blood sugar levels stay within 7.0 to 10.0 mmol/l. Additionally, if levels fall below 4.0 mmol/l you should stop exercising and consume carbs and wait to continue until levels return to normal. If levels fall below 3.0 mmol/l, no exercise should be done for the rest of the day.

Levels should remain between 4.0 and 10.0 mmol/l for the first 90 minutes after exercise. The report details how much carbs should be consumed depending on the severity of your workout.

The report also details how children and adolescents with diabetes should approach exercising.