An antonym of a word has the opposite meaning. So, an antonym of dangerous would be safe.
"Following the impulse, he rushed after the car"
Reaction
aversion
The Enterprise was on on impulse power only.
pulse what makes sence in the word
Patient
Planned
The word that means a fanciful notion or impulse is whimor whimsy. An antonym for whimsy would be seriousness or deliberation.
If you stick to items on your grocery list, you'll avoid impulse purchases.
An impulse is a sudden strong urge or desire to act on a whim, often without careful thought or consideration. It is important to carefully evaluate our impulses before acting on them to avoid potential consequences.
Her impulse to shop was starting to take over her whole life. Another good sentence would be, she had a sudden impulse to buy the expensive purse.