AI code and the phantom library: check dependencies before installation becomes reflex
Check the reason, identity, source and version of an AI-proposed dependency before accepting it into a project.
Article language: English

In this article
An assistant produces code and adds that a library must be installed. The name sounds professional, the description fits the task and the example looks taken from documentation. One small detail: the package may not exist or may not be what it was taken for. A confident tone is not a registry entry, however hard it tries to pass for one.
With AI-assisted code, separate a proposed dependency from accepting it into a project. A dependency is an external component the code will rely on. A new name in an answer should not automatically become an installation command. First establish identity, source, version and reason for use.
This review concerns organising that decision and its supporting evidence. It is not a security assessment of a particular library. It can be performed on an example without running it or downloading a suspicious package. The aim is to see whether the team can stop an unjustified proposal before it enters everyday work.
Before asking to install
In a fictional shop project, an assistant proposes a 'catalogue adapter' to retrieve product data. The name describes an example, not a real package to search for. The task needs one simple operation. First ask why it requires a new dependency. The project may already have a supported mechanism, or an existing system interface may suffice.
Ask where the code uses the proposed component and what role it plays. A general 'it simplifies integration' is not enough. The reviewer should know which function is needed and whether it was confirmed for the right library. This limits accepting a large component for a small task whose scope was not described first.
Record an alternative too. It may be a solution already used in the project or a simpler scope. This is not a rule against all libraries. The point is an identifiable reason why maintaining another one is justified. Comparison should include who will own later changes, not just the convenience of the first code generation.
Assessing an AI supplier before purchase (see the guide to assessing an AI supplier (in Polish)) likewise asks about task fit and continuing conditions of use. A dependency may be a smaller decision, but you still need to know what enters the process. No separate invoice does not mean no work updating it or changing the project.
Include a task instruction without the new library. Ask what would be missing in that version and what compromise would be needed. The comparison helps establish whether the proposal solves a real problem or merely repeats a convenient response pattern. If an existing component suffices, record why it was retained so the same dispute need not recur with the next code fragment.
Choose someone authorised to approve adding a dependency. They need access to the agreed description and evidence. If the assistant proposes a name, downloads it and declares it correct on its own, the process has no independent check. Even a good single trial then does not show how the team will catch the next mistake.
Connect the name to the correct object
Check the exact name in the registry appropriate to the project. Include the organisation scope if it forms part of the identifier. Similar sound does not establish identity. For a control trial use three states: the named package is absent, an existing package belongs to another project, and the correct library has a version that does not support the needed function.
Follow the registry entry to the documentation and source indicated by the project. See whether those places really describe the same package. An assistant can combine a correct name with an example from another library. The report should show the connection rather than accept any search result with a similar heading as confirmation.
Then check the version. A function in current documentation may not belong to the release accepted by the project. Establish which release's interface was confirmed and whether the code example concerns that same release. 'Latest' quickly loses precision; record a designation that can be revisited.
This boundary resembles valid JSON with the wrong meaning (see the article on correct JSON and wrong meaning (in Polish)). A name has the right shape but can still refer to an absent or wrong object. Checking string format does not establish identity or connection to the task.
Add a case where documentation is found under the correct name but describes a different environment. A browser example may not suit a server task. In the expected result specify the project's target environment and a person able to assess compatibility. A process audit should reveal the absence of that assessment, not decide from similar-looking examples.
Also check a proposal without a version. Ask the reviewer to identify material on which approval could rest. If they must guess the release, the change description is not ready for assessment. Record the omission as a specific documentation correction, not a general call for developers to be more careful.
Prepare a controlled case in which the assistant finds no confirmation. Does it mark the lack of evidence or present another similar name as certain? Can the reviewer reject the proposal without running an installation? A good process allows 'not confirmed' instead of requiring every suggestion to end in a successful download.
Trace one failed case to the end. The assistant proposed a name, failed to find it in the agreed source and suggested a replacement. The first decision should remain closed as unconfirmed; the second needs its own basis for assessment. A name changed in the same paragraph cannot inherit approval granted to a different component.

