The real science behind the technology used in "Kingsman: The Golden Circle."

When the first trailer for Kingsman: The Golden Circle fans were astonished to find that agent Harry Hart, played by Colin Firth, was still alive. Hart met a brutal fate at the climax of the first super-spy film: a close-range shot to the eye outside a church in Kentucky at the hands of Samuel L. Jackson’s Valentine. Now that the sequel is in theaters, this “far-fetched plot” point finally gets an explanation, revealing a bizarre technology that actually isn’t that different from the incredible biotechnology used to treat real-life gun-inflicted wounds.

Some spoilers for Kingsman: The Golden Circle ahead.

Audiences believed Hart was a goner at the end of Kingsman: The Secret Service, but a flashback sequence in The Golden Circle reveals that two members of the U.S.-run Statesman agency swarmed onto the crime to investigate after Hart was left for dead. The American spies, played by Channing Tatum and Halle Berry, go into first-aid mode by wrapping a plastic-like shrink-wrap around Hart’s injured head.

When it’s activated, the shrink-wrap rapidly inflates with a swirl of orange and blue gel, which then fills in the hole in his skull. This “bio-foam” is what keeps Hart alive until nanites (nano-scale robots) rush in to repair the damage. It may seem like another ridiculous made-up tool in the super-spy toolkit, but its premise is something actual scientists have already considered.

Hart's fate in "Kingsman: The Secret Service."

While no one’s invented a colorful foam that can stop a gun wound from killing someone in real life, an Oregon startup called RevMedX created something very similar in 2014: a device called the XSTAT 30 that could inject rapidly-expanding blood-mopping sponges into a wound cavity created by a gunshot or shrapnel.

When the syringe-style applicator is applied to the wound, 92 compressed, cellulose sponges are suddenly released, which then expand and swell to fill the wound cavity. Up to three applicators can be used on a patient, and each applicator can absorb up to a pint of blood.

It’s no bio-foam, but this device can keep a victim alive for up to four hours before they receive surgical care. It was developed to be used in a battlefield scenario, where the pocket-sized device could replace gauze bandages and death by hemorrhage. According to the United States Army Institute of Surgical Research, 33 to 56 percent of deaths caused by severe bleeding happen before the patient can make it to the hospital.

How the XSTAT works.

In 2015, the XSTAT 30 was approved by the FDA, and by 2016 it was successfully used on a soldier in the field.

The Statesmen might want to hold onto the tech they’ve got, though, because the XSTAT 30 isn’t recommended for wounds that happen above the collarbone. While we may have Kingsman-like technology, Hart is lucky to live in a world where the impossible becomes possible through secret-agent means.