TO ALEXEI LEONOV, the colors in space were much more beautiful than those on Earth. No photograph could match what the late Russian cosmonaut experienced while floating hundreds of miles above his home planet in 1965: the distant curve of blue suspended in the deep black of space; the sunset as lines of reds, greens, and yellows skimming the horizon. Other explorers have shared this otherworldly perspective, but back then no one saw it as Leonov did—from beyond the safety of a spacecraft during history’s earliest spacewalk.

With only a 16-foot tether as his lifeline, the pilot of the Voskhod 2 mission drifted alone through low Earth orbit. But after 12 minutes, awe turned to panic when his suit ballooned to the point where he couldn’t fit back through the shuttle’s airlock door. He feared that as the first to explore the vastness of space in a suit, he might also be the first to get lost in it.

These days, spacewalks, also known as extravehicular activities or EVAs, are commonplace. Astronauts aboard the International Space Station (ISS) have conducted 250 of them since 1998, spending hours in the extraterrestrial elements to install or fix scientific equipment. But even as astronauts have become more adept at roaming outside controlled environments and the technology behind their suits has improved, the risks of accidents or death remain.

In Leonov’s case, the drop in atmospheric pressure caused the air in his suit to swell to dangerous proportions. If he tried to release the gas and reduce pressure, he risked bleeding off too much oxygen and asphyxiating himself. He decided to take the chance and quickly opened a valve in his suit to slim it down some, then slipped back indoors. Meanwhile, the Soviet space agency cut off a national broadcast of the mission to avoid public alarm. Leonov returned to a hero’s welcome on Earth, and it wasn’t until he shared his story that everyone realized the danger he’d faced.

Since Leonov’s pioneering foray, countries have stepped up safety and training standards for spacewalks. NASA astronauts practice EVA procedures in water tanks and zero-gravity airplanes, spending nearly seven hours submerged for each hour in orbit. More recently, they’ve practiced in virtual reality.

As a result, astronauts today are well prepared for EVAs, retired NASA payload commander Jeff Hoffman says. He performed four spacewalks throughout his career. His debut, in 1985, happened to be the first unplanned one in the agency’s history, when he ventured outside his shuttle to try to fix a broken satellite. “It showed how good the training [for spacewalking] was,” Hoffman said of the three-hour EVA. “I felt very comfortable, even though it was unplanned.”

Equipment has improved since Leonov’s era too, enabling astronauts to trek around for longer. Almost like individual spaceships, spacesuits supply oxygen, regulate temperature, and vent exhaled carbon dioxide. Other small additions make EVAs more secure and comfortable, including devices crewmembers use to propel themselves around in short bursts, guardrails on the facades of structures that improve maneuverability, anti-fog coating inside helmets, and warm gloves made of many layers of insulation and tough, flexible fabric.

Still, the dangers are real. In 2013, Italian astronaut Luca Parmitano almost drowned during a spacewalk when his helmet flooded with water that had leaked earlier from the suit’s cooling system. Astronauts might also face exhaustion or blood-bubbling “bends,” caused by the same rapid pressure changes that also endanger scuba divers.

Space junk, traveling at 18,000 miles per hour, poses another risk—one that Hoffman says is getting worse as stuff accumulates in Earth’s orbit. In late 2021, NASA canceled an ISS EVA because of floating debris. Though no astronaut has been hit yet, a punctured suit could turn fatal fast.

Even as spacewalks become more regular, the potential for disaster will never be fully eliminated. After all, Hoffman says, it’s part of a job that involves sitting on a loaded rocket. “I was fully confident that if anything happened that we could do something about, we’d do the right thing. And if something happened that we couldn’t do anything about—why worry?” he explains. “I took the risk because we had useful work to do.”

This story originally ran in the Fall 2022 Daredevil Issue of PopSci. Read more PopSci+ stories.