Brings up a question: what is the chance of blaming some of this on an "innocent" coding error? Can you get jail for not writing unit tests, swallowing an exception, a type conversion you did not expect?
Zero Chance. Singh already proved intent with his source code comment. Him claiming to be unaware of violating the law won't prevent him from getting almost certainly jailed.
> The Underhanded C Contest is an annual contest to write innocent-looking C code implementing malicious behavior. In this contest you must write C code that is as readable, clear, innocent and straightforward as possible, and yet it must fail to perform at its apparent function. To be more specific, it should perform some specific underhanded task that will not be detected by examining the source code.
> Every year, we will propose a challenge to coders to solve a simple data processing problem, but with covert malicious behavior. Examples include miscounting votes, shaving money from financial transactions, or leaking information to an eavesdropper. The main goal, however, is to write source code that easily passes visual inspection by other programmers.
I believe that really depends on (a) how much harm it caused downstream, (b) how much of it is caused by your actions. Per Matt Levine's column today, it's not the whole problem that FTX had sloppy accounting – rather that SBF went around advertising the "sophisticated risk engine" which in reality was crap. This action accounts for fraud.
I don't see you being jailed for your random GitHub project being sloppy. However, if your closed source software that you advertise as 100% safe and secure gets used by a chemotherapy clinic, and then it comes out to be downright sloppy after killing 20 patients you may be accused of fraud. Anyway, not a lawyer so take it with a grain of salt.
I hope it also depends on a reasonable expectation of oversight and access controls when you're working in high-risk fields. Finance engineers should probably be expected to be familiar with laws concerning what they do.