The Senedd election could be delayed by up to six months as a "final resort" to deal with coronavirus.
Welsh Government ministers will consider introducing legislation in the new year "if the situation after Christmas suggests we will need to do this".
But the first minister said it remained the government's "clear intention to hold the elections on 6 May next year".
A cross-party group on election planning failed to reach a consensus.
Labour, Plaid Cymru and the Liberal Democrats have said they would support delaying the election if the Covid-19 situation "was extremely serious".
But the Conservatives and Brexit Party said other countries had gone to the polls during the pandemic.
Following discussion with party leaders and Welsh Government ministers, First Minister Mark Drakeford announced officials were working on a draft bill that would give the Senedd's presiding officer, or llywydd, the ability to postpone the election for up to six months.
Mr Drakeford said a "super majority" of members of the Senedd - 40 out of 60 - would need to vote in favour "before that power could be exercised".
Speaking in the Senedd, he added: "We are focussed on enabling the election to happen as planned but it would be irresponsible of us not to make plans in case the pandemic is so serious in May of next year where it wouldn't be safe to hold an election.
"I believe we must pursue every option for enabling people to exercise their democratic right in the face of coronavirus."
Paul Davies, the Conservative leader in the Senedd said: "There's no reason why the elections can't take place on 6 May given that Spain, Poland and South Korea held some elections safely during this pandemic."
He added: "I accept that we have to put measures in place to make sure these elections are safe and secure."
Plaid Cymru leader Adam Price said elections around the world including the United States had taken place but it was "reasonable that we in Wales should have the ability to respond to all scenarios that may face us".
Labour backbencher Alun Davies said: "My view is that the elections must take place in May. This place has sat for too long. It has outlived its term and mandate."
Abolish the Assembly MS Mark Reckless said: "There should be an election on 6 May. There should not be legislation to delay it. It is wrong and we should not do it."
Other options include measures to encourage vulnerable voters and others to consider applying for a postal vote and early applications, greater flexibility around the nomination of candidates, postal and proxy voting, and measures to ensure the safe operation of polling stations and count venues.
The election will be the first time 16 and 17-year-olds are able to vote in Wales and also the first poll since the Welsh assembly was renamed the Welsh Parliament.