We evaluate the vacuum polarization tensor (VPT) for a massless Dirac field in 1+1 and 3+1 dimensions, in the presence of a particular kind of defect, which in a special limit imposes bag boundary conditions. We also show that the chiral anomaly in the presence of such a defect is the same as when no defects are present, both in 1+1 and 3+1 dimensions. This implies that the induced vacuum current in 1+1 dimensions due to the lowest order VPT is exact.