the good oaths
If someone swears an oath to do good, or to avoid hostility, that oath is something good.
If a person protects a fellow Muslim from losing wealth, or saves them from harm, by using a truthful or even false oath to stop a wrongdoer, then that oath is also counted as something good.
If someone speaks good things but people won't believe them unless they swear an oath, then their oath is considered good.
Allah says: "Say: Yes, by my Lord, it is indeed the truth, and you cannot escape it." (Surah Yunus: 53 and Ath-Thaghabun: 7)
(from Syajaratul Ma‘arif, Syaikh al-‘Izz bin Abdus Salam)