An armed drone circling and running an area-denial program meets your stated criteria - at least until it gets a recall message or runs out of fuel.
Swarms of such drones have been tested in simulations (and probably in live field actions too)
Stationary robot sentry guns also been tested in Korea, which can automatically track human or vehicle shapes and fire on them after they get a "weapons free" message.
Mobile vehicles with similar capabilities were tested in Saudi Arabia - about 20 years ago. They broke down a lot in the trials and were eventually scrapped. But a lot of technology improvements have become available since then.
Urgent pleas to lock the barn door after the horse has already left are somewhat ineffective.
They trust a drone to fire on people without confirmation.