is H1B Bond or agreement legal in India and USA?

One of the consultants asked to pay $5000 to process new H1B and signed a bond of $20,000 to join and work at least one year. In case if we fail to join or work atleast one year. need to pay $20,000 or actual cost whichever is higher.They are already charging $5000 to process VISA then such kind of bond. So If I do not join them or transfer to another company, will there be any implication?The sample bond looks like below. XXX is company name.I reside at with Social security number have applied for a suitable position with XXXincorporated in , having their offices at XXX, USA.I have also requested a H1B sponsorship which to work in the USA.I understand that my selection at XXX is subject to the H1 B approval andXXX does not guarantee either approval, lottery pick up or job without approval.I understand that XXX has already invested their time and efforts to hire me and alsowilling to invest for the H1 B and H1 B amendments whenever necessary.I understand that XXX will incur heavy loss if I do not join them or not able to work withthem at least for 12 months from the project start date…In the event that I am not in a position to join XXX after the approval or not able to workfor 12 months continuous in project service, with or without any reasons, considering the time,efforts and money that XXX would have invested on me, I hereby agree to repay the cost ofthe H1 B and H1 B amendment cost involved and any miscellaneous expenses incurred to thetune of $20,000 or the actual expenses whichever is higher.I also understand that If I do not pay the expenses or does not work for 12 months, XXXmay take legal action against me.Candidate Sign:Name:Address:Date

The bond can’t be upheld in a US court of law - employer restrictions on employee movement within labor market for fair wages and fair workplace is prohibited by law and is a punishable offense. Employer may demand cash from you for the losses they incurred in applying for your visa; however it is your choice to pay or decline. If they sue, you can countersue. I am not sure about India though - except that if the Indian company is a subsidiary of US company, then it is governed by US law. They can’t bypass law by simply trying to collect cash from you from India end just because it is illegal to do so in the US.