The failsafe to this is a big button that requires manual operation.
The big button triggers a spray that kills humans but only annoys the aliens.
Rather than, I don't know, explosive collars that trigger when they leave their pens.
Known criminals are allowed to take residence upon a research vessel.
Said criminals fail weapons scans but are given a pass to board.
This is all within the first half hour of the film. Starting at the end and scripting your way backwards may work for mysteries, but it does not work for action movies. Such a waste of the talent they recruited.