The obligation stems from the ministerial code. Section 4.22 of the Scottish Ministerial Code: 2018 edition states:
Ministers meet many people and organisations and consider a wide range
of views as part of the formulation of Government policy. Meetings on
official business should normally be arranged through Private Offices.
A private secretary or official should be present for all discussions
relating to Government business. Private Offices should arrange for
the basic facts of formal meetings between Ministers and outside
interest groups to be recorded, setting out the reasons for the
meeting, the names of those attending and the interests represented. A
monthly list of engagements carried out by all Ministers is published
three months in arrears.
The next paragraph is also relevant, stating a Minister's obligation to report back to their Private Offices if such a meeting takes place unexpectedly.
If Ministers meet external organisations or individuals and find themselves discussing official business without an official present –
for example at a party conference, social occasion or on holiday – any
significant content (such as substantive issues relating to Government
decisions or contracts) should be passed back to their Private Offices
as soon as possible after the event, who should arrange for the basic
facts of such meetings to be recorded in accordance with paragraph
4.22 above.
However, it is section 4.22 specifically that the Scottish Conservatives, among others, have accused Nicola Sturgeon of breaking. Their dossier entitled The
Sturgeon-Salmond scandal, which accuses Sturgeon of breaching the ministerial code 38 times, states under the heading "Did Sturgeon break Section 4.22":
Sturgeon held five discussions with Salmond throughout the summer of
2018.
There are no records of what was said at those meetings.
Both Salmond and SNP chief executive Peter Murrell have said the meetings
were government, not party business.
Sturgeon spoke to her chief civil
servant about the Salmond meetings in early June.
But six weeks later,
she met Salmond again, without an official present or any record
taken.
In total, she may have breached Section 4.22 up to six times by
meeting Salmond and his former chief of staff on government business,
and concealing the meetings from government officials.
It should be noted that the ministerial code is not legally binding - the code is more what you'd call "guidelines" than actual rules. Chapter 1 of the code, and in particular, section 1.6, makes it clear that Ministers are ultimately accountable to the First Minister, who is "the ultimate judge of the standards of behaviour expected of a Minister and of the appropriate consequences of a breach of those standards".