You must keep your invention secret or confidential before any patent application is filed. If enough information is disclosed in public so that someone else could make the inventive technology work, your invention will no longer meet the requirement of novelty because it will have become part of the ‘state of the art’.
If you need to involve others, for example, employees or third parties in the commercialisation of your invention before a patent application is filed, it is vitally important to do so only under an obligation of confidentiality and which restricts the other person from using your invention beyond the agreed purposes.
It is advisable to enter in a Non-Disclosure Agreement (or NDA) with any third party before you disclose any information about your invention to them.
Once the patent application has been filed, it is no longer vital to maintain the confidentiality but it may still be advisable to limit the number of individuals who know how to work your invention especially before the patent application is published.