If the source code of the program is given as text in the question, is it acceptable to post these sorts of puzzle on the site? Users would then need to copy and paste the code, however they can see what they are copying before they run it.
At Programming Puzzles & Code Golf, where code golf puzzles revolve around providing code snippets and (ideally) making them safely runnable, users post their code on sites which can run the code in their own (sandboxed) environment - so users can read the code, and then go to the site where it's also hosted to "run it in their browser" and see what it does.
If code is an important part of a puzzle, and it's not better suited for PPCG, then I'd suggest the code be handled the same way PPCG does. This avoids leaving it to Puzzling users to download and run essentially random code of unknown provenance on their own systems—a practice I think we are very right to discourage.