In situ extinguishing strategy based on self-portable microcapsule fire extinguishing agent for lithium-ion batteries has been proposed. • A-B-microcapsule extinguishing agent can automatically detect and response at the early stage of Li-ion battery thermal runaway.