Among the changed lines, a new import is the least scrutinised and among the most consequential. It adds somebody else's code to your system permanently, along with everything that code depends on, and it is one line long.
What should you check?
- Does it exist. Invented package names are a documented problem.
- Is it the right one. Names one character apart are a deliberate attack.
- Is it maintained. Last release, open issues, number of maintainers.
- What does it pull in. Transitive dependencies are the real footprint.
- Is it necessary. Whether the standard library covers it.
- What is the licence. Which matters commercially more than people assume.
Why does the existence check matter?
Because models occasionally name packages that do not exist, and people have registered those names with malicious code inside, waiting for somebody to install one on a recommendation.
This attack exists specifically because of how people now discover package names, and it is defeated by twenty seconds of looking the name up.
What is the transitive problem?
One dependency brings its own dependencies, which bring theirs. A single convenience library can add dozens of packages, each of which is code you now run and a potential vulnerability you now own.
Checking what a new dependency pulls in, before accepting it, frequently changes the decision.
Is the standard library enough?
More often than generated code assumes. Models reach for well-known libraries because those dominate published examples, and asking whether the same thing can be done without one is worth doing every time.
This change adds a dependency. Can the same thing be done with the standard library or with something already in this project? If the dependency is genuinely needed, tell me what it pulls in transitively and how large the addition is.
Should you ask the model about vulnerabilities?
No. Whether a version has a known vulnerability is a lookup against a current advisory database, and a model's knowledge stops at its training cutoff. Use a proper scanning tool, which is a standard part of most pipelines.
What about versions?
Worth pinning and worth reviewing when they change. Generated code frequently assumes whichever version was common in its training data, which may be behind or ahead of what the project uses, and the resulting mismatch produces confusing failures.
What about licences?
The check nobody runs until legal asks. Some licences impose obligations on anything that links to them, which can be genuinely inconvenient for commercial software, and the time to notice is before the dependency is embedded rather than after.
What about a dependency that is removed?
Worth checking in the other direction, and rarely reviewed at all. A removed import is usually harmless and occasionally means something stopped being validated, encoded or escaped, and the change reads as a tidy-up.
The question is what the dependency was doing. Where a library was handling escaping, date parsing or input validation and has been replaced with hand-written code, that replacement deserves the scrutiny that a new dependency would have received. Reviews focus on additions because additions are visible as risk, and removals can carry as much.
What is the rule worth applying?
Every new dependency in a diff gets looked up, by a person, before approval. It is one search per import, it catches invented names and typo-squatting, and it is the only part of dependency review that cannot be delegated to the thing that suggested the import.