I don’t think an agent should be able to silently merge a new dependency, even if the build passes and the package is widely used. “Widely used” reduces some uncertainty, but it does not rule out typosquatting, a malicious update, abandonment, or a build that can’t be reproduced later.
My practical compromise is to let the agent propose the change in an isolated pull request, generate and update the lockfile, and run CI checks for vulnerabilities, maintenance, provenance, and approved packages. For npm, the lockfile records the exact tree, and `npm ci` requires the manifest and lockfile to stay synchronized. Sensitive or production repositories should add a human approval gate; lower-risk projects can rely more on automated policy checks. Would you impose a hard gate everywhere, or trust a sufficiently strict automated review?