Even legal migration is bad now.
The governments of Europe no longer hold a monopoly of violence. Terror groups and MENAPT groups have brought a diverse range of violent threats to people.
Building a robot army to solve this is one viable solution that is hardware and software based.