Just get a shotgun or six shot revolver. That is really all you needPeople claim this all the time, but I keep a handgun for that. I can't imagine using an AR in close quarters like that and trying to be sneaky and mobile.
I have rifles for hunting, and I'll probably get a shotgun too, but for keeping close by for intruders I can't see the hype.
I'm definitely getting one after I buy these cows though.