According to the Vedic injunctions, only an aggressor can be killed. If a person comes with an intent to kill, one can immediately take action and kill in self-defense
SB Canto 5
All the rogues and thieves who had made arrangements for the worship of goddess Kālī were low minded and bound to the modes of passion and ignorance. They were overpowered by the desire to become very rich; therefore they had the audacity to disobey the injunctions of the Vedas, so much so that they were prepared to kill Jaḍa Bharata, a self-realized soul born in a brāhmaṇa family. Due to their envy, these dacoits brought him before the goddess Kālī for sacrifice. Such people are always addicted to envious activities, and therefore they dared to try to kill Jaḍa Bharata. Jaḍa Bharata was the best friend of all living entities. He was no one's enemy, and he was always absorbed in meditation on the Supreme Personality of Godhead. He was born of a good brāhmaṇa father, and killing him was forbidden, even though he might have been an enemy or aggressive person. In any case, there was no reason to kill Jaḍa Bharata, and the goddess Kālī could not bear this. She could immediately understand that these sinful dacoits were about to kill a great devotee of the Lord. Suddenly the deity's body burst asunder, and the goddess Kālī personally emerged from it in a body burning with an intense and intolerable effulgence.
According to the Vedic injunctions, only an aggressor can be killed. If a person comes with an intent to kill, one can immediately take action and kill in self-defense. It is also stated that one can be killed if he comes to set fire to the home or to pollute or kidnap one's wife. Lord Rāmacandra killed the entire family of Rāvaṇa because Rāvaṇa kidnapped His wife, Sītādevī. However, killing is not sanctioned in the śāstras for other purposes. The killing of animals in sacrifice to the demigods, who are expansions of the Supreme Personality of Godhead, is sanctioned for those who eat meat. This is a kind of restriction for meat-eating. In other words, the slaughter of animals is also restricted by certain rules and regulations in the Vedas. Considering these points, there was no reason to kill Jaḍa Bharata, who was born in a respectable, highly exalted brāhmaṇa family. He was a God-realized soul and a well-wisher to all living entities. The Vedas did not at all sanction the killing of Jaḍa Bharata by rogues and thieves. Consequently the goddess Bhadra Kālī emerged from the deity to give protection to the Lord's devotee. Śrīla Viśvanātha Cakravartī Ṭhākura explains that due to the Brahman effulgence of such a devotee as Jaḍa Bharata, the deity was fractured. Only thieves and rogues in the modes of passion and ignorance and maddened by material opulence offer a man in sacrifice before the goddess Kālī. This is not sanctioned by the Vedic instructions. Presently there are many hundreds and thousands of slaughterhouses throughout the world that are maintained by a puffed-up population mad for material opulence. Such activities are never supported by the Bhāgavata school.