The ruling on penal conditions
They are permissible in particular circumstances, such as a contract with a contractor that stipulates that if he is late in handing over the goods, his contract will be cancelled, or stipulating deductions and the like, or termination of the contract, in the event of violations when making contracts with teachers or employees.
Reference: Abd al-Razzaq Afifi: Fatawa: 212/1