Told liable for cost off training by agency if I leave?

If they have no work for you why are you with them? Time to move on.As for the legality of what they are doing,it depends what you have signed but they sound like a bunch of [insert appropriate swear word] go and find something else!