Security device of a shape endlessly variable (4)
I believe the answer is:
hasp
'security device' is the definition.
(I've seen this in another clue)
'a shape endlessly variable' is the wordplay.
'endlessly' means to remove the last letter.
'variable' is an anagram indicator (a varied form of the letters).
'shape' with its last letter taken away is 'shap'.
'shap' with letters rearranged gives 'HASP'.
'of' acts as a link.
(Other definitions for hasp that I've seen before include "Hinged metal fastener" , "Hinged fastening" , "Fastening plate, clasp" , "catch" , "Hinged fastener for door or lid" .)