2,662. An Oath to Perform a Mitzvah
Hilchos Shevuos 5:16
If someone takes an oath to perform a mitzvah and he doesn’t perform it, he isn’t liable for violating an oath of expression. For example, if someone took an oath to wave a lulav, build a succah, give tzedaka or testify for someone if he has information, but he didn’t fulfill that obligation, he’s exempt for violating an oath of expression. This is because an oath of expression only takes effect for something optional, which a person can do or not do as he pleases, as per Leviticus 5:4, “to do bad or to do good.” Therefore, if someone takes an oath to harm another person, such as to hit him, to curse him, to steal from him or to hand him over to a violent person, he is exempt from an oath of expression because he’s obligated not to do these things. The Rambam opines that such a person is, however, liable to lashes for making a vain oath.
Hilchos Shevuos 5:17
If someone takes an oath to self-harm, such as to wound himself, the oath takes effect even though he is not permitted to do such a thing. If he doesn’t harm himself, he’s liable for violating an oath of expression. If he takes an oath to help others in something where he’s able to help, such as to speak to the authorities or to honor him, the oath takes effect. If he violates his oath and doesn’t do what he said, he’s liable for violating an oath of expression.