Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Generative AI Cybersecurity: LLM, RAG & AI Agent Security
Rating: 4.1 out of 5(9 ratings)
33 students

Generative AI Cybersecurity: LLM, RAG & AI Agent Security

OWASP LLM Security, Prompt Injection, AI Firewalls, RAG, AI Agents, AI-SPM, Sandboxing & Red Teaming
Last updated 10/2026
English
English [Auto],

What you'll learn

  • Understand the unique security risks of Generative AI, including prompt injection, hallucinations, and data exfiltration
  • Analyze and defend against the OWASP Top 10 threats for LLM applications
  • Identify GenAI-specific attack surfaces such as embeddings, plugins, vector stores, and API endpoints
  • Implement AI Firewalls using token filtering, response moderation, and behavioral rule sets
  • Design and enforce Security Posture Management (AI-SPM) for prompts, agents, tools, and memory
  • Mitigate prompt-based attacks with detection engines, heuristic checks, and red teaming tools like PromptBench and PyRIT
  • Harden Vector Stores and RAG architectures against poisoning, drift, and adversarial recall
  • Apply sandboxing, runtime controls, and execution boundaries to secure LLM-powered SaaS and enterprise agents
  • Secure multi-agent orchestration frameworks (LangChain, AutoGen, CrewAI) from memory poisoning and plugin hijacking
  • Use identity tokens, task chains, and capability boundaries to protect agent workflows
  • Build and automate AI-specific security test suites and integrate them into CI/CD pipelines
  • Deploy open-source and commercial AI security tools (e.g., Lakera, ProtectAI, HiddenLayer) effectively
  • Integrate MLOps and SecOps to monitor, respond, and remediate threats across GenAI pipelines
  • Apply cloud-native guardrails via Azure AI Studio and GCP Vertex AI for enterprise-grade compliance and moderation
  • Ensure traceability, auditability, and compliance with GDPR, HIPAA, and DORA in GenAI deployments

Course content

10 sections • 38 lectures • 1h 54m total length
  • Understanding the GenAI Security Landscape3:25

    Understand how generative AI breaks security models and secure prompts, embeddings, memory, and agents against prompt injection, data leakage, model abuse, and autonomy abuse with AI-native firewalls and threat modeling.

  • Why Traditional Security Fails with Generative AI3:07

    Generative AI disrupts traditional security by exposing probabilistic responses and conversational inputs. Adaptive semantic aware filtering, agent-aware controls, and synthetic scenario testing guard against emergent behavior, prompt mutations, and hallucinations.

  • OWASP Top Threats for LLM Applications3:44

    Explore OWASP's top ten LLM application security risks, including prompt injection, data leakage, and model denial of service, and learn defenses like input validation, prompt integrity checks, and data provenance.

  • OWASP Top Threats for LLM Applications pt23:12

    Explore top threats to llm applications, including excessive agency, overreliance, and unsafe plugins, and learn governance, sandboxing, and supply-chain protections to secure autonomous agents.

  • Security Frameworks for Generative AI (NIST AI RMF, OWASP MAS, ISO 42001)3:31

    Assess how NIST AI RMF, OWASP MAS, and ISO 42001 address data leakage, hallucinations, prompt injection, and governance in generative AI systems.

Requirements

  • Basic understanding of cybersecurity principles

Description

Generative AI Cybersecurity: LLM, RAG & AI Agent Security

Generative AI Cybersecurity: LLM, RAG & AI Agent Security is a practical course designed for cybersecurity professionals, security engineers, AI security professionals, application security teams, cloud security professionals, AI developers, security architects, red teamers, DevSecOps professionals and technical teams responsible for securing modern Generative AI applications.

The course explores how to secure Generative AI systems, Large Language Models (LLMs), Retrieval-Augmented Generation (RAG) applications, vector databases, AI agents, multi-agent systems, model interfaces, AI memory and tool-enabled AI workflows against emerging cybersecurity threats.

