A security guard Shahabuddin foiled an ATM heist at the State Bank of India ATM on Hongasandra Main Road in Madiwala and nabbed one thief on Sunday.