Ghost in the Shell
(1995)

Japanese anime for adults with a title that means "Soul in the Body"

In a futuristic society, the Major and Batou are cyborgs from the government agency "section 9". While seeking to apprehend a cyber terrorist named the Puppet Master we finally learn that the Puppet Master is a rogue computer program that became self aware as a result of an illegal project by the rival government agency "section 6". Unable to reproduce, the Puppet Master seeks to "advance" by merging with the Major. The Major bonds with the Puppet Master during a destructive shootout involving "section 6" where the Puppet Master is destroyed and all that is left of the Major is her head with her "ghost" intact. "Section 6" is busted and Batou finds the Major a new body. She leaves in search of adventures saying "The Net is vast and infinite".

Thanks Don P!