Learners explore modern LLM security, AI cybersecurity, OWASP threats for LLM applications, prompt injection, data exfiltration, hallucination risk, AI firewalls, AI Security Posture Management (AI-SPM), prompt-security testing, secure RAG architecture, vector poisoning, embedding attacks, LLM sandboxing, runtime controls, AI agent security, multi-agent security, red teaming, MLOps security and SecOps integration.

Rather than treating Generative AI security as an extension of traditional application security, the course examines the new attack surfaces introduced when AI systems can process natural-language instructions, retrieve external knowledge, maintain memory, call tools, interact with applications and coordinate with autonomous AI agents.

The objective is to help learners understand how modern Generative AI systems can be attacked, tested, monitored and hardened using practical security architectures, defensive controls and AI-specific security tooling.

Understanding the Generative AI Security Landscape

Generative AI introduces security challenges that differ from those found in traditional software applications.

Conventional applications generally execute explicitly programmed logic.

Modern AI systems can interpret open-ended instructions, retrieve information from external sources, maintain conversational context, invoke tools and generate actions based on probabilistic model outputs.

This creates a broader security surface involving:

  • User prompts

  • System prompts

  • Large Language Models

  • Model APIs

  • Embeddings

  • Vector stores

  • RAG pipelines

  • AI memory

  • Plugins and tools

  • AI agents

  • Multi-agent orchestrators

  • Cloud AI infrastructure

A secure Generative AI architecture therefore requires security controls across the entire AI application stack.

OWASP LLM Security

The course explores security risks associated with modern LLM applications and how established security thinking must evolve for Generative AI.

Learners examine threats affecting:

prompts, model behavior, application logic, data access, retrieval systems, external tools and downstream applications.

Understanding OWASP-oriented LLM security helps security teams build a structured approach to identifying and mitigating common weaknesses in Generative AI applications.

The goal is not only to secure the underlying model.

The entire LLM application architecture must be considered.

Why Traditional Application Security Is Not Enough

Traditional controls such as authentication, authorization, network segmentation and secure coding remain important.

However, Generative AI introduces additional risks.

For example, an application may be technically authenticated and properly configured but still allow a malicious instruction to manipulate model behavior.

Similarly, an LLM may have no conventional software vulnerability while still exposing confidential information because of unsafe prompt handling or unrestricted tool access.

A stronger security model therefore becomes:

Application Security + Model Security + Prompt Security + Data Security + Retrieval Security + Tool Security + Agent Security

This broader architecture is at the heart of modern AI cybersecurity.

Generative AI Attack Surfaces

A Generative AI application can contain several interconnected attack surfaces.

These may include:

prompts → embeddings → vector stores → model context → memory → tools → APIs → agents

Security teams need to understand how a weakness in one layer can affect another.

For example, malicious information inserted into a retrieval source could influence model responses even though the attacker never directly modifies the LLM.

This makes architecture-level security essential.

Prompt Injection

Prompt injection is one of the most important concepts in Generative AI security.

An attacker may attempt to influence a model with instructions designed to override intended behavior, expose information or manipulate downstream actions.

Security professionals need to consider both direct and indirect prompt injection.

A secure design may involve multiple defensive layers such as:

input controls → instruction hierarchy → context isolation → output validation → tool restrictions → monitoring

No single prompt can guarantee complete security.

Prompt injection should therefore be treated as an architectural security problem rather than merely a prompt-writing problem.

Data Exfiltration

Generative AI systems may have access to sensitive:

  • Documents

  • Knowledge bases

  • Customer information

  • Internal databases

  • Source code

  • Enterprise applications

If access boundaries are poorly designed, an attacker may attempt to use the AI interface to retrieve information that should not be available.

A secure AI system should apply appropriate:

authentication, authorization, retrieval controls, least privilege and output validation.

The model should not become an uncontrolled path to enterprise data.

Hallucination as a Security Risk

Hallucination is often discussed as an AI-quality issue, but it can also become a cybersecurity and operational risk.

