There are two overriding constraints on the behaviour of senior civil servants. First, the Armstrong Memorandum makes it clear that "Civil servants are servants of the Crown. For all practical purposes the Crown in this context means and is represented by the Government of the day. ... The Civil Service as such has no constitutional personality or responsibility separate from the duly constituted Government of the day. It is there to provide the Government of the day with advice on the formulation of the policies of the Government, to assist in carrying out the decisions of the Government, and to manage and deliver the services for which the Government is responsible."
Nevertheless, and pulling the other way, the second key rule is that those UK civil servants who work closely with Ministers must maintain strict political impartiality, not least in the weeks before a general election or national referendum. This note summarises the rules that they must follow during these periods.
The guidance issued by the Cabinet Secretary before the 2016 EU Referendum is here. Note, however, that he made it clear (when being interrogated by the (largely Eurosceptic) Public Administration Select Committee) that civil servants would continue to provide easily available factual material for all Ministers, even if such facts might be used to attack the Government's position. But civil servants could not provide briefing and speech material that supporting the 'Out' position.
(Further information about our Westminster Model of Government is here.)
(The term ‘purdah’ is often used, unofficially, to describe the period immediately after the dissolution of Parliament before an election or referendum when there are additional restrictions on the activity of civil servants. More literally, it is also called the ‘pre-election period’. The term comes from the Urdu and Persian words for veil or curtain, also used to describe the practice of screening women from men or strangers. Its English usage accordingly suggests Whitehall drawing a veil over itself and cutting itself off as far as possible.)
Civil servants are allowed to provide Ministers with facts which might be used in political speeches etc., and are allowed to check Ministers’ political speeches for factual accuracy. They are also allowed to comment on the analysis, costings and proposals contained in documents produced by political organisations, including the Opposition, but must not draft Ministers’ responses to such documents.
Unless it runs for the full extent of a fixed term, Parliament is usually dissolved two or three days after the Prime Minister announces the date of the election. If the Opposition agrees, this allows the completion of important legislation, such as Finance Bills.
MPs cease to be MPs when Parliament is dissolved. Strictly speaking, therefore, all candidates are thereafter on an equal footing. But it is regarded as courteous for Ministers themselves to reply to letters written by MPs before the dissolution, or by former MPs after the dissolution. Private Secretary replies are normally sent to candidates (Government or Opposition) who were not members before the dissolution.
Ministers retain their appointments until the Prime Minister is ready to begin to appoint the next Government.
During the pre-election period, the Government retains its responsibility to govern and Ministers remain in charge of their departments. Essential business must be carried on, but it is customary for Ministers to observe discretion as to initiating any new action of a continuing or long-term nature. Ministers usually try to avoid official engagements because they want to devote the time to campaigning. But they are free to undertake engagements they regard as important, although they should seek to avoid giving the impression that they are using such occasions for party political purposes. Similarly, attendance at some international meetings remains necessary. However, before undertaking to fulfil international commitments, Ministers should consider whether the subject matter is such that they can speak with the authority proper to a representative of Her Majesty’s Government.
So far as the handling of correspondence is concerned, the general rule is that citizens’ individual interests should not be prejudiced by the calling of an election. It follows that letters relating to them should be replied to, whether by Ministers or by officials on their behalf. But remember that correspondence may become public and might be used for political purposes. Replies to letters should therefore be as straightforward as possible, should avoid controversy, and, if to a candidate, should not distinguish between candidates of different parties.
All public appointments which might be regarded as politically sensitive should be frozen until after the election and, although routine information activities (i.e. the provision of factual information) continue during the election campaign, other information activities generally cease entirely.
Further detail is in the relevant chapter of The Cabinet Manual and in detailed guidance issued by the Cabinet Office at the beginning of the pre-election period.
Changing the subject slightly, it is interesting (and entertaining) to read Cabinet Secretary Robert Armstrong’s note of the events following the election of a hung parliament in March 1974. This election led to the resignation of Ted Heath's government and the appointment of Harold Wilson as Prime Minister. The document is on the website of the Margaret Thatcher Foundation.