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.
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 wrong | Why it happens | The habit that catches it |
|---|
| An invented package or method | The model predicts plausible names | Check every new dependency exists and is the one you meant |
| A secret in a prompt | Context gets pasted wholesale | Strip keys and tokens before anything leaves your machine |
| Tests that prove nothing | Tests written from the implementation | Write or review assertions from the requirement |
| Out-of-date library usage | Training data stops at a cutoff | Check against current docs for the version you use |
| Licence and provenance questions | Output can resemble existing code | Follow your organisation's policy; review larger generated blocks |
| An agent with too much reach | Broad permissions, untrusted input | Least 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
- Every new dependency verified in the official registry.
- No secrets in prompts, files shared or commit history.
- Tests derived from the requirement, not the implementation.
- Library calls checked against the version you actually run.
- Generated blocks reviewed as carefully as copied code.
- Agent permissions as narrow as the task allows.