The law allows a person to apply for bail even when he has not been arrested, but fears arrest in the near future. This type of bail is known as anticipatory bail. The police cannot arrest a person who has an anticipatory bail order.
Anticipatory bail will kick in only when an FIR is filed against you or if the police have come to arrest on the basis of the FIR. It isn’t available in all states; such as Uttar Pradesh.
Often, fake and frivolous cases are filed against other people. This leads to harming of reputation and time of other persons. To avoid such problems, a person, if they have reasons to believe that they may be arrested for a non-bailable offence in the future, can apply for bail in the High Court or the Court of Session even before they are arrested. If the court finds good reasons for this bail application, then the court may allow for bail. When an application for anticipatory bail is finally being heard, it is compulsory for the person applying for this bail to be present before the Court.
The protection provided by this type of bail is only for a limited period and generally till the police have framed the charges against you. However, one can make an application to the High Court to have this period of anticipatory bail extended.