In the early 18th century, shogun Tokugawa Yoshimune founded the oniwaban, an intelligence agency and secret service. Members of this office, the oniwabanshū ("garden keeper"), were agents involved in collecting information on daimyos and government officials. The secretive nature of the oniwaban – along with the earlier tradition of using Iga and Kōga clan members as palace guards – have led some sources to define the oniwabanshū as "ninja". This portrayal is also common in later novels and jidaigeki. However, there is no written link between the earlier shinobi and the later oniwabanshūIt is known, though, that ninja of both Iga and Koga were assigned as bodyguards and secret police, with many Koga being assigned to discreetly observe as "gardeners"; this fact is recorded in several books on the topic, such Stephen Turnbull's Ninja: The True Story of Japan's Secret Warrior Cult, Andrew Adams' Ninja: The Invisible Assassins and Stephen K. Hayes Ninja & Their Secret Fighting Art.
Read more about this topic: Ninja