Line these up and you get a counter-intuitive but consistent conclusion: none of them was a memory-safety bug, and none of them was a missing approval prompt. In each case the tool call was inside the agent's authorized scope. What turned it into a disaster was that the credential was too broad and lived too long.
That fixes where the control point has to be. Prompt-injection defenses, tool-description pinning, approval dialogs — all of them sit above the credential. They can stop the agent from asking; they cannot stop the credential from working. A poisoned tool description, a compromised npm version, and an infostealer reading ~/.claude.json all reach the same static PAT, and none of them passes through a PreToolUse hook.
Put the other way round: if the credential never lands on the laptop, tool poisoning degrades from “exfiltrate the entire private repository” to “make one authorized, logged, revocable call.”
— that single sentence is the whole design premise of AgentPAM