PurposeThis paper aims to evaluate the inhibitive action of different concentrations of Sesbania grandiflora leaf extract on the mild steel corrosion in an aggressive HCl medium under different experimental conditions.Design/methodology/approachWeight loss investigation, open-circuit voltage analysis, Tafel polarisation, AC impedance analysis, etc. were used for the evaluation of inhibition efficiency. The influence of immersion period on inhibition efficiency was evaluated. The mechanism of action of the inhibitor is also discussed. Infrared (IR) spectroscopy and energy-dispersive X-ray spectroscopy analysis were used to characterise the passive film.FindingsThe results suggested that 10,000 ppm solution has maximum inhibition efficiency of 98.01 per cent at room temperature, while 1,000 ppm solution also exhibited a better efficiency of about 96.16 per cent. Efficiency of inhibitor solution was found to increase with an increase in its concentration. Polarisation study proposed the solution as an anodic inhibitor. Impedance study confirmed the formation of a protective layer over the surface of the specimen, and the constituents of the film were identified using IR spectroscopy. Stability of the film adsorbed on the steel was cleared from the steady open-circuit potential value. Study on action of the inhibitor under accelerated conditions revealed the fact that the efficiency of extract in preventing corrosion is good under stimulated conditions also.Practical implicationsThe action of inhibitor sustains for a sufficient time period and could sustain under stimulated conditions. Hence, its application is practically possible in industries. The proposed inhibitor is widely available and is environmentally safe.Originality/valueHCl is an industrially important chemical used for acid cleaning, acid pickling, etc. HCl was used as an aggressive corrosion environment. As the chances for mild steel to be in contact with HCl were very high, it was important to develop an efficient, economical and eco-friendly inhibitor for corrosion.