Treaty of Algeron
The Treaty of Algeron is an agreement between the United Federation of Planets and the Romulan Star Empire that somehow "keeps the peace" between the two powers, who presumably negotiated it following the events of "The Enterprise Incident" (TOS).
Under the terms of the treaty, the Federation may not develop or deploy cloaking technology, resulting in a significant tactical disadvantage for Federation starships. What the Romulans gave up in return (if anything) remains unclear.
In 2371, the Romulans agreed to loan one of their own cloaking devices to the Federation and installed it on the USS Defiant. It's use was to be restricted to the Gamma Quadrant under Romulan supervision. In return, the Federation agreed to share all intelligence that the ship acquired in the Gamma Quadrant.
During the Dominion War, the Federation deployed a field of cloaked, self-replicating mines to block access to the Bajoran Wormhole. It is unclear whether this event required another special dispensation from the Romulans or the Treaty only applies to starships and other crewed vehicles.
Treaty of Algeron at Memory Alpha