Before filing a patent, an inventor should not commercialize the invention and should keep it secret. Discussion of a patent with a patent attorney is attorney-client privileged. Therefore, the disclosure of an invention to a patent attorney does not make the invention unpatentable.
California evidence code has an expansive view of the
attorney-client privilege that begins before the retainer agreement is actually
signed.
Cal. Evid. Code 950.
As used in this article, "lawyer" means a person authorized,
or reasonably believed by the client to be authorized, to practice law in any
state or nation.
Cal. Evid. Code 951.
As used in this article, "client" means a person who, directly
or through an authorized representative, consults a lawyer for the purpose of
retaining the lawyer or securing legal service or advice from him in his
professional capacity
Cal. Evid. Code 954.
Subject to Section 912 and except as otherwise provided in this article,
the client, whether or not a party, has a privilege to refuse to disclose, and
to prevent another from disclosing, a confidential communication between client
and lawyer...
Commercializing or publicly disclosing an invention before filing can destroy patent rights. In the United States, the inventor’s own disclosure, sale or offer for sale starts a one-year grace period (35 U.S.C. § 102(b)(1)); if the application is filed after that year, the U.S. patent is barred. Many other countries, including the member states of the European Patent Convention, require absolute novelty, and China allows only narrow exceptions, so a disclosure before filing can forfeit rights there entirely. The safest course is to file first.