What precautions are taken before and after exercise during a cardiac rehabilitation program?

Constant monitoring. It depends on what stage of rehab one is in, but at the beginning (stage 1) an individual is exercising under constant supervision with telemetry and frequent vital signs. As one progresses, the exercise intensity increases and frequency of vitals decrwase.
Cardiac safety. Exercise w/ someone trained to guide & motivate you w/o overdoing & who can help you if you're in trouble. Make sure your md approves. Before, be well hydrated & eat 2 or more hours before so your heart & gut aren't competing for blood supply. After, hydrate, stretch & wait about an hour to eat. Do not exercise without taking your prescribed meds unless your doctor tells you otherwise.