Library ninjutsu ability can be activated only while you’re searching your own library and only if you control at least one unblocked attacker. The effect that caused you to search needs to say “search” and “library”. Examples of effects that let you activate library ninjutsu are Primal Growth and Buried Alive. Examples of effects that don’t are Bribery and Halimar Depths.