What kind of contract should be signed to jointly develop patents with the company to ensure the rights and interests?

If you are an employee of the company, you have made inventions to complete the tasks assigned by the company, and the patent application right belongs to the company, then you are an inventor.

If you are not an employee of the company, but cooperate with the company in your personal capacity, it is suggested that when you cooperate with the company, you add an "intellectual property ownership" clause in the contract to clarify who owns all the intellectual property rights developed, either directly or jointly with the company.