This is as I heard. At one time the Blessed One was staying in the province of Sāvatthī, in Jeta’s park, at Anathapiṇḍika’s monastery. Then, late at night, a glorious deity, lighting up the entire Jeta’s park, went up to the Blessed One, bowed, stood to one side, and recited this verse:
“Whatever you have shielded the mind from
can’t cause you suffering.
So if one shields the mind from everything,
then they are freed from all suffering.”
The Blessed One:
“No. You need not shield the mind from everything.
When the mind is under control,
you only need to shield the mind
from what is unwholesome.”
Sādhu! Sādhu!! Sādhu!!!