The Asteroid Impact Mission (AIM) is an ESA small mission of opportunity that intends to travel to the binary asteroid Didymos to assess planetary defence capabilities in the context of the AIDA program, in collaboration with NASA, to demonstrate new technologies for future exploration missions to asteroids and to perform scientific observations.The AIM spacecraft is described in the paper, focusing on the vision-based GNC strategy that reached a high level of maturity at the end of the Consolidation Phase (post B1). Ground navigation analyses pointed out that for close proximity operations (distances under 20 km) a certain degree of autonomy is required.A semi-autonomous attitude guidance has been developed to guarantee that the asteroid will always be kept in the camera Field of View. This algorithm will apply a delta quaternion to the reference attitude profile provided by ground control in order to correct the pointing to the body. This technology has been designed to be easily validated and, at the same time, constrained: the delta quaternion can be limited and in case the thresholds are crossed or any failure occurs, the ground-based reference attitude profile will be used.The AIM GNC prototype was updated to use Line of Sight measurements provided by a centroiding algorithm designed and autocoded in Matlab/Simulink, then validated up to Processor-in-the-loop tests using a flight-representative processor (AT697E LEON2-FT @ 80 MHz). The algorithm is based on the correlation of the image with a Lambertian sphere, taking advantage of the almost spherical shape of Didymain.When relative distance to the binary system is below 8 km, the feature tracking algorithm is used. In this paper a specific case is assessed: the close fly-by for MASCOT-2 delivery (lander included in the payload for AIM's phase B1), tested up to Hardware-in-the-loop with the AIM Framing Camera.