liveBook · Manning

Dependency

As explained in Vibe Engineering

A software dependency is a component, package, library, or other resource that another component requires to function correctly.

A software dependency is a component, package, library, or resource required for another component to function. In AI-generated code, dependencies may appear through pattern matching rather than deliberate engineering choice, creating maintenance, licensing, security, and supply-chain risk. section 8.2.4

Evaluate every dependency before accepting generated code:

  • Check known vulnerabilities with tools such as Snyk, Dependabot, or npm audit. section 8.2.4
  • Check license compatibility with tools such as FOSSA or license-checker. section 8.2.4
  • Verify that the package exists, remains maintained, and has no suspicious ownership changes. section 8.2.4
  • Ask whether the dependency is necessary; unnecessary libraries expand the attack surface and may add substantial complexity. section 8.2.4

Dependencies also exist outside a function's visible lines. Libraries, data structures, invocation conventions, configuration, and neighboring services can determine whether a seemingly valid change is compatible with the real application. Isolated snippets invite invented methods, substituted libraries, and altered security behavior. section 3.2

async function authenticateUser(req, res) {
  const { username, password } = req.body;
  try {
    const user = await DatabaseClient.findUser(username);
    if (!user) {
      return res.status(401).send("Unauthorized");
    }
 
    const isValid = await bcrypt.compare(
    password, user.passwordHash);
    if (!isValid) {
      return res.status(401).send("Unauthorized");
    }
    const token = jwt.sign({ id: user.id }, 
        "secret", { expiresIn: "1h" });
    res.json({ token });
  } catch (err) {
    console.error(err);
    res.status(500).send("Internal server error");
  }
}

Inspect the authentication function's surrounding dependencies: DatabaseClient, bcrypt, jwt, passwordHash, and the request-handling contract. section 3.2

A plausible but unsafe refactor

An isolated authentication snippet was transformed by an AI into code using an invented database method, plain-text password comparison, a different JWT library, changed status semantics, and a hardcoded secret. The code's dependencies and project conventions were missing from the prompt, so the generated result sounded confident while breaking security and compatibility. section 3.2

How Vibe Engineering covers it

How deep it goes
Traces dependency risks through vulnerabilities, licenses, maintenance, supply chains, necessity, and invisible application context.
Examples
Uses npm packages, Snyk, Dependabot, npm audit, license-checker, package registries, and an authentication refactor.
What it assumes
Assumes familiarity with application code and packages while teaching why isolated snippets conceal libraries, data structures, and invocation contracts.
What you can do after
Diagnose/debug with it by tracing hidden dependencies and validating necessity, security, licensing, existence, and maintenance.
How it connects
Connects dependencies with vulnerability scanning, software licensing, software supply chains, security, and context management.

Also explained in

Compare how 35 books explain dependency →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.