Inverse = better. Enact products liability legislation that holds software and hardware makers financially liable to damages due to defects in their products and watch the attack surface available to state and non-state actors shrink demonstrably.
Not only will more secure solutions be engineered, but greater resources will be expended by companies like Microsoft, Apple, Cisco, etc. on UI's, educational efforts, and features that enhance security.
There is no stopping a state actor through treaty. Its unrealistic and will cause compliant countries to unilaterally disarm at the expense of non-compliant actors (eg. Assad chemical weapons use in Syria).