The answer is thrust termination device .
Drdo took some time to perfect it
Solid fuel rocket motors cannot stop combustion ( producing thrust ) once started, they employ an alternative means to negate the thrust . This is done via thrust termination device included with advanced solid fuel rocket motors , which allows to negate the ongoing thrust being produced inorder to allow staging or separation of PBV to occur safely and importantly control range and corresponding trajectory . More more details try Google.
And IMO those vents in Agni 3 releasing smoke during launch are probably connected to thrust termination devices, the moment when the pyro devices are set off.
Eg
It the target is within the reach of 1st stage of A3 , the 2nd stage is made redundant by firing the thrust termination devices on 2nd stage during launch , hence IMO the smoke coming out of the vents adjacent to the 2nd stage .
When the first stage burns out and gets separated during flight , the 2nd stage fires as standard operating procedure but since the thrust termination devices have already being activated the combustion of solid fuel starts but does not produce thrust since the gases produced during combustion starts escaping via the thrust termination vents , thus producing reverse or retro thrust , which allows for safer seperation of unneeded 2nd stage from PBV. All these happens in a matter of few seconds. Thus missile can fly in a lower controlled trajectory or conversely trajectory can be controlled as per requirements of range . This is an advanced and complicated flight control system mastered by very few countries. Implications of same for developing SLBMs are huge. Remember rumours of Agni 3 being used to test SLBM technologies.
Google to understand , without knowledge of thrust termination device and vent , difficult to comprehend what i wrote.
As usual use your own discretion , i cannot guarantee i am correct IMO.