Not necessarily. A non-compete and non-disclosure agreement keeps a specified individual or party from applying for a patent, but it does not prevent them from publicly disclosing the information. Any other individual or party that receives the information has the ability to take the idea or invention to the patent office first and impede your ability to successfully acquire the patent for yourself.
A non-disclosure can act as a good deterrent but doesn’t necessarily protect you. You need to initiate a patent as quickly as possible. Keep in mind that the first one to the gate at the patent office has priority rights.