Freedom of speech in Parliament is a key element of parliamentary privilege, and is enshrined in law by article 9 of the Bill of Rights of 1689.
It means MPs and Members of the House of Lords have immunity from being found in contempt of court for what they say or do during proceedings in