Define model attribute as read only

Hi all, I’m trying to find a way to make an attribute/property of my model read only. Is there any way to do so out of the lifecycle or the field view configuration.
I would like to have this setting stored in the model definition file, so we can keep track of it with git. I can see that other options are to make the view configuration change but this gets stored in DB, or to have the ability to prevent the update during life cycle, but this would give the users the impression a field is editable.

Thanks in advance.

Did you try to disable its editing by disabling it on the layout configuration panel?