They provide security when an officer is imprisoned by soldiers (5)
I believe the answer is:
gilts
'they provide security' is the definition.
The definition suggests an adverb but the answer is not.
'an officer is imprisoned by soldiers' is the wordplay.
'an officer' becomes 'lt' (abbreviation for lieutenant).
'is imprisoned by' indicates putting letters inside.
'soldiers' becomes 'gis' (GI is an informal term for a US soldier).
'lt' going within 'gis' is 'GILTS'.
'when' acts as a link.
Can you help me to learn more?
(Other definitions for gilts that I've seen before include "Government fixed-interest securities -- young sows" , "UK government fixed-interest loan securities" , "Reliable stocks" .)