This is quite normal in the contract business if the agency sourced you and you knew what you signed up to.
Generally, you can buy yourself out of it, depends on how long you have been with them and how well things are going. - Ask the airline to do it, they will if they really want to keep you.
With my direct contract with airline, I am not even allowed to work as a pilot !! within one year after leaving them, and this is perfectly legal in this EU country!
Obviously there are ways, but don't want to go there...