Before long, as the ritsuryo system became more relaxed after the mid-Heian period, with the Sekkan seiji (politics run by the sessho and kanpaku) and the shoen (manor) system becoming widespread, a custom developed in which 'illegal onmyoji,' who were not bureaucrats that belonged officially to the Onmyoryo, openly violated the ritsuryo by privately getting close to noblemen, starting what became a common practice of them secretly performing divinations to judge good and bad luck or ceremonies to prevent disasters; in some cases, people would even contract them to cast a spell to kill an adversary.
やがて平安時代中期以降に、摂関政治や荘園制が蔓延して律令体制がさらに緩むと、堂々と律令の禁を破って、正式な陰陽寮所属の官人ではない「ヤミ陰陽師」が私的に貴族らと結びつき、彼らの吉凶を占ったり災害を祓うための祭祓を密かに執り行い、場合によっては敵対者の呪殺まで請け負うような風習が横行した。