A model may generate:

  • Incorrect security instructions

  • Unsupported claims

  • Fabricated references

  • Incorrect remediation guidance

  • Unsafe commands

Organizations should therefore treat model output as untrusted output requiring appropriate validation.

This principle is similar to established secure software thinking:

Never trust unvalidated input—and with Generative AI, do not automatically trust generated output either.

Security by Design for Generative AI

Security should be integrated during AI system design rather than added after deployment.

A secure AI architecture considers:

identity → data → prompts → models → retrieval → memory → tools → agents → logging → monitoring

Security teams should ask questions such as:

  • What information can the model access?

  • Which tools can it invoke?

  • What happens if the prompt is malicious?

  • Can retrieved information be trusted?

  • How is memory isolated?

  • What actions require authorization?

  • How are AI interactions logged?

This creates a more defensible architecture.

AI Firewalls

The course explores AI firewalls as a security layer designed for AI interactions.

An AI firewall may inspect:

  • User prompts

  • Model responses

  • Sensitive information

  • Policy violations

  • Suspicious instructions

  • Unsafe outputs

A simplified architecture is:

User → AI Firewall → LLM Application → AI Firewall → User

The security layer may evaluate both incoming and outgoing information.

Rule-Based vs Model-Based AI Firewalls

Different AI security systems may use different approaches.

Rule-based controls can detect known patterns and enforce explicit policies.

Model-based controls can potentially recognize more contextual or semantic risks.

Organizations may combine several methods.

A defense-in-depth model could include:

rules + classifiers + policy models + application controls + monitoring

rather than depending on one security mechanism.

AI Security Posture Management — AI-SPM

Another important area of the course is AI Security Posture Management (AI-SPM).

As organizations deploy increasing numbers of AI applications, they need visibility into:

  • AI models

  • Prompts

  • Plugins

  • Memories

  • Data sources

  • Permissions

  • Tools

  • Configurations

AI-SPM can help security teams identify where Generative AI exists and where security weaknesses may be present.

A useful security lifecycle is:

Discover → Assess → Prioritize → Remediate → Monitor

AI Asset Discovery

Organizations cannot secure AI assets they do not know exist.

AI posture management may therefore involve discovering:

  • AI applications

  • Models

  • Prompt templates

  • Data connections

  • Vector stores

  • Plugins

  • Agent tools

  • Memories

This provides the foundation for AI governance and risk management.

Policy Controls and Remediation

After AI assets are identified, organizations can apply security policies.

Potential policies may relate to:

  • Data access

  • Tool permissions

  • Memory

  • Model configuration

  • Prompt handling

  • Output validation

AI-SPM helps move security from isolated application fixes toward enterprise-wide AI governance.

Prompt Injection Defense

Because prompt injection is a major attack category, the course explores defensive techniques and specialized products designed to detect unsafe prompts.

Security teams may combine:

heuristics, classifiers, rules, context analysis and behavioral monitoring.

A good defense should not assume every attack will use the same phrase.

Attackers may intentionally vary wording to bypass simple pattern matching.

Therefore prompt-security systems need multiple defensive layers.

AI Red Teaming

Generative AI systems should be tested adversarially.

AI red teaming asks:

How might someone intentionally cause this system to behave in an unsafe or unintended way?

Testing may focus on:

  • Prompt injection

  • Data exposure

  • Policy bypass

  • Unsafe tool usage

  • Retrieval manipulation

  • Agent misuse

Red teaming can identify weaknesses before they are exploited in production.

Secure RAG Architecture

Retrieval-Augmented Generation is widely used to connect LLMs with private or enterprise knowledge.

A simplified architecture is:

User Query → Retrieval → Vector Database → Relevant Context → LLM → Response

Every stage introduces security considerations.

A malicious or compromised knowledge source may influence the model.

A poorly designed retrieval system may expose documents the user should not access.

Secure RAG therefore requires security at both the retrieval layer and generation layer.

Vector Database Security

Vector stores are central to many RAG systems.

