Prime Minister Theresa May has been holding talks with Labour leader Jeremy Corbyn in an attempt to reach a compromise deal to break the Brexit deadlock.
Mr Corbyn wants a customs union to be part of a deal and he is also under pressure from his party to insist on a second referendum on any agreement
However, Ian Blackford MP said that Labour should be “very careful” as any future government would not be bound by what was agreed by a previous one.
Earlier, Commons Leader Andrea Leadsom told the Andrew Marr show: “No government binds the hands of a future government.”
Mr Blackford warned that if someone like Boris Johnson were to become prime minister, the risk of a hard Brexit would be “very real”.
He told BBC Sunday Politics Scotland: “I would say to colleagues in the Labour Party be very careful because if you do allow this deal to get through, and we know that Theresa May is going to go, you could end up with someone like Boris Johnson as prime minister and quite frankly he can come along with any legislation that he chooses to do so.
“There are no guarantees through this process, and the risk of having a hard Brexit, having Scotland being outwith not just the single market and the customs union, would be very real, and I would say to Labour don’t do this, be very careful with what you are doing or quite simply you will pay a price at the ballot box in Scotland.”
Mr Blackford said the Prime Minister is asking Mr Corbyn to effectively be the “midwife of Brexit” and to rule out free movement of people.
He urged both parties to be very careful because free movement of people is “absolutely essential” to Scotland to deliver growth in its economy.
A Labour spokesman said: “The Prime Minister hasn’t moved on her red lines and there hasn’t been much compromise from the Tories.
“Labour is still working to find a solution that avoids a disastrous no-deal Brexit.”