Assange, who initially moved into London's Ecuadorian embassy five years ago to avoid arrest over now-dropped Swedish rape charges, angered Madrid after addressing hundreds of people in Barcelona via video link in September.
"The Ecuadorian authorities have reiterated to Mr Assange his obligation not to make statements or activities that could affect Ecuador's international relations, which must be preserved, as is the case with Spain," the foreign ministry said in a statement.
It added Assange "has formally committed to observe behavior that is compatible with the will of the Ecuadorian state."
Although Swedish prosecutors dropped their rape probe, Assange, who denied all allegations, remains in the embassy over fears he will be extradited to the United States and put on trial for WikiLeaks publishing leaked secret US military documents and diplomatic cables in 2010.
But, when asked in May if arresting Assange was a "priority" for Washington, US Attorney General Jeff Sessions said that "we will seek to put some people in jail."
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)
Get the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections.