A method for locking a prefabs instance from being modified?

A common issue I keep running into is that with my Script Components I'll very often edit on the instance of an entity (in the hierarchy) when I mean to actually edit the prefab (in the project).

Since these are custom components, and I know how to write custom inspectors for them. Is there a way to make the properties only editable on the prefab?

Try using EditorUtility.GetPrefabType();

bool prefab = EditorUtility.GetPrefabType(target) == PrefabType.Prefab;

Then depending on prefab being true or false you can change the custom inspector fields to labels so they cannot be edited. Or simply don't set the result of a field on the object. Something like this:

int fieldResult = EditorGUILayout.IntField( "MyInt", myObject.myInt );
if( prefab )
{
    myObject.myInt = fieldResult;
}