Khamenei said he had approved the decision of Iran's top security committee, the Supreme National Security Council, to implement the deal but it must be "tightly controlled" and monitored "to prevent significant damage".
His remarks came in a letter to President Hassan Rouhani, a moderate who was elected in 2013 having promised to end the more than decade-long international dispute about Iran's nuclear programme.
Iran has always denied pursuing an atomic weapon but Western intelligence agencies alleged that work to develop a bomb had taken place.
"In the absence of tight control these could bring significant damage for the present and the future of the country," he said.
Also Read
The deal, once implemented, will lift all nuclear-related international sanctions against Iran, in return for stringent curbs on its nuclear programme, including its enrichment of uranium.
The main provisions of the agreement, known as the Joint Comprehensive Plan of Action (JCPOA), extend for between eight to 15 years.
If this occurs "under any pretext by any country engaged in negotiations, it will be a violation of the JCPOA and the government will be obligated to stop the agreement," the 76-year-old leader said.
On Sunday, US President Barack Obama and the European Union announced measures to ensure the lifting of sanctions, including those on Iran's banks and energy sector, as soon as international monitors have closed a probe into possible military dimensions of Tehran's past nuclear activities.