Security teams should understand risks involving:

  • Unauthorized retrieval

  • Vector poisoning

  • Malicious embeddings

  • Data leakage

  • Retrieval manipulation

The vector database should not be treated as a passive infrastructure component.

It is part of the application's security boundary.

Vector Poisoning

Vector poisoning occurs when malicious or manipulated information enters the retrieval environment and later influences model responses.

A simplified attack path might be:

Malicious Document → Embedding → Vector Store → Retrieval → Model Context → Manipulated Response

This shows why RAG security requires control over both:

what enters the knowledge base

and

what gets retrieved from it.

Secure Retrieval

Secure RAG design may involve:

  • Source validation

  • Access-controlled retrieval

  • Metadata filters

  • Retrieval authorization

  • Document integrity

  • Output validation

A strong principle is:

The LLM should receive only information the requesting user is authorized to access.

Retrieval security should therefore align with enterprise identity and authorization.

LLM Sandboxing

Tool-enabled LLMs create additional risk because the model may be capable of interacting with external systems.

LLM sandboxing helps restrict what an AI application can do.

Potential controls include:

  • Restricted execution environments

  • Tool allowlists

  • Network restrictions

  • File-system restrictions

  • Limited permissions

  • Resource boundaries

This becomes especially important when AI systems can generate or execute code.

Restricted Tool Use

An AI agent should not automatically receive unrestricted access to every available tool.

A safer architecture applies:

least privilege

to AI just as it does to human users and traditional applications.

For example, an agent responsible for reading inventory information may need database read access.

It may not need permission to modify customer records.

Tool permissions should therefore reflect the agent's actual function.

Memory Security

Modern AI systems may retain:

  • Conversation memory

  • User preferences

  • Task state

  • Retrieved context

This information can become another security boundary.

Security teams should consider:

memory isolation, session scope, retention and cross-user leakage.

One user's memory should not accidentally influence another user's session.

AI Agent Security

AI Agents introduce another major security challenge.

Unlike a simple chatbot, an agent may:

understand a goal → plan steps → use tools → access systems → perform actions

This expands both capability and security risk.

Security teams therefore need to protect not only model responses but also:

agent identity, permissions, memory, tools and action chains.

Multi-Agent System Security

Multi-agent architectures may contain multiple specialized agents communicating with each other.

For example:

Planner Agent → Research Agent → Coding Agent → Execution Agent

Security questions now include:

  • Which agent can trust another?

  • How are identities verified?

  • Can an agent manipulate another agent?

  • Can memory be poisoned?

  • Which agent can execute actions?

Multi-agent security requires controls at the communication and orchestration layers.

Agent Identity Spoofing

If an agent accepts tasks from another agent, it must know whether the sender is legitimate.

AI architectures may therefore need stronger identity mechanisms.

Security concepts can include:

agent identity → authenticated communication → authorization → action validation

An autonomous environment without trustworthy identity can create significant security risk.

Signed Task Chains

Complex agent workflows may involve tasks passing across several systems or agents.

Maintaining trustworthy task history can help answer:

Who initiated the action?

Which agent modified the task?

Which tools were called?

What result was produced?

This improves traceability and supports incident investigation.

Autonomous AI Security Testing

The course also examines automated approaches to AI security testing.

Security teams increasingly need repeatable test suites covering AI-specific weaknesses.

A testing workflow might include:

Test Prompt → Response → Policy Evaluation → Failure Classification → Remediation → Regression Test

This brings software-security discipline into AI testing.

PyRIT and AI Red Teaming Workflows

The course introduces red-team workflows using modern AI security testing approaches.

Automated red teaming can help security teams evaluate large numbers of adversarial prompts and scenarios more efficiently than purely manual testing.

The objective is not simply to break an AI model.

The objective is to discover weaknesses that can then be mitigated and tested again.

Prompt Forensics

When an AI security incident occurs, teams need visibility into what happened.

Useful forensic information might include:

  • Prompt history

  • Retrieved context

  • Model response

  • Tool calls

  • Security decisions

  • Session information

