In addition to the tenancy agreement ("Mietvertrag"), you often have to sign a handover certificate ("Übergabeprotokoll") as well when moving into a new flat. It records the state the flat was in when you took it over. Everything in the flat which is broken must be added to the Übergabeprotokoll. If you move out in the future, the flat will be checked. You must pay for all the damage that isn’t listed in the Übergabeprotokoll.