AI Agents Are Getting Better at Writing Code—and Hacking It as Well