It's a related but not exact answer to your question. I've recently been through exactly this, my SO moving into a house that I own. I also went down the route of looking for some kind of agreement to protect my property because I'd heard things about 'common law marriage' and how they might have a claim on it one day if something went bad.
I actually spoke to a lawyer who told me cohab agreements were near impossible to enforce and that I shouldn't bother (NB: always get your own legal advice
). I also worried a lot about the sour taste it would add to our exuberant move in together if I forced a sit down to agree terms for if we broke up.
I think I also discovered that common law marriage is a myth so my SO wouldn't actually have any claim if they tried (link at the end).
Just in case though, for additional peace of mind we signed a lodgers agreement and she effectively pays rent which is very purposefully not a direct contribution to the mortgage. I don't know how much more it protects me but thought why not.
Back on common law marriage there's actually a bill languishing somewhere in parliament that might make it a thing, worth keeping an eye on: https://services.parliament.uk/bills/20 ... sbill.html
And a summary from parliament: https://commonslibrary.parliament.uk/re ... s/sn03372/