That model assumes that the attack is known as soon as the attackers use it.
This assumes that the AI agent would detect any invalid actions such as for example a user looking at data from another user. At this point one could wonder why you would even write code because shouldn’t you let the AI handle all user requests? Seems a bit far fetched.