Topological invariants of electron wavefunctions in condensed matter reveal many intriguing phenomena. A notable example is provided by topological insulators, which are characterized by an insulating bulk coexisting with a metallic boundary state. Although there has been intense interest in Bi-based topological insulators, their behaviour is complicated by the presence of a considerable residual bulk conductivity. Theories predict that the Kondo insulator system SmB6, which is known to undergo a transition from a Kondo lattice metal to a small-gap insulator state with decreasing temperature, could be a topological insulator. Although the insulating bulk and metallic surface separation has been demonstrated in recent transport measurements, these have not demonstrated the topologically protected nature of the metallic surface state. Here we report thickness-dependent transport measurements on doped SmB6, and show that magnetic and non-magnetic doping results in contrasting behaviour that supports the conclusion that SmB6 shows virtually no residual bulk conductivity.