Skip to content
CyberSafety.lol

Lesson ยท 5 min

Borrowed code: the parts of your app you did not write

AI assistants suggest add-ons quickly. Not every suggestion is safe, current or even real.

Borrowed code, which developers call a dependency, is code you use but did not write. Modern apps borrow hundreds of pieces, directly and indirectly.

Risks include known flaws, pieces nobody maintains any more, fake look-alikes with almost the same name, and trusted pieces that get taken over.

AI assistants can suggest add-ons that do not exist, or that nobody has checked. Before installing, make sure it is real, looked after and what you expect.

Lock your versions so nothing changes behind your back, run a checker that watches for known flaws, and look at what changes when you update. If a borrowed piece turns out to be bad, treat any secret keys it could see as stolen.

Words you will see

Dependency
Someone else's code that your project uses.
Lockfile
A file listing the exact versions of every dependency, so a surprise update cannot sneak in.
Supply chain attack
Attacking the things you rely on instead of attacking you directly.

Decision

An AI assistant suggests an unfamiliar add-on that does exactly what you need. What should you do before installing it?

What to do instead

  • Keep the file that locks your versions with your project.
  • Turn on a free checker that warns about known flaws.
  • Prefer fewer, well-looked-after add-ons.

Common mistakes

  • Installing a package because an AI suggested it without checking it exists and is maintained.
  • Not committing the lockfile.
  • Updating everything the minute a new version appears.

References and further reading

Finished this one?

Add it to What I learned and earn 50 Trust. You can open your list from the badge at the bottom of the page.