What if they claim to be a citizen but lost their passport? Or claim genuine asylum? Nope, doesn't work, migrants are already playing that game.
What would you have the military do? It isn't possible to intercept every ship at sea, and you'd rule out shooting them so what, going to try to crash...