Experts in disguise, infiltration, espionage and counterintelligence, the ninja had spiritual values and magical traditions that distinguished them from the soldierlike samurai. Their art of ninjutsu, invisible as well as indispensable, was transmitted in secret schools and relied on only a few books, which were written in code.