In Person Of Interest, Harold designs an AI that can predict crime and terrorism. He "locks down" the machine because he cannot foresee the consequences of its growing intelligence and because he wants to prevent any human from exploiting it for malicious ends.
But, in series 5, the machine is reassembled after being attacked by Samaritan (the evil AI) but it is reassembled as an open system and it performs well to protect Harold and his friends.
In S5E10 Harold choses to close the system again.
Why does he do this when it has been so useful to have an open system?