Replay and forensic capabilities can help security teams reconstruct attack sequences and understand why a control failed.

GenAI Security Toolchains

Modern AI security rarely depends on one product.

Organizations may combine:

  • Guardrails

  • AI firewalls

  • AI-SPM

  • Red-team tools

  • Observability

  • Cloud security controls

  • Vector security

  • Agent security

A mature AI security architecture therefore resembles a security toolchain rather than a single defensive layer.

MLOps + SecOps for Generative AI

Generative AI security should integrate with the broader software and machine-learning lifecycle.

A useful lifecycle is:

Develop → Test → Deploy → Observe → Detect → Respond → Improve

Integrating MLOps and SecOps allows security checks to become part of continuous AI delivery.

This is important because AI applications evolve continuously as:

  • Models change

  • Prompts change

  • Retrieval data changes

  • Tools change

  • Agents change

Security must evolve with them.

Cloud-Native Generative AI Security

Many enterprise Generative AI systems run in cloud environments.

Security teams therefore need to combine AI-specific controls with established cloud security.

This may include:

identity, permissions, secrets, network controls, monitoring, logging and content filtering.

AI security should extend cloud security rather than operate independently from it.

Security Frameworks and Regulatory Requirements

The course also introduces security and regulatory considerations relevant to Generative AI environments.

Organizations may need to consider frameworks and requirements related to areas such as:

  • AI risk management

  • Privacy

  • Healthcare data

  • Operational resilience

  • Enterprise security

Security professionals should map AI controls to applicable organizational and regulatory requirements rather than treating Generative AI security as an isolated technical problem.

Responsible Generative AI Security

Security controls should protect AI systems without creating the assumption that any single safeguard makes an LLM completely safe.

A mature security model uses:

Defense in Depth

For example:

Identity → Data Access → Prompt Defense → Retrieval Security → Tool Restrictions → Agent Controls → Output Validation → Monitoring

Each layer reduces risk.

No single layer eliminates it.

Who Should Take This Course?

This course is designed for:

  • Cybersecurity Professionals

  • AI Security Engineers

  • Security Architects

  • Application Security Professionals

  • Cloud Security Engineers

  • DevSecOps Professionals

  • Red Team Professionals

  • Penetration Testers

  • SOC Professionals

  • AI Developers

  • Machine Learning Engineers

  • MLOps Professionals

  • Generative AI Architects

  • LLM Application Developers

  • RAG Developers

  • AI Agent Developers

  • Enterprise AI Governance Teams

  • Security professionals responsible for AI applications

Whether you work in cybersecurity, application security, cloud security, DevSecOps, AI engineering, LLM applications, RAG or agentic AI, this course provides a practical foundation for understanding and securing modern Generative AI architectures.

The objective is not simply to understand AI threats.

It is to develop a structured understanding of LLM security, prompt injection defense, AI firewalls, AI-SPM, secure RAG, vector security, sandboxing, AI agent security, multi-agent security, red teaming and GenAI security operations.

Who this course is for:

  • Cybersecurity professionals looking to expand their expertise into AI-driven threat models and GenAI-specific vulnerabilities
  • AI/ML engineers who are responsible for building, deploying, or managing LLMs, agentic workflows, and RAG systems
  • DevOps and SecOps teams seeking to integrate security into AI pipelines and enforce runtime controls
  • Cloud architects and solution designers deploying GenAI workloads on Azure, GCP, or AWS who need to ensure compliance and safety
  • Product managers and tech leads overseeing AI-based features, looking to embed “security by design” into product development
  • Governance, risk, and compliance (GRC) officers tasked with regulatory adherence for GenAI (GDPR, HIPAA, DORA, etc.)
  • Security researchers and red teamers interested in learning how to test, exploit, and defend agentic and LLM-based systems
  • AI product consultants and enterprise architects developing scalable and secure GenAI systems for clients or internal users
  • Tool developers or open-source contributors working on GenAI security tools, plugins, or orchestration frameworks