AI-Assisted Engineering

The Rise of AI Pair Programming

GitHub Copilot became generally available three weeks ago and Amazon has announced CodeWhisperer. AI pair programming has moved from preview to product. We look at how the 'pair programmer' metaphor holds up, how developers are using these tools, and the team practices that make them work.

By EthicalHat Research · · 3 min read
Infographic: Human pair vs AI pair programmer

On 21 June, GitHub made Copilot generally available at $10 per month, free for verified students and maintainers of popular open-source projects. Two days later, Amazon announced a preview of CodeWhisperer, its own AI coding companion. A year after Copilot's technical preview, AI pair programming is a product category.

The marketing uses the phrase "AI pair programmer". It is worth asking how well that metaphor fits.

What pair programming is, and what the AI brings

In traditional pair programming, two developers work together: one types (the driver), the other reviews, questions and thinks ahead (the navigator). The benefits come from continuous review, shared knowledge and a second perspective on design.

An AI assistant covers some of that and not others:

  • It is an excellent recall engine. It remembers API signatures, idioms and patterns from vast amounts of public code.
  • It is fast and tireless. It suggests code for every line, all day.
  • It does not know your system. It sees the files open around you, not your architecture, your users or your history.
  • It rarely pushes back. A human navigator might ask "why are we doing it this way?" The AI tends to continue in whatever direction your code is already heading, including mistakes.

A more accurate description might be: a very fast, very well-read junior pair who never asks questions.

How developers are using it

From our own teams and conversations with others, the most common and valuable uses are:

  • Boilerplate: data classes, serialisers, configuration, repetitive glue code.
  • Unfamiliar territory: a new library, framework or language, where the assistant recalls idiomatic usage.
  • Tests: once a pattern is established, the assistant fills in further cases quickly.
  • Small utilities: parsing, formatting and transformation functions described in a comment.
  • Documentation: docstrings and comments for existing code.

Less valuable, and sometimes counterproductive:

  • complex business logic with subtle rules,
  • performance-critical or security-critical code, and
  • large design decisions.

Team practices that make it work

1. Agree on norms. Discuss as a team where the assistant helps and where it should be switched off (for example, when working on authentication or cryptography).

2. Keep review standards the same. Pull requests are reviewed the same way whether or not an assistant was involved. The author is accountable for every line.

3. Strengthen automated checks. Linters, type checkers, tests and security scanning catch many assistant mistakes cheaply.

4. Watch for security patterns. Research has shown AI assistants sometimes suggest vulnerable code. Include common examples in secure coding training.

5. Mind licensing and privacy. Copilot now offers a setting to block suggestions matching public code. Decide whether to enable it, and check what code context is sent to the service.

6. Protect learning. Junior developers benefit from assistants, and also risk accepting code they do not understand. Pair humans with juniors on reviews, and encourage "explain this suggestion" habits.

text
Team working agreement (example)
- Use the AI assistant freely for tests, boilerplate, docs and unfamiliar APIs.
- Turn it off or review line by line in: auth/, crypto/, payments/.
- Enable the "block suggestions matching public code" setting.
- Never paste secrets or customer data into prompts or comments.
- PR author owns correctness and security of all code, AI-assisted or not.

Measuring the effect

It is tempting to measure "percentage of code written by AI". A better question is whether delivery and quality improve: cycle time, review time, defect rates and developer satisfaction. Early studies and our own experience suggest meaningful speed-ups on well-defined tasks, and smaller or no gains on complex work.

The bottom line

AI pair programming has arrived as an everyday tool. Used as a fast, knowledgeable but uncritical partner, it takes away much of the tedium of programming. The human half of the pair still provides the judgement, context and scepticism that make software correct and secure, and teams should build their practices around that division of labour.

Our secure SDLC team uses AI pair programmers under clear team norms, and our security training covers reviewing AI-suggested code.

EthicalHat Research

The EthicalHat research team: penetration testers, SOC analysts and engineers writing about security, software engineering and AI.

Want an expert opinion on your own systems?

Email info@ethicalhat.com or call +1-844-838-4422. Our security engineers are happy to talk it through.