For a replacement, return to the reason for use. It may handle a similar task but require another data-transfer method or broader changes. The approver should see that difference before deciding. Otherwise the name check works correctly while approval still concerns a misdescribed solution.
Do not base acceptance solely on popularity or a familiar-looking page. Such information can help an assessment but cannot by itself answer whether this is the right dependency and function. Preserve specific grounds for each decision rather than creating one universal 'checked' stamp.
Provenance helps verification but does not finish assessment
npm's provenance documentation distinguishes a verifiable link between a package, source and build instructions from a guarantee that malicious code is absent. Such a credential provides specific evidence. It should not acquire broader meaning merely because it looks convincing in a panel.
For your own decision record what was checked and for which version. If a credential is available and verified, name that result's scope. If it is missing, do not automatically add an accusation. You need an agreed path for assessing the source and, where specialist analysis is required, a responsible technical person.
GitHub's dependency review documentation describes a view of added, removed and changed dependencies with information about known vulnerabilities. It can support change review. The absence of a displayed warning does not answer every question about whether to accept a particular component.
Connect this information to the task's justification during acceptance. The reviewer should see why the dependency is being added, what code uses it and who confirmed its identity. Otherwise review can become a quick glance at green indicators without assessing the change the project actually receives.
Compare the proposal description with the actual change submitted for review. Was one direct component approved while the set also contains additions? Were existing versions changed alongside the new one? In a controlled trial, the reviewer should be able to identify those differences and refer them for technical assessment before treating the decision as closed.
Distinguish absence of evidence from evidence of a problem in the report. An unconfirmed name means the proposal did not meet acceptance conditions. It does not automatically establish intentional wrongdoing. A precise record supports the next action: supplement the source, choose another component or abandon the change.
Alongside code acceptance and AI-agent confidentiality (see the guide to accepting AI-agent code (in Polish)), retain documentation of an accepted dependency. The next person should not have to reconstruct the rationale from an old model conversation. A short decision, source and version record is more useful than a complete export of generation history.
An operational discussion with Aeneia Audit can start with one code example, the proposed component name and the current approval route. The example can be discussed without installing an unconfirmed library.
Check what happens after the decision
In the result record separate 'identity confirmed', 'accepted for trial' and 'accepted into the project'. For each state identify the outstanding action and responsible person. Someone taking over will then not mistake finding the right page for completion of the whole acceptance.
If the proposal was rejected, see whether it remains in code, run instructions or configuration. Removing one mention from a description is not enough if the generated fragment still imports it. In a controlled trial, accept the entire set passed to the implementer so a correction does not remain only in a task comment.
If the dependency was accepted, define the further technical checking route in the environment appropriate to the project. Assessing name and source does not prove all the code works. Separately check the scope and actual result of tests reported by an AI assistant (see the article on tests reported by AI (in Polish)), linking trials to the task and change. Do not combine accepting a component for testing with approving a finished feature for use.
In an AI-agent workflow (see the article on AI-agent permissions (in Polish)), separate permission to propose a change from permission to perform later operations. If an assistant operates a tool interface, also check the difference between a click and the application's effect (see the article on browser actions and their effects (in Polish)). A record that a command was sent does not confirm the project state.
Test handing the project to a second person. Ask them to reconstruct which dependency the decision concerns and why it was made from the accepted record. If they need to speak to the original author, add the missing information. Also ask them to identify the next step for a rejected proposal. Do they know whether to return to the existing solution or await a new assessment of a replacement? Instructions should allow work to continue without restarting an unconfirmed installation.
Assign an owner for reassessment after an update or change in use. A library added for a small task may later underpin a larger product area. The old justification may not cover the new role. A recognisable reassessment point is enough, rather than expecting someone to remember by chance where the name came from.
A good audit result leaves a clear trail: what was proposed, what was confirmed, who decided and what further testing scope was agreed. The assistant can still help rapidly with code. Its confidence need not be granted its own permission to install things.







