AI Security Training for Developers: What It Must Cover

Published September 11, 2026

By Curtis Lambert

AI security trainingdevelopersLLM securityapplication securityprompt injection

The developer adding a chat feature to an internal tool is now making security decisions that used to belong to an architecture review. What the model can call, what happens to its output, which credential the tool runs under: those choices are made in a pull request, usually in an afternoon, usually by someone whose AI security training consists of a slide deck about prompt injection.

Most AI security training on the market is built for the SOC. It teaches detection, triage, and data analysis, which is the correct curriculum for an analyst and the wrong one for the person writing the application. Here is what the developer version has to contain.

Map the architecture to named weaknesses first

A developer cannot secure an abstraction. The first exercise should be drawing the actual data path of the feature being shipped: user input, retrieved documents, system prompt, model, output, and every consumer of that output.

Then name the weaknesses against the OWASP Top 10 for LLM Applications. Naming matters for a practical reason: a finding filed as LLM06 Excessive Agency gets triaged, and a ticket that says “the AI might do something bad” does not.

A chat feature that only renders text into a page has one exposure. The same model wired to a tool that runs a database query has a different one. Same vendor, same API, different threat model, and no generic training can make that call for a team.

Output handling breaks first

The most common production bug is not a clever jailbreak. It is a developer treating model output as trusted because it came from their own API call.

# The model returns text. This treats it as code.
sql = llm.generate(f"Write SQL to answer: {question}")
cursor.execute(sql)                      # LLM05, and now also SQL injection

Model output is untrusted input to whatever consumes it. Rendering it as HTML gives you cross-site scripting with an extra hop. Passing it to a shell gives you command injection. Writing it into a downstream prompt gives you a chain nobody is auditing.

The pattern that holds is constraining the model to a choice rather than to code generation:

# The model picks from a fixed set. The application writes the query.
intent = llm.classify(question, labels=["revenue", "headcount", "churn"])
cursor.execute(QUERIES[intent], params)  # parameterized, allowlisted

Labs should make students exploit their own feature first. Reading about LLM05 Improper Output Handling does not land the way watching your own chatbot render an injected <img onerror=...> tag does.

Agency is an authorization problem, not a prompt problem

LLM06 Excessive Agency is where developer training diverges hardest from analyst training, because the fix is entirely in code the developer owns.

The rule: the model’s permission is the permission of the credential its tool calls run under. A system prompt saying “only read, never delete” is a suggestion to a text predictor. A database role with no DELETE grant is a control. Scope the token, scope the tool signature, require human confirmation for anything irreversible, and log tool invocations with the user identity that triggered them.

This is also where prompt injection stops being theoretical. An agent that reads a support ticket and can also call an email tool will eventually read a ticket written by someone who knows that. The offensive workflow for finding these paths is written up in red teaming an LLM-powered application. The defensive version is shorter: assume the instruction arrives, and make sure the tool it reaches cannot do real damage.

Tests run in CI or they do not run

A pentest before launch tells you about the prompt that existed that week. Prompts change weekly, and a one-line system prompt edit can reopen a bug that was closed in March.

Promptfoo fits a developer workflow because the cases live in version control next to the code:

redteam:
  plugins: [pii, excessive-agency, hijacking]
  strategies: [prompt-injection, jailbreak]
  numTests: 20

Garak gives broader probe coverage against the deployed endpoint. Both point at the application, not the base model, because the vulnerability is nearly always in the wiring. Treat a failed injection case the way you treat a failed unit test: it blocks the merge.

The limits worth stating

This curriculum does not make anyone a machine learning engineer, and it should not try. Securing an LLM feature is application security with an unusual input source. Teams that train or fine-tune their own models need the artifact and data-poisoning material covered in AI model security training, which is a different course for a different job.

It also will not help a team that has no authorization model to begin with. If tool credentials are shared service accounts with broad grants, the AI feature is not the problem that needs solving first.

We teach this material in the AI Cyber Bootcamp, where the red and blue team blocks cover evasion, poisoning, prompt injection, and RAG poisoning against live targets, and the labs run in a browser environment so nobody loses a morning to dependency installs. The course assumes you can read and modify code, which for this audience is a safe assumption.

Frequently Asked Questions

How is AI security training for developers different from AI security training for a SOC?
The decisions are different. A SOC analyst asks whether an event is malicious and needs detection, triage, and data analysis skills. A developer building an LLM feature makes design decisions that determine whether the attack is possible at all: what the model is allowed to call, what happens to its output, what sits in its context window, and which credential the tool call runs under. Training aimed at analysts spends its lab time on detection and log analysis, which is the wrong hour-allocation for someone writing the application. A developer curriculum should spend most of its labs inside the application code.
What does a developer-focused AI security curriculum need to cover?
Four areas. The threat model for the specific architecture being shipped, mapped to the OWASP Top 10 for LLM Applications so findings are nameable. Output handling: treating every model response as untrusted input to whatever consumes it, which is LLM05 Improper Output Handling. Agency and authorization: scoping tools and the credentials they run under, which is LLM06 Excessive Agency. And automated testing, so injection cases run in CI on every prompt change rather than once during a pentest window.
Can prompt injection be fixed with a better system prompt?
No. Instructions in a system prompt are data in the same context window as the attacker's text, and there is no reliable privilege boundary between them. Prompt hardening reduces the hit rate against unsophisticated payloads and buys nothing against a determined one. The controls that hold are architectural: limit what the model can do, validate what comes out of it before anything acts on it, and assume any text the model has read can influence any text it writes. Treat prompt wording as defense in depth, never as the control.
What tools should developers use to test an LLM feature before release?
Garak from NVIDIA runs probe batteries against a REST endpoint and is the quickest way to get baseline coverage. Promptfoo fits the developer workflow better for regression work, since test cases live in a YAML file next to the code and run in CI. Both test the deployed application rather than the base model, which is the correct target: the vulnerability is almost always in the wiring around the model, not in the weights.
Do developers need to learn machine learning to secure an LLM feature?
Not for application work. Securing an LLM feature is an application security problem with an unusual input source, and the skills that matter are input and output validation, authorization design, and test automation. Training that opens with gradient descent and loss functions is aimed at a different job. Model internals become relevant when a team trains or fine-tunes its own models, where data poisoning and artifact supply chain enter the threat model.

Related posts

Want to learn more?

Explore our hands-on AI and cybersecurity training courses.

View Courses