Who would enforce such a treaty would be a de-facto global government. Literally the thought police.
Just as it is with firearms, don't blame the tool. Humans exercise ultimate control over that tool.