I want to prevent military, policing, and surveillance companies from using my open source code in their projects, through a custom permissive license. Of course, I can't tell the military itself what it can and cannot do. So I think terms such as "this may NOT be used for military or surveillance applications" are pretty pointless.
Would I be better protected with a statement like "This code may be used for all projects, private and commercial, except when used for ______ purpose, in which case a one-time fee of 5,000,000 USD will be immediately due."?
My theory is that it outlines a path for such organizations to still use it, even if that path is so expensive no rational organization would take it, and acts as a good damages baseline should I ever have to take any such an organization to court.
edit: I'm not interested in money and would actually like to avoid mentioning it at all, I'm just trying to lay out the correct legalese to prevent such entities from using my work. If it's enough to define said entities and say "May NOT use this" I'm happy with that.