You could say, "I was possessed by the Devil."
Demonic possession is a common theme in religion and the arts. The word "possessed" is well known and in this usage it would be easily understood to mean you believe that you don't bear personal responsibility for your action.
From the Merriam-Webster dictionary:
possessed (1) : influenced or controlled by something (such as an evil spirit, a passion, or an idea) (2) : mad, crazed
Furthermore, demonic possession has been used as a criminal defense in court cases. Here's one example.
When Johnson’s trial came, his defense attorney, Martin Minnella,
decided to use the alleged demonic possession as an actual legal
defense for his client. It would be the first time in United States
history in which the defense sought to prove innocence by arguing
demonic possession and therefore a lack of personal responsibility. Source