The nineteenth episode of the animated television show Star Wars Rebels, entitled "Double Agent Droid", is from the third season. As the series' fifty-sixth episode, it was originally broadcast on Disney XD on March 11, 2017.
The episode commences with a Sentinel-class landing craft separating from the Spectres' starship, known as the Ghost. Wedge Antilles assures Hera Syndulla, Garazeb Orrelios, and Ezra Bridger via their comms that they'll secure the clearance codes "before you know it." In response, Zeb makes a humorous comment about Wedge's co-pilots being more of a challenge, eliciting a chuckle from Ezra. Hera instructs them to cease the chatter and focus on their assigned task, as she has confidence that she has the best team for the job, despite Zeb and Ezra's opinions. Zeb then sarcastically questions whether their "best team" consists of AP-5, Chopper, and Wedge, which prompts laughter from both him and Ezra.
Concurrently, Wedge, who is clad in a TIE fighter pilot uniform, inquires of AP-5 why Hera selected him for the mission. AP-5 retorts that Wedge's understanding of protocol is inadequate and that Imperial pilots never remove their helmets during flight. Wedge counters by pointing out that he graduated at the top of his class from the Imperial Academy. AP-5 replies that Wedge is mistaking his attention to detail with an assault on his own easily bruised ego. Chopper then beeps, and Wedge sighs.
AP-5 emphasizes his desire for the mission to proceed precisely as planned, highlighting the necessity of obtaining clearance codes for the impending attack on Lothal. Wedge reminds both AP-5 and Chopper that he was also present at the meeting. When Chopper complains, AP-5 responds that his circuits overheated because he was placed in charge. AP-5 stresses that it is his mission and that Captain Syndulla specifically assigned him to this operation due to his particular skill set and experience.
When Wedge tells them to argue somewhere else, AP-5 boasts to Chopper that "Anything you can do, I can do better." The bickering between Chopper and AP-5 continues, with AP-5 asserting that his superior programming makes him a better rebel spy. Wedge then remarks that he now understands why no one else volunteered for the mission.
The Sentinel transitions out of hyperspace and heads towards Killun 71. The shuttle then approaches Killun Station, which is constructed on the side of a mountain. Before donning his helmet, Wedge instructs AP-5 and Chopper to cease their arguing and prepare for the welcoming party. When the flight controller declares that they are in a restricted sector and demands their identity, Wedge identifies himself as 836-VS, delivering service droids, and transmits the clearance code B6279. AP-5 comments that Antilles' performance was unconvincing, but Wedge dismisses his criticism. The flight controller then grants their ship clearance to land at the Imperial Security Bureau base.
AP-5 and Chopper disembark, their argument still ongoing. They arrive at a scanner manned by two stormtroopers. One of the stormtroopers declares that they must proceed individually, to which AP-5 huffily responds that he is aware of the protocol before proceeding. The scanner clears him. However, after Chopper passes through, the scanner fails to flash green and eventually beeps as the lights flash red, although the stormtrooper guards remain oblivious. As they enter the base, AP-5 reminds Chopper to follow his lead, sparking yet another argument. Meanwhile, in space, the crew of an Imperial IGV-55 surveillance vessel from the Imperial Information Office receive the sensor's transmission. The communications officer, 3-9, informs the Imperial Controller, LT-319, that an unauthorized droid has entered the ISB base on Killun 71. The controller speculates that this could be the spy droid they have been searching for and orders his crew to set a course for Killun 71.
Back at the ISB base, Chopper is arguing with a mouse droid, prompting AP-5 to order him to be quiet, as they were fortunate to pass through security. The two droids then encounter an astromech port in the hallway. When Chopper beeps in Binary, AP-5 responds that these terminals connect to the central computer, but the most current codes will not be accessible there. He reminds Chopper that this info was why he was put in charge of the operation. Chopper disagrees, but AP-5 insists that he makes better calculations than Chopper. When Chopper protests, AP-5 insists on retrieving the codes alone.
In space, the Gozanti cruiser approaches Killun 71. When a comm officer asks 3-9 where the data scan update is, he responds that he is tracking 7161. An image of the rebel Sentinel craft at Killun 71 appears on the data screen. The communications officer confirms that the droid that triggered the alarm arrived on that shuttle. The controller checks archival data on unidentified rebel droids and recognizes Chopper as an outdated C1-series astromech droid. He believes that Chopper is the droid infiltrator that Grand Admiral Thrawn had referenced in his report on Phoenix Cell. 3-9 wants to inform Killun Station, but the controller insists on informing the ISB only after he has what he needs from the spy.
Upon their arrival at Killun 71, AP-5 expresses his admiration for the simplicity of Imperial structure and organization. He locates the central computer core, only to be confronted by a female RA-7 protocol droid named PZ-7. When PZ-7 expresses surprise that two inventory units were assigned to this level, AP-5 informs her that PZ-7 has been reassigned to the cargo platform and that he is her replacement. PZ-7 meekly accepts AP-5's explanation, leading him to marvel that he is of the same model as those Imperial drones. AP-5 boasts of using his intellect to his advantage as he inserts his data disk into the network terminal. Within seconds, he successfully downloads the clearance codes for Lothal, boasting about handling the mission independently.
Meanwhile, 3-9 reports to the controller that Chopper is attempting to access the network terminal. The controller is pleased, as he believes he can extract the location of the rebel base from Chopper's memory. He orders 3-9 to capture the droid. As Chopper accesses the terminal, a surge of electricity convulses his chassis. The controller boasts that Admiral Thrawn will be pleased. When 3-9 reports that no base coordinates were stored on the droid, the controller decides to use Chopper to lead them to the base instead. He tells 3-9 to initiate the takeover. The controller remarks that Chopper's resistance to reprogramming is impressive, but ultimately futile. 3-9 reports that the takeover is complete.
Back at Killun Base, AP-5 finds an unresponsive Chopper and dismisses him as "all talk and no action." He taunts Chopper that he stole the codes while he was waiting. Unbeknownst to AP-5, the Imperials are watching him through Chopper's visual processor. When Chopper does not respond, AP-5 accuses him of sulking and challenges him to race back to the shuttle. The female comm officer informs the controller that the inventory droid has accessed the Lothal orbital access codes from the main computer, and warns that there is danger. However, the controller responds that the rebels only have a 31% chance of using the codes. He decides to let the rebel droids escape in order to learn the location of the rebel base, surmising that the odds are in their favor.
AP-5 boards the ramp of the Sentinel shuttle and informs Wedge that he has successfully obtained the clearance codes and that they must depart immediately. When Wedge inquires about Chopper, the astromech rolls up the ramp. AP-5 remarks that it is about time, and Chopper beeps an apology in Binary. Chopper then admits that AP-5 is the better leader. Relieved by Chopper's polite behavior, Wedge anticipates a smooth flight back to base. When AP-5 asks Chopper what he is up to, Chopper responds in Imperial Code 16, leading AP-5 to deduce that he is on standby mode. The controller uses the visual processor to monitor Chopper and AP-5. AP-5 is suspicious because Chopper has never been on standby mode before.
During the journey, AP-5 tells Chopper that Code 16 is an Imperial code. When the reprogrammed Chopper insists that he is speaking his language, AP-5 responds that he only uses Code 16 when necessary and accuses Chopper of questioning his loyalty. Wedge calls the droid back to the cockpit. AP-5 tells Chopper he is watching him while the controller watches.
In the cockpit, Wedge converses with Hera via hologram. Hera is pleased that everything went according to plan. When Wedge gives credit to the droids, AP-5 replies that he did all the work. Hera thanks the team and then asks Wedge how long it'll be before they reach their rendezvous point. Wedge replies that they'll be there within the hour. He then asks AP-5 what is the matter with him. Chopper then offers Wedge a carton of blue milk. When Wedge notices the change in Chopper's attitude, AP-5 suspects that Chopper is being insincere, but Wedge welcomes the change. AP-5 protests when Wedge suggests that he needs a change in attitude.
The Imperial controller observes the conversation and identifies AP-5 as a threat to his plan. When Chopper addresses AP-5 as "sir," the protocol droid thinks that he wants to take possession of the data disk. After Wedge tells Chopper to check the hyperdrive coils to ease the drag, he then tells AP-5 to end his childish competition with Chopper. AP-5 warns Wedge that he suspects that Chopper may have been compromised on Killun 71. Wedge thinks that he is being paranoid and insists nothing is wrong with Chopper. When Chopper returns, Wedge tells him to take over the controls while he uses the refresher.
AP-5 follows Lieutenant Antilles into the refresher and insists on talking in private. He warns Wedge that he saw Chopper being plugged into a network terminal, and recalls his suspicions about Chopper's silent mode and the use of an Imperial term. Wedge doesn't want to listen to conspiracy theories, as he really needs to use the refresher, and kicks AP-5 out of the refresher. Chopper spies on the argument while hanging upside down. The controller surmises that everything is on track because the inventory droid has undermined his own credibility. He thinks it is a matter of time before Chopper leads them to Phoenix Cell and their rebel base.
The Sentinel docks with the Ghost while Ezra and Zeb play a game of dejarik. Hera meets AP-5 and Wedge. AP-5 presents the clearance codes and tells the Spectres he saved the codes from C1-10P. Wedge adds that AP-5 and Chopper were playing some sort of spy game. While Zeb and Ezra laugh, AP-5 insists that it is not a game and that he has serious concerns about Chopper. While Ezra asks where Chopper is, AP-5 pleads for his comrades to listen to him. A suspicious Hera asks Chopper where he is and heads to the Ghost's cockpit.
She asks Chopper what he is doing with the hyperspace logs. Chopper responds that he is updating his database. When Hera tells him he is not making any sense, he claims that he had files wiped on Killun 71. Hera lays down the clearance codes for Lothal on the console. She then reminds Chopper that she wipes his data after every jump as a security precaution, and says he needs a proper recharge. Chopper exits the cockpit abruptly.
Back in the common area, Wedge recounts how AP-5 followed him into the refresher, and Ezra and Zeb laugh. Zeb states that AP-5 once did the same thing to him. Hera enters the common area to warn the other rebels that she thinks something is wrong with "Chop." AP-5 expresses vindication, while Wedge observes that Chopper has been curiously nice to him. Zeb remarks that Chopper being nice isn't weird but creepy. Unbeknownst to the other rebels, Chopper is watching them from behind. Ezra suggests that Chopper short-circuited, while Hera recommends running a diagnostic scan.
Suddenly, the Ghost lists as the ship exits hyperspace abruptly. When Hera demands that Chopper explain why, he beeps back in Binary. Hera tells the rebels that he is in the engine room. When Zeb pounds his hands and says that he'll show Chopper what malfunction means, Hera tells him to go easy on Chopper because they don't know what is wrong with him yet. When AP-5 asks whether they should all go, Ezra accuses him of cowardice. The rebels head into the cargo bay, and Chopper seals them inside. AP-5 and Hera demand that Chopper open the doors. Instead, Chopper locks them in and detaches the Ghost from the Sentinel shuttle. When AP-5 remarks that he told them so, Hera puts a reassuring arm around him and tells him they will listen to him next time.
Meanwhile, the Imperial-controlled Chopper recovers the stolen clearance codes. 3-9 informs the controller, who then orders Chopper to install a data spike onto the Ghost's navigation computer. The controller remarks that all they need now is a little time and no interference. Back aboard the Ghost, the rebels try to force the hatch open in vain. The controller has no need for prisoners and orders Chopper to open the cargo bay hatch doors to space. The Spectres struggle to cling on and avoid being sucked into space. With much difficulty, Hera manages to use an access panel to manually reseal the doors. Watching through Chopper's visual processor, the controller thinks that the rebels are a short-term problem because the download is underway.
Hera realizes that someone is using Chopper to download the location of Chopper Base. Ezra fears this will be the end of Phoenix Squadron, and asks if there is another way out. Hera says they need to override the hatch control, but that it involves going outside. Since AP-5 doesn't need a space suit, she suggests he do it. AP-5 is reluctant, but Hera insists that they don't have much time. While Chopper downloads the data from the nav computer, AP-5 climbs onto the hull, but is spotted by Chopper and the controller.
The controller vows to end the traitorous inventory droid. While AP-5 accesses the override circuitry, Chopper, armed with two blasters, exits the Ghost and attacks his friend. AP-5 shields himself with the hatch. Meanwhile, the data spike has downloaded 50% of the Ghost's data. The controller thinks success is imminent and orders his crew to search the archive memory for the location of the rebel base. Chopper does a second loop in space and attacks AP-5 just as he manages to unseal the cargo bay. Chopper pushes AP-5 into space and flies back to the Ghost, entering the cockpit.
Ambushing the hijacked droid from behind, Zeb stuns Chopper with his bo-rifle and remarks that he has wanted to do it for a long time. Ezra removes the data spike, sabotaging the data transfer, and remarks that it looks like the Imperials almost got what they wanted. Hera advocates striking back against the Empire for messing with her droid, and tells Zeb to get him up. Ezra remarks that Hera is angry. Hera states that the culprit must have a strong signal array to control Chopper from such a distance.
She decides to reverse the feed on them and send back more data than they expect. After connecting Chopper to the Ghost's computers, Hera uses the astromech droid's visual processor to send a stern message to the Imperial controller, telling him to keep his hands off her droid. As Chopper convulses, 3-9 reports that the circuits on their IGV-55 surveillance vessel are overloading. The female comms officer reports that their fuel cells have been compromised. The controller tells them to shut off the signal, and Hera tells them to say goodbye to their memory core. The data overload causes the surveillance vessel to explode with its crew aboard.
Chopper squeals in pain. Hera tends to her droid and pleads with her buddy to come back to her. She places her hands on him. Despite their dislike for Chopper, even Zeb and Ezra express sadness. Suddenly, Chopper begins to reboot. Hera, Ezra, and Zeb are elated to see their friend again, with Zeb remarking that he can't believe that he is glad to see Chopper. Wedge reminds them that it was a close call and that they still need to give AP-5 due credit. Ezra cheers for AP-5, but then asks where he is.
While floating in space, AP-5 remarks that he should be frightened but finds himself strangely calm. He embraces the solitude of silence just as he is surrounded by a herd of baby neebray. AP-5 befriends the creatures and starts to break into a song. His solitude is abruptly interrupted when he is rescued by the Ghost, much to his chagrin.
The Spectres and Wedge welcome AP-5 aboard. AP-5 confronts Chopper, who is apologetic. Chopper's apology, however, makes AP-5 think that Chopper is still compromised. In response, Chopper whacks him and Wedge with his manipulator arms. Wedge remarks that he has had enough of droids and that he is flying solo from now on, as he and AP-5 chase after Chopper. Hera watches from above and warns not to mess with her droid, only half-joking.
During the episode's opening, AP-5 and Chopper engage in a dispute that mirrors the lyrics of "Anything You Can Do (I Can Do Better)," a song penned by Irving Berlin for the 1946 musical Annie Get Your Gun.