Safeguard
AI Security•

What should secure coding training cover when developers use AI?

For developers using AI assistants, add review skills, dependency checks, secrets hygiene and policy to training. A syllabus with practice tasks.

Safeguard Security Team
3 min read

When developers use AI coding assistants, training should add four things: reviewing generated code as untrusted input, checking suggested dependencies, keeping secrets and private data out of prompts, and knowing what the team policy allows. The classic flaw classes stay, because the assistant can write them too.

Definition

An AI coding assistant is a tool that suggests or writes code from a prompt or the surrounding files. It can be wrong in the same ways a person can, but faster and with more confidence in its tone. Training needs to shift from "write safely" toward "judge what was written safely".

The syllabus

TopicSkill to practiceExercise
Review generated codeRead for access checks, input handling and error paths before acceptingReview a suggested handler that lacks an authorization check
Dependency suggestionsVerify a package exists, is maintained and fits your policy before adding itCheck a suggested package name against the registry and your allow list
Outdated or insecure patternsNotice deprecated APIs and weak defaultsSpot an old hashing call in a suggestion
Secrets and private dataKeep keys, customer data and internal code out of prompts unless policy allowsRewrite a prompt with placeholders
Tool permissionsUnderstand what an agent can read, run and changeReview a config that gives an agent broad file access
PolicyKnow approved tools, logging and escalationQuiz on your own acceptable use rules

Our existing posts on training junior developers to review AI code and AI assistants suggesting outdated library versions go deeper on two of these.

How to run it

  1. Start with your policy. If you do not have one, write a one page version first: which tools, which data, who reviews.
  2. Collect two or three real examples from your own repos where an assistant produced a flaw. Anonymize them.
  3. Run a 45 minute session: demo, exercise, discussion.
  4. Add a line to your pull request template: "Contains AI generated code? Reviewed for access checks, dependencies and secrets."
  5. Revisit quarterly, because tools and settings change fast.

What not to do

  1. Ban the tools by memo and assume that ends use. Staff will use personal accounts.
  2. Treat the assistant's explanation as a security review.
  3. Train only juniors. Senior engineers accept suggestions too.
  4. Teach prompt tricks as a security control. Prompts are not a boundary.

Measuring it

Track the share of pull requests flagged for AI content that needed security changes in review, and dependency additions rejected at review. Use trends over a few quarters, and expect numbers to be messy.

Where Safeguard fits

Safeguard offers an MCP Guardrail, policies and gates, and SBOM and dependency scanning, which can help check what an assistant adds to a repository. You can start with a free scan.

Quick check

Do we need separate training for AI assistant users?

Not a separate program. Add a module to existing developer training covering review, dependencies, secrets and policy.

Is generated code less secure than human code?

We have not cited a source for a general claim either way. Treat it as untrusted input and review it, whoever wrote it.

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.