I was wondering the following: Suppose a programmer writes a program that has no license info but does something illegal, never runs the code but puts it to the Github. According to this: What are the "default rights" for the source code on the Internet without license shown? no one except the author can execute the code so the program has not done anything illegal. Has the programmer done anything illegal?

  • So you are not authorizing anyone to copy it and execute it but there is nothing otherwise to prevent it? So, if they do, they are liable to be in copyright trouble with you? – George White Jul 6 '20 at 22:36
  • 1
    If you've written some code that is certain never to be executed, then the code doesn't do anything. It is therefore not possible for it to do something illegal. On the other hand, publishing the code somewhere with a license forbidding others to execute the code probably does not constitute "making sure the code won't ever be executed." – phoog Jul 7 '20 at 0:08
  • 1
    You might put into you thinking that there may be both criminal and civil liabilities involved. It might be negligent or worse to leave a loaded gun around with a note prohibiting its use under penalty of copyright infringement (mixing my metaphors). – George White Jul 7 '20 at 0:49

I do not think your question makes sense. To aid discussion, let me introduce a concrete example.

I think everyone knows that making death threats against the president of the united states is a federal offense.

  • If you write a program that automates the process of sending death threats against the president, have you boken the law? I don't think so. IANAL
  • If you post your code on github, have you broken the law? I doubt it. Can you license the code in any way you want? It's up to you.
  • Are you obligated to tell others that it would probably be a criminal violation to execute the code? I doubt it, but it would be a nice thing to do.
  • If you charge money for the program, do you have any obligations? No clue

I would contend that your program does not do anything illegal. It is the person who choses to run the program that would be doing something illegal.

But when I thought of my example, I was thinking everything is straight forward. The README clearly states it is a program for automating the sending of death threats, the code is straightforward, and when you run the program there is a button that says "Send 500 POTUS death threats".

But what if the program was marketed as generate AI kitten photos, code was obsfuscated, and the button said "Cute Kitten Photo"?

  • Along the lines of this non-answer - I think it might be illegal to leave a loaded shotgun in a first grade class - now picture the same shotgun with a note that says - "this is my shotgun and I forbid anyone from touching it". – George White Jul 6 '20 at 22:55
  • @GeorgeWhite I do not see how that is relevant. It is (or should) be illegal to leave a gun unsecured in a class room whether or not a note is attached. But I don't see the problem with leaving an instruction manual for building your own gun; or a gun catalog to purchase a gun. – emory Jul 6 '20 at 22:59
  • 2
    Doing something for which the only purpose is to perform an illegal act, or possession of property whose only purpose is to assist an illegal act, is itself also a crime in many cases. Mere possession of utensils for drug use or a lockpicking kit is sufficient for prosecution in many jurisdictions, for example. – Nij Jul 7 '20 at 0:12
  • 1
    @emory - I interpreted your non-detailed example to mean executing the code directly caused a crime to be committed. That is nothing like plans for a gun. Also, if you have a non-answer in the future please post it as a comment not an answer. – George White Jul 7 '20 at 0:33

Not the answer you're looking for? Browse other questions tagged or ask your own question.