Dan Kitwood/Getty Images
Cameron had to work really hard to get the rest of the EU to agree to the emergency brake, and he is going to be using the fact that he got that agreement to argue for Britain to stay in the EU. If it starts to look like the European Court of Justice would say it isn't legal to restrict EU migrants' access to in-work benefits, if would severely weaken Cameron's argument for remaining in the EU.
Writing on his blog EULawAnalysis, Steve Peers, a professor in EU law at the University of Essex, claims that while the European Union Court of Justice might accept that the emergency brake does not violate current EU treaties, "as EU law currently stands, that is probably a long shot."
However, not everyone agrees. President of the European Commission Jean-Claude Juncker who helped Cameron secure the deal said that he believes the emergency brake is legal, because "it respects basic principles of Treaties."