In a letter to Rouhani, Khamenei, who had the final word on the historic deal struck Tuesday with six powers led by the United States, congratulated Iran's negotiators for "their tireless efforts".
Bringing the talks to a close was a "milestone", Khamenei said, but the agreement requires "careful scrutiny" before it is approved.
Rouhani "must be concerned about possible violation of commitments by the other parties and close paths to it," the leader wrote in the letter, published on his website late Wednesday.
He did not specify which of the six countries -- Britain, China, France, Russia and the United States plus Germany -- he was referring to.
More From This Section
Throughout the almost two years of negotiations that culminated in the landmark agreement, Khamenei often spoke of his distrust of the United States.
US President Barack Obama on Wednesday confronted critics of the agreement, including Israel, saying they were at odds with "99 per cent" of the world and had failed to offer any real alternative.
"If 99 per cent of the world community and the majority of nuclear experts look at this thing and they say this will prevent Iran from getting a nuclear bomb, and you are arguing either that it does not or that even if it does, it's temporary... Then you should have some alternative," Obama said.
Iran has always denied seeking an atomic weapon, insisting its nuclear programme is for peaceful energy and medical purposes only.