If you want your ducks to stay safe, you need to make a coop and a pen.
You can also let them free range, but you would need to watch them.
I keep my ducks in a pen and I free range them for 30 minutes and then back in the pen they go.
They actually choose to go back in.