Generally, ideas cannot be protected. While confidentiality and nondisclosure agreements can take you some of the way, they are not always airtight.
Also, depending on how such an agreement is worded, a little change here and there to your idea could change it from "your idea" to "their idea" -- and cut you out of the loop.
You’ll want to speak to an intellectual property attorney who understand software deals to get good sense of your options and the strategy that can best protect you.