Until and unless a patent is issued, the inventor has no exclusive rights. Assuming a patent is granted, the issued claims will be what defines infringement. What you do before the patent is issued is not infringement since there is nothing to infringe.
However, if there is a finding of infringement in the U.S. for activity after a patent is issued, the patent owner can possibly also get royalties for activities you engaged in (in the U.S.) before the patent was issued under 35 U.S.C. § 154(d). This ABA article explains its effect in practice. The rights the patentee has in this regard are called "provisional rights". Nothing at all to do with provisional applications.
In the U.S., once a patent application is published, someone who does something that would infringe a hypothetical future patent with claims very similar to the published claims and who is on notice of the publication, can be subject to future royalties. If the issued claims are quite different from the published claims, this law does not apply.
As mentioned in the ABA article this was put in place by Congress when the 18 month publication requirement went in. That was part of an international treaty that has the U.S. conform to the publication regimen the rest of the world had been doing. Prior to that treaty U.S. patent applications were confidential up to the day of grant. If an applicant decided the allowed claims were not worth the disclosure, they could abandon the patent application and opt to keep it a trade secret instead. This is still possible by asserting, in a non-publication request, to the USPTO that no filing outside the U.S. will be made.