Moldy food is OK to add to your compost pile as long as you’re careful not to spread the mold around. It’s best to bury it deep in the pile and mix it with carbon-rich materials so that it won't be a breeding ground for more mold.