The Buddha prefaced his instructions [to Rāhula] with the image of a mirror: Just as you use a mirror to see how you look to other people, Rāhula was to look at his actions to see how he appeared in the eyes of the wise. And the wise would have him judge his actions like this:
Whatever he did in thought, word, and deed, he was first to examine his intentions: If he anticipated that the act he planned would cause any harm inside or out, he was not to act on that intention.
If he didn’t anticipate harm, he could go ahead and act. While acting, he was to check the results of his action. If he was causing unanticipated harm, he should stop. If not, he could continue with the action.
After the action was done, he should look at the long-term results of the action. If it turned out that he had caused harm in word or deed, he should talk it over with a trusted friend on the path who would advise him on how to avoid causing that harm again. Then he should resolve not to repeat that action. If his thoughts had caused harm, he should feel shame around that type of thinking and resolve not to repeat it.
If he had caused no harm, though, he should take joy in his progress on the path, and keep on training.
In this way, the Buddha didn’t simply tell Rāhula to cause no harm. Instead, he told him, in effect, “Try not to cause harm, but if you do cause harm, this is how you go about learning from your mistakes.” This shows the element of practical goodwill that pervades these teachings.
This reflection from Ajahn Geoff is from the the book, First Things First, (pdf) pp.15-16.