https://en.wikipedia.org/wiki/Jus_gentium
https://en.wikipedia.org/wiki/Hostis_humani_generis
It works in the same manner as unwritten common law does - set by custom and precedent.