HELM
Ch 16 · AI in Engineering
Chapter 16 · The amplifier

AI in Engineering — how to use it without losing the craft

Used well, AI tools multiply your team. Used carelessly, they encode hallucinations into your codebase and outsource the thinking. A tech lead's job is to draw the line.

16.1 · The tools (2026)

ToolModeBest at
GitHub CopilotIDE completion + chat + agentInline suggestions across all languages; deep IDE integration.
CursorAI-first editorMulti-file edits, repo-aware chat, fast iteration.
Claude CodeTerminal-native agentPlan / explore / edit across repos with MCP + sub-agents.
Continue / Cline / AiderOpen-source CLI/IDE agentsBring-your-own-model; local options.
Sourcegraph CodyEnterprise code search + AIRepo-graph context across large codebases.
Tabnine / Codeium / WindsurfSelf-host or VPC inferencePrivacy-sensitive enterprises.
CodeRabbit / Greptile / KorbitAI code reviewPR-level review bot.
v0 / Bolt / LovableGenerative app scaffoldingWhole-screen UI from a prompt.

16.2 · Three modes of AI use

1 · Completion (autocomplete++)

Inline suggestions while you type. Copilot, Cursor Tab. Lowest cognitive cost; highest hit rate on boilerplate.

2 · Chat (rubber-duck on steroids)

Ask, paste error, explore options. Great for "what does this regex do" and "why is this slow".

3 · Agentic (delegate a task)

"Add CSV export with tests." The agent plans, edits multiple files, runs tests, reports back. Highest leverage, highest review cost.

16.3 · An AI-augmented workflow that actually works

  1. Write the test first — even if AI writes the code, you've encoded the spec.
  2. Use the agent for the boring 80% — scaffolding, fixtures, glue, migrations.
  3. Keep humans on the hard 20% — concurrency, security, novel algorithms, UX.
  4. Run the test suite — never trust until green.
  5. Read every line of an AI patch before merge. You own the diff.

16.4 · Reviewing AI-generated code

  • Hallucinated APIs are common — verify imports exist and behave as claimed.
  • Look for silent error swallowing; LLMs love bare try/except.
  • Check for fabricated dependencies (typo-squatting risk).
  • Check it didn't comment out a failing test instead of fixing it.
  • Watch for over-engineering ("just in case" abstractions) — push for the simplest change.

16.5 · Shipping AI features in your product

(Cross-reference the AI Codex — Ch 6–18 — for depth.) The TL playbook in one page:

  1. Define the eval before the prompt. 20 frozen tasks + a rubric. Score every change.
  2. Start with RAG + a frontier model; only fine-tune when prompt eng plateaus.
  3. Stream tokens; users tolerate latency far better when they can see progress.
  4. Cap cost per request; cache prefixes; cascade small → large.
  5. Show citations for any factual answer.
  6. Add a feedback loop — thumbs up/down feeds the eval suite.
  7. Guardrails on input + output (PII, jailbreak, output schema).
  8. Observability via OpenLLMetry / LangFuse / LangSmith.

16.6 · Org-level guardrails for AI-in-dev

ConcernPolicy
Code privacyOnly enterprise / VPC inference for proprietary code; opt-out of training.
LicenseReject suggestions matching public licensed code (Copilot duplication detection on).
SecretsBlock prompts that contain detected secrets.
ApprovalSame code review rules; AI authorship disclosed in commit message.
CostPer-seat license; usage dashboard; cap on agent runs.

16.7 · Measuring AI uplift honestly

  • Track PR cycle time, review iterations, change failure rate before vs after.
  • Survey engineers quarterly (SPACE) — perceived productivity matters.
  • Beware vanity metrics: "lines accepted" rewards verbose code.
  • A/B by team where possible.

16.8 · Risks & smells you'll see

  • Skill atrophy in juniors who never struggle. Mandate "no AI" exercises in onboarding.
  • Codebase inflation as everyone accepts plausible-looking patches.
  • Security regressions from copy-pasted insecure patterns.
  • Lock-in on a single vendor. Stay abstract enough to switch (LiteLLM / Portkey at runtime; multiple tool subscriptions in IDE).

16.9 · Self-check

Q1 · Best leading indicator that AI tools help your team?
Lines of code accepted
PR cycle time + change failure rate
Number of AI prompts
Total tokens used