A ninja or shinobi was a spy and infiltrator in pre-modern Japan. The functions of a ninja included siege and infiltration, ambush, reconnaissance, espionage, deception, and later bodyguarding. Antecedents may have existed as early as the 12th century. There is little evidence that they were assassins.