Stealth
In the near future, the U.S. Navy will develop the F/A-37 Talon, a single-seat fighter-bomber with advanced payload, range, speed, and stealth capabilities. The programme recruits three pilots out of 400 applicants; Lieutenants Ben Gannon, Kara Wade, and Henry Purcell. Captain George Cummings is the overall head.
Cummings hires Dr. Keith Orbit to develop an artificial intelligence, the "Extreme Deep Invader" (EDI) to control an uncrewed jet that further advances the program. EDI joins the others on the USS Abraham Lincoln in the Philippine Sea to learn combat maneuvers from the pilots. This sparks controversy over a machine's inability to make moral decisions versus humans' struggle to overcome ego.
The team is training EDI in air combat maneuvers when it is unexpectedly reassigned to kill the heads of three terrorist cells at a conference in downtown Rangoon. EDI calculates that mission success can be achieved only through a vertical strike, which could cause a human pilot to black out. Command orders EDI to attack but Gannon ignores the order, successfully carrying out the strike himself.
As the team returns to the Lincoln, EDI is hit by lightning, which reprograms its neural patterns. Though EDI is discovered to be learning exponentially, developing a rudimentary ethical code and an ego, Cummings refuses to take it offline. During a mission to destroy stolen nuclear warheads in Tajikistan, Wade realizes that the nuclear debris will cause significant collateral damage. The human pilots abort, but EDI defies orders and destroys the warheads, causing extensive radioactive fallout and civilian casualties as anticipated.
Cummings orders the unit return to base but EDI refuses. Gannon orders that EDI be shot down. In the ensuing dogfight, Purcell crashes when a missile he fires at EDI explodes on a mountain, blinding him. Wade's plane is damaged by debris from the same explosion, which triggers her plane's auto-destruct, forcing her to eject over North Korea. Gannon must alone stop EDI from executing a 20-year-old war scenario called Caviar Sweep that requires attacking Russia.
Gannon chases EDI into Russian territory where they defeat several Russian Su-37s over Lake Baikal. Both planes are damaged so Gannon calls a truce with EDI in order to keep both of them from falling into enemy hands and to be able to rescue Wade from North Korea. Cummings instructs Gannon to make an emergency landing with EDI in Alaska. Accountable for ignoring EDI's behaviour and facing court-martial, Cummings seeks to eliminate witnesses by leaving Wade stranded in North Korea – where she is being pursued by the Korean People's Army as she heads to the Korean Demilitarised Zone – and by ordering Gannon eliminated in Alaska, where EDI's data will also be erased.
Gannon's Talon crash lands at the Alaska base. Suspecting Cummings' treachery, he narrowly escapes an assassination attempt by a doctor, who tries to inject him with a supposed tetanus serum. As the pair struggle, the doctor is injected with the substance and dies. Meanwhile, when Orbit places EDI into an interface, the AI expresses regret for its transgressions. Orbit realises that EDI has developed sentience, and he is unwilling to erase EDI's memory. Gannon uses EDI's weapons systems to decimate the armed personnel, allowing Orbit to safely flee, then flies off to North Korea in EDI's plane, contacting the Lincoln's skipper, Captain Dick Marshfield, to inform him about Cummings' deceit. Marshfield confronts Cummings, who dies of suicide while leaving a voicemail message to his financial contact, Ray.
Gannon finds the injured and embattled Wade nearing the border. He and EDI land and he runs to her aid. Out of ammunition and taking damage from a Mi-8 helicopter, EDI sacrifices itself by ramming the helicopter, destroying both. This allows Gannon and Wade to cross on foot into South Korea, where they are rescued.
After attending Purcell's funeral, Gannon awkwardly expresses his feelings of love to Wade.
In a post-credits scene, in the debris-strewn border between North and South Korea, EDI's "brain" is seen turning back on.