Free guide

How software developers can use AI, and the six ways it goes wrong

Software developers can use AI to write boilerplate, explain unfamiliar code, draft tests, review changes and keep documentation current. The productivity is real, and so are the failure modes: invented packages, secrets in prompts, tests that prove nothing and code nobody understands. This guide takes each risk in turn with the habit that prevents it.

Verified 26 Oct 2026 6 live tool facts · How this is maintained


A coding assistant is the most convincing colleague you'll ever pair with. It never hesitates, never says "I'm not sure", and produces code that compiles more often than not. Compiling isn't the bar. The ways AI-written code fails are specific and repeatable, which is good news: each one has a habit that catches it.

How software developers can use AI without shipping its mistakes

Software developers can use AI well by treating every suggestion as a pull request from a fast, well-read contractor who has never seen the codebase. Accept it the way you'd accept that: read it, run it, test it, and ask whether it fits. The risks below are the ones that get past people most often.

What goes wrongWhy it happensThe habit that catches it
An invented package or methodThe model predicts plausible namesCheck every new dependency exists and is the one you meant
A secret in a promptContext gets pasted wholesaleStrip keys and tokens before anything leaves your machine
Tests that prove nothingTests written from the implementationWrite or review assertions from the requirement
Out-of-date library usageTraining data stops at a cutoffCheck against current docs for the version you use
Licence and provenance questionsOutput can resemble existing codeFollow your organisation's policy; review larger generated blocks
An agent with too much reachBroad permissions, untrusted inputLeast privilege; a human approves anything irreversible

Risk one: a confident call to something that doesn't exist

Language models generate likely-looking text. A method name that ought to exist, or a package with a sensible name, comes out just as fluently as a real one. Sometimes the package name is real but belongs to someone else, which is worse.

The habit: never add a dependency because an assistant suggested it. Look it up in the official registry, check the maintainer and recent activity, and confirm it's the library you meant. For methods, the compiler or tests catch most invented calls. Dependencies are where the quiet damage happens.

Risk two: the secret in the context

Lewis, a backend developer at a Manchester fintech, pasted a failing config file into a chat to ask why the service wouldn't start. The file held a live API key. He rotated it within the hour, but the key had already left the building.

The habit: treat the prompt as a public place. Keep secrets in a secrets manager, not in files you might paste. Before sharing a file, search it for keys, tokens and connection strings. For editor-based tools, check what files the tool can read and exclude anything sensitive. Whether code from a given plan can train models varies by tool and plan. GitHub Copilot is a fair example of both sides. Its strength: Code suggestions inside your editor, with a choice of models✓. Its limitation: Chat and agents are billed by credits, and personal-plan code trains models unless you opt out✓. You can set coding tools side by side in Compare.

Risk three: tests that agree with the bug

Ask an assistant to "write tests for this function" and it will read the function and test what it does. If the function is wrong, the tests confirm the wrong behaviour. Coverage rises; confidence is misplaced.

The habit: write the test cases from the requirement, then let the assistant fill in the boilerplate. Or ask it to list edge cases from the specification before it sees the code.

Here is the requirement for a function that calculates UK working days between two dates, excluding bank holidays from a list we supply. Without seeing any implementation, list the edge cases a test suite should cover, including date order, weekends at either end and an empty holiday list. Don't write code yet.

Our guide on how QA testers can use AI goes further on test design.

Risk four: yesterday's API

Models learn from data with a cutoff. A library that changed its interface since then gets the old one, delivered confidently. Fast-moving frameworks are the worst affected.

The habit: tell the assistant the exact version in your lock file, paste the relevant section of current docs when it matters, and treat deprecation warnings as a sign the suggestion is stale.

Risk five: whose code is it

Generated code can resemble code from public repositories. UK law on who owns computer-generated output hasn't been settled in court for code, and your contract and the tool's terms both apply.

The habit: follow your organisation's policy on AI-generated code, and review large generated blocks with the same care as copied code. If there's no policy, ask for one. Don't decide licensing questions alone.

Risk six: the agent that can do too much

Coding agents now plan and change many files, run commands and open pull requests. Claude Code's strength: Autonomous coding across real codebases✓. Its limitation: Usage caps apply on every plan✓. Cursor's strength: Agents that change many files at once✓. Its limitation: Heavy use beyond the plan is billed extra✓. The more an agent can do, the more an injected instruction in a README, an issue or a web page can steer it. That's prompt injection, explained in our plain-English guide.

The habit: give agents the least access that does the job, keep them away from production credentials, and require a person to approve anything that can't be undone.

Where code review and documentation fit

Review and documentation are where AI is lowest-risk and most underused. Nadia, a tech lead in Edinburgh, asks an assistant for a first pass on large pull requests: summarise the change, flag unclear names, note missing error handling. She still reviews the code herself; the summary just tells her where to look first. For docs, assistants are good at turning a merged change into a changelog entry or updating a README section, as long as someone checks it against what shipped.

How the path covers this for developers

Teach me AI's placement asks about your job, your sector and how you use AI now, then checks your self-ratings with scenario questions worded for your sector. A developer who rates themselves highly on building with AI will be asked to show it, and a scenario can only lower a rating.

The path often includes Checking AI's work, Data, privacy and your workplace, and the Builder level's How large language models work, which explains tokens, context windows and why a model invents a method name. Lesson examples and practice tasks are written for your kind of work. More on the builder route is on the builders page.

This isn't a programming course. It won't teach you a language or a framework, and developers looking for that should look elsewhere.

A pre-merge checklist for AI-assisted code

Common questions

Can I paste my company's code into an AI coding assistant?

Only into a tool and plan your employer has approved for its code. Plans differ on whether code can be used for training and how long it's kept, and personal plans are usually the weakest. Check your organisation's policy, and never paste credentials, customer data or anything under a client's confidentiality terms.

Who owns code an AI assistant writes?

UK law on computer-generated works hasn't been tested on AI coding output in court, and your employment contract and the tool's terms both matter. Most employers treat it like any other code you write at work. Ask your legal or engineering leadership for the house position rather than assuming.

Will AI make junior developers worse?

It can, if it replaces understanding rather than speeding it up. A junior who accepts suggestions they can't explain learns little. Used to explain code, suggest approaches and then critique the junior's own attempt, it can speed learning up. Code review that asks the author to explain their change keeps the balance honest.

Is there a Teach me AI track for coding tools?

The open tool specialist tracks are ChatGPT, Claude, Gemini and Microsoft Copilot, each with an assessment that includes that tool's current facts. There isn't a track for a dedicated coding tool. The Builder level's How large language models work module is the closest fit for developers wanting the mechanism.

Go deeper

Modules that teach this properly

More on this

AI for your job

Every guide on this topic →

Next step

Find out where you actually stand

A short placement assessment scores you across five skill areas and builds a path through our 18 released modules, skipping whatever you already know. No card needed.

Find your level
When this changes

The facts on this page are re-checked on a schedule. One email a month says what moved in AI tools and the rules, and what it means for you.

Once a month. We’ll email you a link to confirm, and every issue has a one-click unsubscribe. How we use your address.