Should a deal not be agreed with the EU then international (WTO) rules will apply to future trade, but it is quite possible to smooth the changes implied to give time for the UK to adapt.
On 19 January this year BrexitCentral published an article by David Campbell Bannerman, who was an active MEP for nearly ten years.
Campbell Bannerman argues that “there is a way forward for the Government which allows a smooth transition into a No Deal scenario…and then allows the UK to negotiate its desired comprehensive Free Trade Agreement with the EU without having to impose tariffs or quotas in the interim. There is a mechanism to ‘manage’ a No Deal scenario; one that works within existing WTO rules”. 
Bannerman is referring to GATT24 which permits countries to avoid the Most Favoured Nation (MFN) requirement if they are in the process of negotiating a free trade agreement. (The General Agreement on Tariffs and Trade, GATT, preceded the World Trade Organisation, WTO, and its requirements were carried over.)  So there is a way of continuing to trade without tariffs on goods after the UK leaves the EU and Single Market that doesn’t require dropping tariffs to all other WTO nations under MFN (most favoured nation) rules. A single-page document is all that’s necessary, not another 545 pages (see A Withdrawal Agreement), provided both sides agree.  Mark Carney, Liam Fox and other luminaries have ridiculed Boris Johnson for suggesting it, they should turn their mockery on the EU.
If the EU were to refuse a GATT24 process because a deal can’t be reached by October 31st this year then it would be responsible for undermining the Belfast Agreement, not the UK. It would be responsible for wrecking the Irish economy, not the UK. It would be responsible for damaging several Continental industries such as Spanish tomatoes, German cars and French wine; the UK would not accept blame for such outcomes. 
So it takes two to apply GATT24 in this way but if the EU refuses to tango it might be possible to invoke a unilateral reason for avoiding WTO rules. What we have in mind is zero tariffs on EU goods without triggering MFN elsewhere on security grounds and letting the EU do what it likes, including tariffs and border checks. The rules are very vague and Donald Trump uses or threatens tariff impositions on security grounds against Iran, China and the EU. The USA is a superpower and throws its weight around even without such an erratic president in charge. Other cases have been about unilaterally imposing tariffs but perhaps the reverse can apply to the Irish border problem. Why not? The ‘rules’ are unclear and untested and if contested would take quite a while to settle (a transition period!)
Other countries use devious methods to protect their interests or to gain time (the EU is adept at this) and the UK should not be over scrupulous or legalistic in facing an implacable and aggressive adversary. If the Swiss can retaliate, why shouldn’t the UK?
In 1975 Sweden (yes, law-abiding Sweden) imposed an import quota on certain footwear, claiming that it had to maintain its own industry or its soldiers might not be able to march if foreign supplies were cut off. Sweden claimed that:
“[D]ecrease in domestic production had become a critical threat to the emergency planning of Sweden’s economic defence… The policy necessitates the maintenance of a minimum domestic production capacity in vital industries. Such a capacity is indispensable in order to secure the provision of essential products necessary to meet basic needs in case of war or other emergency in international relations.” (Campbell Bannerman)
This would probably have been a bit much for the GATT Council to approve so in 1977 Sweden revoked the measure itself. But this did amount to a ‘transition’, or at least an interregnum, so there is a precedent for such a subterfuge to avoid a post-Brexit ‘cliff edge’ should it be needed, especially where the threat of renewed terrorism could plausibly be invoked.
In 2005 ResearchGate published a report  discussing the implications of this vague GATT article. We offer a few quotations from their research:
“The drafters of Article XXI understood the extremely broad scope of the exceptions they were creating. The debates on the ITO Charter reveal concern about the critical balance required between national security and national sovereignty on the one hand, and the need to promote commerce and to protect an open trading system on the other. One of the drafters of the original ITO Charter described the care that the Contracting Parties took in fashioning this critical exception:
We gave a good deal of thought to the question of the security exception, which we thought should be included in the Charter. We recognized that there was a great danger of having too wide an exception and we could not put it into the Charter, simply by saying: ”by any member [sic] of measures relating to a Member’s security interests,” because that would permit anything under the sun. Therefore we thought it well to draft provisions which would take care of real security interests and, at the same time, so far as we could, to limit the exception so as to prevent the adoption of protection for maintaining industries under every conceivable circumstance… [T]here must be some latitude here for security measures. It is really a question of balance. We have got to have some exceptions. We cannot make it too tight, because we cannot prohibit measures which are needed purely for security reasons. On the other hand, we cannot make it so broad that, under the guise of security, countries will put on measures, which really have a commercial purpose.
“Nothing in this Agreement shall be construed to:… (c) prevent any action in pursuance of its obligations under the United Nations Charter for the maintenance of international peace and security.“
“One of the most influential GATT experts, Professor John Jackson, has argued that Article XXI is “so broad, self-judging, and ambiguous that it obviously can be abused. It has even been claimed that maintenance of shoe production qualifies for the exception because an army must have shoes!” 
 This and GATT (26/03/2019)
 WOT, no Trade Deals? (21/04/2017)
 “All you need is love” (27/03/2017)
 WTO rules – OK? (18/11/2016)