A lodger agreement is the document that puts your arrangement on a formal footing. It's the contract between you (the resident landlord) and the person paying to live in your home.
Crucially, this is known as a licence to occupy, and it's a world away from a standard tenancy agreement. This difference is what gives you, the homeowner, far more flexibility and control when you're sharing your property.