Answer
The Maastricht Treaty, signed in 1992. The Single European Act had earlier included an environmental-policy criterion, while Lisbon later strengthened parliamentary scrutiny.
💡Read the linked lesson for the applicable scope and exceptions.
https://www.europarl.europa.eu/factsheets/en/sheet/7/the-principle-of-subsidiarity