It's interesting that you worded that question differently in your title and post because I certainly see people take credit when it works, but blame the AI when it fails.
Well the person obviously, the person who created and implemented the agent, algorithm, program or other system should be blamed if things go wrong. By the same token if things go well then they should get the credit.