The novel opens six years before the main action at the White House, where 10-year-old Madeleine "Maddie" Manchester arrives for a state dinner. Maddie's father, Michael Manchester, serves as the head of the president's Secret Service detail, and Maddie has spent months exploring the building's hidden passageways with Logan, the president's son (Secret Service code name "Rascal"). Logan, who considers Maddie his only friend, gives her a gold charm bracelet in a quiet corridor, and she promises never to take it off. On their way back to the party, they encounter three Russian men pushing a large rolling cart. One man bears a tattoo of a two-headed bird being eaten by a wolf and winks menacingly at Logan. Maddie notices a wisp of red fabric, part of the first lady's gown, protruding from the cart and realizes the men are kidnapping Logan's mother. Logan presses his emergency panic button. In the ensuing shootout, Michael kills the attackers but is severely wounded. The first lady is rescued, and Logan is grazed by a bullet.
Six years later, Maddie, now 16, lives with her father in a tiny cabin in the Alaskan wilderness with no phone, no internet, and no neighbors. She has become fiercely self-reliant, throwing hatchets, chopping wood, and catching fish. Through unsent letters addressed to Logan, she reveals she wrote him every week for two years after leaving DC and never received a reply. Her father works as a bush pilot, often leaving her alone for days. Maddie does not fully understand why they left or why her father chose such extreme isolation. Meanwhile, Logan has become a rebellious troublemaker in Washington, repeatedly ditching his Secret Service detail and courting scandal. After he slips his detail agent for eight hours, the president sends Logan to stay with Michael in Alaska. Logan arrives by helicopter, but Maddie reacts with hostility, confronting him about the unanswered letters. Logan insists he never received any. Maddie's father must then make an emergency supply flight ahead of a storm, leaving Maddie and Logan alone with two Secret Service agents camped outside.
The next morning, while hiking, a man strikes Maddie with the butt of a gun and sends her tumbling roughly 50 feet down a cliff. Logan watches her fall and believes she is dead. The kidnapper, a young Russian man working for a criminal network, handcuffs Logan, throws the key and Logan's panic button over the cliff, and forces him to march into the wilderness. Logan identifies the kidnapper as Stefan by observing the man's reaction to guessed names. Stefan makes satellite phone calls in Russian, unaware that Logan taught himself the language after the White House incident. Logan overhears Stefan confirm he has "the boy" and request a plane at a rendezvous point, realizing he is being taken to an aircraft bound for Russian airspace.
Maddie, however, is not dead. She regains consciousness at the bottom of the cliff, discovers the discarded handcuff key, and chooses to follow Logan rather than return to the cabin for help. She leaves trail markers for future rescuers and formulates a plan centered on a decaying rope bridge spanning a deep ravine. She hangs her gold charm bracelet from a tree branch to signal Logan that she is alive and has a plan. Logan spots it and drops the rock he planned to use against Stefan. Reaching the bridge first, Maddie weakens its boards with her small knife, positions a rusted bear trap at the bridge entrance, and hides a larger backup knife in the bridge post.
When Stefan nearly drowns Logan during a struggle, Maddie reveals herself and allows herself to be taken as a second hostage. She kisses Logan to transfer the handcuff key from her mouth to his. At the bridge, she argues that crossing is suicidal and proposes an alternate route via a place she calls Black Bear Bridge, but Stefan, pressed for time, orders her to cross first as a test. She picks her way across the weakened structure, calling directions back to Logan, who secretly unlocks one handcuff during the crossing. Stefan steps into the hidden bear trap and lurches forward onto the weakened boards, which snap beneath him. Once Logan leaps to safety, Maddie fires a flare gun to ignite the bridge. Stefan, stranded on the opposite bank, fires his pistol; one bullet strikes Maddie in the shoulder, but she and Logan escape into the trees.
Logan carries the wounded Maddie through a blizzard until they find a trapper's shack with a stove and dry firewood. Maddie, barely conscious, uses her magnesium block, firesteel (a spark-producing fire-starting tool), and Vaseline-coated cardboard to start a fire. Logan cleans her wound and bandages her. By the fire, Logan accidentally quotes a detail from one of her unsent letters, revealing he read every one and lied. He confesses he wanted her to stop writing because he blamed himself for her father's injury and their exile to Alaska. Maddie is furious, but their barriers finally break, and they kiss by the dying fire.
The next morning, they return to the burned bridge so Logan can climb into the ravine and retrieve Stefan's pack, which contains the satellite phone. Stefan, who crossed via Black Bear Bridge overnight, ambushes Maddie. A forest ranger Stefan had shot the previous day then appears alive, but Maddie discovers he is actually Uri, another operative of the same criminal network, when she spots the wolf-and-bird tattoo from six years ago on his wrist. After Maddie incapacitates Uri, Stefan turns cooperative. He explains that "Boris," known as "the Wolf," is a dying Russian crime lord who blames Michael Manchester for killing his son during the White House incident. The Wolf forced Stefan into the kidnapping by holding Stefan's diabetic sister, Natalia, hostage. Stefan also reveals that Logan's social media posts about traveling to Alaska tipped off the Wolf's network, and that Logan's two Secret Service agents are alive, tied up but unharmed.
Maddie dials her father's number on the satellite phone, but Uri answers, and Michael's ringtone sounds from Uri's pocket, confirming he has also been kidnapped. Maddie realizes her father's years of isolation were an attempt to hide from the Wolf's revenge. She handcuffs Logan to a tree branch to keep him safe and sets off with Stefan to rescue her father and Natalia from the Wolf's camp at the lake. Stefan marches Maddie in at gunpoint, presenting her as a hostage, but the Wolf, an emaciated old man, dismisses her as worthless and orders Stefan, Natalia, and Maddie executed.
Maddie hurls concealed magnesium shavings into the campfire, causing a massive fireball. In the chaos, she finds her father held at knifepoint by the Wolf. A guard's bullet strikes Michael in the back. Logan, who freed himself and followed, arrives and offers himself to the Wolf, kneeling and declaring, "A son for a son." As the Wolf brings his blade to Logan's throat, Maddie throws her backup knife with lethal accuracy, killing Boris. Stefan shoots the last guard, and Secret Service helicopters appear on the horizon. Maddie tells Stefan to escape with Natalia in her father's floatplane, promising to cover for him. Maddie holds her wounded but alive father as the helicopters land.
In a brief epilogue, Maddie relocates to the Washington, DC, area while her father recovers from surgery. She prepares to attend school with Logan, standing nervously at the gates feeling as vulnerable without her knives as she ever felt in the wilderness. Logan tells her that if anything goes wrong, he will save her. Maddie takes his hand and replies, "Not if I save you first."