We're already seeing some automatic exploit discovery. Fuzzing tools plus machine learning turn out to be able to find exploits. That can only get more powerful.
Yeah i recall seeing someone posting about an adaptive fuzzer here, that had produced jpeg images and whatsnot when given some rather generic starting parameters.
Makes me think of Gibson's second novel of the Mirrorshades trilogy, where the opening chapters were about teen being lent an "ICE breaker" supposedly produced by a Soviet military AI.