When she first appeared she was in a camp controlled and administered by Kurdish, virulently anti-IS groups in an area where IS were completely defeated. The IS people were very definitely under control - she was, as far as HMG was concerned, secure. Unfortunately, several years on and the situation has changed - IS structures have effectively taken control of the internal management of the camps, though they are still in Kurdish controlled territory, IS have very much reasserted themselves as an insurgent/terrorist group in the wider area.
HMG is pursuing a less than perfect policy because there are no perfect policies available.