Library image showing an aerial view of Gibraltar (Picture: MOD).
Prime Minister Theresa May said the UK's position on Gibraltar had not changed and she would always "stand by" its citizens.
Britain has agreed to future talks with Spain on Gibraltar after it threatened to block EU approval of the Brexit deal.
Spanish Prime Minister Pedro Sanchez had demanded further guarantees for Madrid over the status of Gibraltar.
A letter from the UK's ambassador to the EU, Sir Tim Barrow, confirmed the Withdrawal Agreement imposes no obligations regarding the "territorial scope" of future agreements.
It also makes clear the UK will negotiate future agreements on behalf of all territories for whose external relations it is responsible - including Gibraltar.
Gibraltar's government says the agreement represents an "unwavering" British commitment.
A UK Government spokesman said:
"For the withdrawal negotiations, given there are some circumstances which are specific to Gibraltar, we held talks with Spain which directly involved the government of Gibraltar.
"These were constructive and we look forward to taking the same approach to the future relationship."
Mr Sanchez said, "this is going to allow us to have direct negotiations with the UK regarding Gibraltar".