That's already in the legislation.
I think you should look at the history of the MV Sun Sea cases. Those people were detained for months while there were investigations as to who they were, while there were background checks done to determine if they were security threats. The immigration division is your best front-line defence against people getting out if they are a risk to anybody. It doesn't let them out.