Attacks and isn't blocked
From the glossary of the Comprehensive Rules (June 7, 2024—Modern Horizons 3)
- Attacks and Isn’t Blocked
- An ability that triggers when a creature “attacks and isn’t blocked” triggers when the creature becomes an unblocked attacking creature. See rule 509.1h.
The ninjutsu ability can be activated when a creature attacks and isn't blocked.