Most historical plays and novels of the era depicted them as spies or ninjas, a tradition that continues to this time in popular culture. Oniwaban were male servers in the inner palace of the shōgun during the Edo shogunate where they served under the command of junior elders. They were the guards of the Edo castle who kept the security and checked every single thing for the sake of the Shogun's safety. There were restrictions placed on them regarding their contact with outsiders. They could only marry within their profession.