The Spanish government has until the end of the month to produce a persuasive two-year blueprint of structural reforms in order to qualify for a €100bn (£79bn) eurozone rescue of its distressed banking sector.

A draft memorandum of understanding between Madrid and the eurozone authorities, to be finalised on 20 July and obtained by the Guardian, stipulates that the centre-right government of Mariano Rajoy has to come up with more spending cuts, tax reforms and implementation of labour market changes for the bailout to go ahead.

The draft accord also gives the European commission intrusive rights of scrutiny over the Spanish banking sector, 90% of which is to be subject to the bailout terms in a programme that is to run for 18 months.

"The European commission in liaison with the European Central Bank and the [London-based] European Banking Authority will be granted the right to conduct on-site inspections in any beneficiary financial institutions in order to monitor compliance with the conditions," says the 20-page document.

Eurozone finance ministers, meeting until the early hours of Monday, wrestled over the detail of the Spanish bank aid package, with Rajoy keen to create the impression that the bailout applies solely to the financial sector and comes with no strings attached for government fiscal and economic policy. Given the ongoing recession in Spain and the high cost of borrowing feeding speculation that Madrid may ultimately need a full-blown sovereign rescue, the eurozone gave Rajoy a year's leeway in meeting Brussels' budget targets, confirming that he would have until 2014 to get the deficit to the eurozone benchmark of 3% of gross domestic product. But he has to quickly come up with further policy shifts.

"Spanish authorities should present by end-July a multi-annual budgetary plan for 2013-14, which fully specifies the structural measures that are necessary to achieve the correction of the excessive deficit," the draft states.

The draft agreement fails to specify what rate will be charged for the eurozone loans and also makes no mention of the key point that emerged at the Brussels meeting – who might be liable for eventual losses from the injection of eurozone bailout capital into Spanish banks.

Olli Rehn, the European commissioner for monetary affairs, reiterated on Monday that Spain would not need to supply guarantees for the bailout funds. A recent EU summit decided to try to break the link between weak sovereigns and failing banks by allowing for the direct recapitalisation of banks while bypassing the host country. But the meeting of finance ministers delivered conflicting signals on this.

It remains unclear who will be responsible if the eurozone countries, in the form of the bailout fund, take out equity in Spanish banks and later sell off the shares at a loss.

"As the linkages between the banking sector and the sovereign have increased, a negative feedback loop has emerged. Therefore, restructuring (including, where appropriate, orderly resolution) and recapitalisation of banks is key to mitigating these linkages, increasing confidence, and spurring economic growth," the document says.

The first tranche of €30bn is to be disbursed at the end of the month as Rajoy presents his new policies. The beneficiaries comprising 14 banking groups are split into four categories according to the need for recapitalisation, which is to be determined by October by detailed stress-testing of every individual bank. Toxic assets, mainly accruing from Spain's ruinous property bubble, are to be dumped in a bad bank or "assets management company".

Brussels is to gain substantive say over who survives and which banks need to be wound up, a process likely to take until the end of the year, and Brussels will have the final say on who qualifies for rescue funds, according to the draft.

"The Spanish authorities and the European commission will assess the viability of the banks on the basis of the results of the stress test and the restructuring plans. Banks that are deemed to be non-viable will be resolved in an orderly manner," says the document. "No aid will be provided until a final restructuring or resolution plan has been approved by the European commission."