While ninja groups eventually gained a hierarchy that closely resembled that found in the samurai and the daimyo, there origins were probably very different
Most likely in their earliest history ninjas were small groups which were organized around families and villages.
At the time of the ninja almost all military occupations were exclusively male, and ninjas are almost always shown as males as well. There is documentation, however, of female ninjas known as kunoichi. The characters for this term are the same as the kanji for woman. While female ninja are often depicted as prostitutes who use the art of seduction to subdue the enemy the truth is that many of them probably operated as servants were they were in a position to learn valuable information. Woman ninjas were most likely employed as couriers and spies, despite the modern images we now have of female assassins.
Just like any other martial organization, the ninja would have had many rules governing their secret clan. Keeping the identity and tactics of the clan a secret was probably one of the most important rules of all.