I tried to like this game, I really did, but what is even the point of guarding the entrances to my base if enemy agents can just literally pop out of holes in the ground behind my defenses?
I can't keep my gens safe, my guards can't build up their numbers because they're constantly battling intruders, and the game has stopped being fun.
Agents only pop out of holes in the ground if you have a part of your base that is completely inaccessible to everyone. E.g. you have placed lockers, or a few generators (these are usually the cause), or whatever in such a way that there is an empty space somewhere that no one can get to legitimately without destroying one or more objects.
In those cases, the game likes to troll the player - for wasting precious floor space, or something? At any rate, that part of your base will feature an endless stream of agents popping out of the ground and fighting their way out.
It's easy enough to avoid once you know that this is a thing. So just make certain that everywhere is reachable that should be reachable.
BTW apart from stopping agents popping out of the ground, having things reachable means your minions can also reach them to put out fires or repair them, if required.
Once you sort this out, you'll hopefully enjoy the game much more - soon enough you'll unlock enough traps to be able to either kill agents, or even better confuse them indefinitely.
While I'm on the subject, note that there's a hidden "threat" value that agents have, this I believe is per continent/organisation and I don't think it can ever be lowered, only raised. It goes up whenever you do something violent against them, and is in addition to the increase in threat level you get for their agents not making it back alive. It's insidious since it's affects don't become apparent until much, much later - but at some point, even low-level agents from that continent will be ready to attack over nothing, to the point that they'll start shooting at harmless objects such as storage lockers (which have no heat, so wouldn't normally be targets). At that point all you can do is get more and more violent - which is fun, but makes base management more annoying. So to avoid that, just go nuts on non-violent means (although knocking them unconscious and torturing them a few times in a smarts or attention draining device is fine - and fun - and can be useful since it's possible for them to leave in such a good mood that your heat is actually lowered).