So you have built a compost and your helping to save the planet. You have even got some material to add to the pile, but as you approach the compost area rats scatter and run everywhere. What is the safest way to get rid of rats in compost?
You can try the old stand-by and use mouse traps. But that can be a bit unsanitary. Plus the bait that is in mouse traps can also attract household pets such as cats and dogs. Same problems with poison and you really do not want that type of item anywhere near your compost pile.
Next you could just let the cats take care of the rats. But the problem develops of cat droppings in and around your compost area. Cat droppings may contain chemicals from the food they eat and the medicine they receive.
Now this next idea is a bit out there and is certainly not for everyone. Chickens love to eat rats and they will turn the compost for you, that is just one more thing you do not have to do.
Now the chicken idea is really only a rural option, if you live in or close to the city that option may not be available to you.
You could use the bucket plan. Use a 5 gallon bucket with some bait in it, set it near the bin on the ground. Once a mouse gets in the bucket it is really tough for them to get out. Then you need to do away with the rats.
There is really no simple way to get rid of rats in compost. You will just need to choose your best option.