Ensure the people who would be massacred have the means to defend themselves.
A person’s self interest is more reliable than rules and treaties. A weapon in a person’s hands makes it impossible to hurt that person without yourself being hurt.
This is why after thousands of years of bloodshed and injustice, some very concerned thinkers decided it is a human right to be armed.