29. Security Of, From and Using AI

Now that everyone HAS to take security seriously - let’s see what we can do about it TODAY.

While I worked at Google during the publishing of this post / video, the views expressed here are my own and may not reflect those of my employer. Only publicly available material is used to put together the content of this article. The website and the Youtube videos are NOT monetized.


Many media outlets called this month the Black October due to various cybersecurity issues and attacks discovered. Regardless of what you call it1, I am glad there seems to be a consensus that security from and more importantly using AI needs to be at the forefront.

Before I lose your attention, let me provide you everything you need to know (and act) in the next few (less than 100) lines.

Intersections of AI + Security

The intersection of Security and AI is at three points. Security Of AI, From AI and Using AI.

Security Of AI - Securing your own AI (training data, pipelines, model weights, endpoints, AI-enabled applications and agents) and your AI supply chain against at least the Top 10 LLM and top 10 Agent attacks.

Security From AI - Securing your (and or your customers') access, infrastructure, data, and applications (AI apps or otherwise) from adversaries that are using AI-enabled attacks at an unprecedented scale.

Security Using AI - Securing against traditional and AI-enabled threat actors using AI by being extremely proactive and deliberate about it.

Let’s be on the same page

Before I give you what you can do next, here are two ground realities from my over a decade in Cybersecurity and Sovereignty (1, 2) and recent few years of AI + Security work:

  1. The Dual-Stack Burden: For the foreseeable future, enterprises and governments still have to operate and defend their traditional stack (core banking, citizen portals, email, chat, SaaS, legacy databases). AI (models, MCP servers, autonomous agents, RAG pipelines) is additive—you haven’t replaced the old attack surface; you’ve expanded it! You have to protect both.
  2. The 3-Way Threat Multiplier:
    • Speed: Traditional threats now run at AI velocity—Mean Time to Exploit (MTTE) has collapsed from weeks to hours.
    • The Insider Agent: You must protect your AI from turning on you (prompt injections, unauthorized tool execution, silent data exfiltration).
    • Outgoing Liability: If your agent or exposed toolchain is hijacked to attack partner networks, customers, or critical infrastructure, you carry the regulatory, sovereign, and financial liability.

The 20% effort that gives 80% back (and beyond)

Note - Medium and large enterprises should do everything that small enterprises are advised plus what’s advised specially to them

1. Security using AI

I moved this above others because

  1. Using AI is the only way to protect yourself against AI-enabled threats at the AI scale
  2. AI-augmented defnese/prevention protects both AI and non-AI applications and infrastrcuture against both legacy and modern threats.

Do this in short term -

ActionWhat It IsSmall Enterprise / StartupMedium + Large Enterprise (Includes Small +)
1. Visibility & Asset Discovery (including Shadow AI)Can’t protect what you don’t know exists. Continuous discovery of on-prem, multi-cloud, SaaS, shadow IT, Shadow AI (unsanctioned consumer LLMs, rogue browser extensions, untracked API keys), and software components (SBOM).Prompting AI agents over cloud billing exports, DNS records, and GitHub dependency graphs to surface untracked SaaS, Shadow AI, and services; open-source SBOM tooling. Using Asset inventory tools available on Cloud Providers (e.g. Cloud Asset Inventory on GCP)CSPM and CAASM products
2. Attack Surface Management (ASM)Continuous external reconnaissance of all internet-exposed domains, IPs, APIs, and their running versions.AI-assisted reconnaissance scripts (Shodan/Censys/Amass APIs) with LLM-generated exposure summaries and alerts.Use products like Wiz ASM and Wiz Red Agent
3. LLM-based Code ScanningScanning code and PRs for semantic vulnerabilities, business-logic flaws, and hardcoded secrets beyond/addition to static checks.Developer-assisted LLM reviews in PR comments (e.g., Gemini / Claude code reviews), AI-augmented Semgrep2 rules.Products like Codemender, Wiz AI SAST and Green Agent.
4. AI assisted SOC (Security Operations Center)More attacks means more alerts means more alert fatigue means losing out real alerts for mundane noise. Use AI to correlate, deduplicate, and summarize high-volume alert firehoses into actionable timelines.Routing alerts from cloud logs/SIEM to an LLM agent that outputs incident summaries directly into your collaboration platform (e.g. Slack/Teams).Agentic SOC & SOAR platforms like Google SecOps, Wiz Blue Agent
5. AI-assisted Vulnerability ManagementEnd-to-end vulnerability lifecycle for 1. Code, 2. VMs and 3. Cloud + SaaS (misconfigurations): applicability checking, blast radius analysis, patch/fix creation and validation.Feeding CVE advisories and codebase/OS SBOMs into an LLM to check if vulnerability is applicable and what the blast radius could beProducts like Wiz UVM, Crowdstrike Falcon Spotlight

Do this in the long term - Build on the foundations that you created in the short term

  1. Building a map/knowledge graph of entities (infrastructure items, applications, services and identities) and their relationships (reachability, IAM access). Products like Wiz Cloud provide this out of the box with Wiz Security graph. Hugely influential in figuring out the blast radius and priority when needed.
  2. Continuous AI Assisted Automated Red-Teaming (CART) for production systems, API contracts, and IAM policies 24/7/365, reporting vulnerabilities before external actors find them. Proactively and Deliberately do what your adversary would do but with more internal context than the attacker - you will always be ahead in finding and fixing holes in your system.
  3. Develop an AI-assisted Scan - Remediate - Monitor loop (check AI Threat Defense)

2. Security from/against AI

Quick Note - This includes defending against your own (compromised) AI as well.

Do this in short term -

ActionWhat It IsSmall Enterprise / StartupMedium + Large Enterprise (Includes Small +)
1. Know Your User (Human vs. Agent & Scoped Agency)Distinguishing human vs. agent sessions in real time and enforcing strict permission boundaries on sanctioned agents. Knowing the human customer behind the agent.Bot-detection challenges (Cloudflare Turnstile, reCAPTCHA v3); user-configured read-only API scopes for third-party AI tools (your applications need to implement non-human user detection and policy engine configuration).Enterprise Bot Management & API protection products (e.g., Cloud Armor, Akamai); OAuth 2.0 Rich Authorization Requests (RAR), mTLS, and explicit human step-up auth for destructive actions. Products like Transmit Mosaic can help in AI/Bot detection and dynamic access.
2. Impeccable Traditional Security HygieneEliminating basic unpatched vulnerabilities (SQLi, SSRF, exposed buckets, open ports) that AI fuzzers chain in seconds.Automated Dependabot/Renovate PRs, blocking public storage buckets, least-privilege cloud IAM, shutting down unused exposed ports.Continuous CSPM/CIEM policy enforcement, automated reachability analysis, and rapid virtual patching at the WAF/API gateway tier.
3. Developer & Employee AI Hygiene (Endpoint & Machine Security)Developer and employee machines are generally privileged (holding SSH keys, cloud tokens, git access). Mitigating risks of IP/PII leakage to public AI providers via browsers, unvetted IDE extensions/agents, and developers committing vulnerable code.Mandate enterprise-tier AI tools with zero-data-retention agreements; strict rule: verify package author, age, and downloads before installing AI-suggested packages; avoid long-lived credentials on local machines.Deploy enterprise AI gateways / proxies and endpoint AI protection tools like Falcon AIDR to inspect outbound LLM prompts for secrets and PII; enforce CI/CD dependency firewall gates against newly registered or hallucinated packages.
4. Internal AI ContainmentPreventing internal agents from becoming malicious insiders via indirect prompt injection or context poisoning.See next sectionSee next section

Do this in the long term -

ActionWhat It IsSmall Enterprise / StartupMedium + Large Enterprise (Includes Small +)
1. Phishing-Resistant MFA & PasswordlessEliminating phishable credentials (passwords, SMS, authenticator OTPs) to neutralize AI voice cloning, deepfakes, and adversary-in-the-middle (AiTM) proxies.Mandate Passkeys or FIDO2 hardware keys (e.g., YubiKey) for all core SaaS, IdP, and developer cloud consoles.Enterprise-wide FIDO2/WebAuthn migration via Okta/Entra ID conditional access; complete passwordless roadmap; deprecate SMS/push fallbacks; out-of-band verification for high-risk actions.
2. Elastic Edge Defense (Absorb AI Swarms)Moving beyond static IP rate-limiting to behavioral, intent-based edge defenses that absorb distributed, polymorphic AI bot swarms.Managed cloud edge rules (e.g., Cloudflare Bot Management / AWS WAF Bot Control) with dynamic challenge rate-limiting.Advanced adaptive protection (e.g., Google Cloud Armor Adaptive Protection, Akamai) continuously modeling baseline traffic to auto-mitigate machine-speed L7 floods.
3. Autonomous Containment & Circuit BreakersAutomated zero-trust isolation that quarantines compromised microservices and revokes tokens at machine speed when AI exploits occur.Automated alerts triggering webhook-based token revocations (most IDPs support this) or cloud firewall rule drops for compromised API keys.Autonomous SOAR / zero-trust orchestration that isolates compromised VPC workloads, revokes IAM service-account credentials, and contains blast radiuses in seconds.

3. Security of AI

Quick reminder: The risk is rarely to the model or weights in isolation—the real risk is to your data, your customers, your reputation, and your infrastructure being weaponized against others via your exposed AI endpoints, tools, and agents. Also it is assumed that your impeccable traditional security (mentioned in the section above) has done the heavy lifting to secure your / your customers data that might be used for training your AI / by your AI (e.g. RAG applications)

Do this in short term -

ActionWhat It IsSmall Enterprise / StartupMedium + Large Enterprise (Includes Small +)
1. Intent Gating & Least Agency (Tools & MCPs)Enforcing strict least-privilege tool profiles, disabling raw shell/destructive commands, and requiring Human-in-the-Loop (HITL) for high-impact actions.Read-only tool configurations by default; requiring explicit confirmation before executing state-changing tools (e.g., ADK tool confirmation).Enterprise Agent Gateways (see Agent Gateway) and Policy Enforcement Points (PEP) enforcing dynamic Attribute-Based Access Control (ABAC), scoped ephemeral tokens per tool call, and strict egress allowlists on MCP servers (e.g. see Manage MCP servers and tools).
2. Input/Output Guardrails & Data MaskingIn-line screening of prompts and completions for jailbreaks, PII leakage, prompt injections, and unsafe content before reaching the model or user.Open-source guardrails (e.g., NeMo Guardrails, Llama-Guard) + prompt XML structure isolation (<rules>, <data>).Enterprise guardrail firewalls like Model Armor and Cloud DLP for real-time PII redaction, jailbreak blocking, and latency-optimized token filtering.
3. RAG & Embedding Hygiene (Anti-Indirect Injection)Sanitizing and validating data before vector embedding to prevent clandestine instructions from poisoning retrieved context and hijacking agent goals.Pre-embedding sanitization; stripping hidden markdown, prompt injection patterns, and invisible zero-width unicode before chunking.Document-level ACL-aware vector search, automated context quarantine, and continuous ingestion scanning verifying data provenance before indexing into production vector DBs.
4. AI-SBOM (Model & Tool Supply Chain)Tracking model versions, checkpoint hashes, fine-tuning datasets, and MCP server registries to prevent silent dependency poisoning.Pinning exact model release versions (avoiding latest floaters), verifying SHA256 checksums of downloaded model weights and MCP servers.Enterprise AI-SBOM cataloging all foundation models, LoRA adapters, training data lineages, and approved internal MCP tool registries.
5. Continuous Agentic & Regression EvalsAuditing agent execution trajectories and tool usage for goal drift, plus mandatory regression evals before bumping model versions (e.g., moving from one model to next) for both LLM apps and agents.Using evaluations for trajectory and tool validation (see Why evaluate?); automated prompt eval suites in CI/CD before updating model API pins.Automated LLM-as-a-judge observability pipelines (e.g. Vertex AI Gen AI Evaluation) continuously scoring live agent trajectories, plus golden-dataset regression pipelines gating every model migration.

Do this in the long term -

ActionWhat It IsSmall Enterprise / StartupMedium + Large Enterprise (Includes Small +)
1. Dual-LLM Architecture (Privileged vs. Quarantined)Architectural separation of the “Privileged Reasoning/Tool Brain” from an isolated “Quarantined Parser” that sanitizes untrusted external data (webpages, emails) into neutered schemas.Running a lightweight secondary LLM solely to parse and extract JSON from raw web data before feeding it to the primary agent so you don’t accidently/ indirectly prompt inject your main model call for runtime instruction or when training.System-wide tiered agent topologies with strict zero-trust boundary controllers preventing privileged models from ever ingesting raw untrusted tokens directly.
2. Know Your AI Supply Chain & Provenance (Anti-Rogue Model)Ensuring you never run a rogue model or untrusted MCP server, and proving the authenticity/origin of your generative outputs.Pinning trusted model repositories and official vendor endpoints; verifying checksums; enabling platform-native output watermarking.Cryptographic signing of internal fine-tuned weights and LoRA adapters; end-to-end provenance pipelines; enterprise watermarking (e.g., SynthID / green tokens) across all outputs to prevent IP disputes and trace leakage.

Conclusion

The Bad

  1. Adversaries have AI now: The barrier to entry for cybercrime has collapsed. Automated reconnaissance, instant vulnerability fuzzing, and hyper-personalized spear-phishing mean anyone can hack, hack faster, and attack anyone at machine speed.
  2. Ignorance is no longer an excuse: Courts, regulators, and your customers will not accept “the AI did it.” You and your leadership are on the hook for:
    • Unauthenticated or Unattributed AI Access: Exposing model endpoints, agent runtimes, or MCP servers without strict authentication, or letting autonomous agents interact with production data and external APIs without verifying the real human identity legally behind the request.
    • Zero Observability and Governance: Failing to log, monitor, and define explicit policy boundaries (who is allowed to do what—and who is blocked) across the entire chain: Human $\leftrightarrow$ Agent $\leftrightarrow$ Tools (MCPs, APIs) $\leftrightarrow$ LLM.
    • Passing the Blame for Your AI’s Actions: Blaming an autonomous agent for an outage, a data breach, or an unauthorized transaction does not hold up in court or with regulators. Your AI is your infrastructure; you own its liabilities.
    • Deploying What You Don’t Understand: Shipping, using, or providing anything to customers—whether code, automated workflows, or critical decisions—that nobody on your team understands because “the AI generated it."

The Good

  1. Traditional, scalable security solves the vast majority of threats: The fundamentals—Safe Code (with SAST), mature vulnerability management (for infra, PCP and SaaS configurations and code) least privilege, zero trust, rapid patching, network segmentation, and phishing-resistant MFA—are proven, largely solved engineering practices. They were often deprioritized in the past because “not everyone had the skill to hack.” Now that AI democratizes exploitation, rigorous security hygiene is no longer optional; it is your baseline armor.
  2. You can fight AI with AI (The Defender’s Advantage): Asymmetry does not have to favor the attacker. You have an insurmountable structural advantage that external adversaries will never have: deep internal visibility, ground-truth context, and proprietary telemetry into your own architecture. When you pair proactive, continuous AI defense with your internal knowledge graph, you can detect, contain, and remediate threats long before an adversary maps your perimeter.

The Everyday

  1. Watch out for security bulletins for attacks, threat actors, and vulnerabilities. If you have a system that tells you whether a bulletin applies to you, what the blast radius is, and how to fix it—you are already in great shape, especially if this is automated and AI-assisted!

Thank you for reading through!

Please share 🔗 if you think it’s useful! And please comment ✍ if you want to discuss more!

— Nikhil

Further Reading & Resources

Here are the essential frameworks and deep dives across each dimension:

The Foundational Top 10 Frameworks (Click to expand)

Security Using AI (Click to expand)

Security From/Against AI (Click to expand)

Security Of AI (Click to expand)

Acronyms & Terminology Glossary

Click to expand full glossary table (25+ terms)
AcronymFull FormQuick Context
ABACAttribute-Based Access ControlDynamic access decisions based on user, resource, action, and session attributes.
ACLAccess Control ListGranular permissions attached to objects specifying authorized users and operations.
ADKAgent Development KitGoogle framework for building, testing, and evaluating autonomous AI agents.
AIDRAI Detection and ResponseEndpoint and network security monitoring and mitigating AI/LLM-related threats.
AiTMAdversary-in-the-MiddleReverse-proxy phishing attack that intercepts session tokens (thwarted by FIDO2).
ASMAttack Surface ManagementContinuous discovery and risk analysis of all internet-exposed digital assets.
CAASMCyber Asset Attack Surface ManagementUnified internal inventory of cloud, on-prem, SaaS, and device assets.
CARTContinuous Automated Red-Teaming24/7 autonomous probing of production systems to uncover exploitable flaws.
CIEMCloud Infrastructure Entitlement ManagementGovernance of cloud IAM roles, service accounts, and least-privilege permissions.
CSPMCloud Security Posture ManagementAutomated compliance and misconfiguration detection across multi-cloud environments.
CVECommon Vulnerabilities and ExposuresStandardized public catalog of known cybersecurity vulnerabilities.
FIDO2Fast Identity Online 2Open authentication standard enabling cryptographic, phishing-resistant Passkeys.
HITLHuman-in-the-LoopMandatory human verification gate before executing critical or destructive actions.
IAMIdentity and Access ManagementFramework governing user identities, authentication, and access privileges.
MCPModel Context ProtocolOpen standard enabling models to dynamically query tools and context sources.
MTTEMean Time to ExploitTime elapsed between vulnerability disclosure and its first weaponized exploit.
OWASPOpen Worldwide Application Security ProjectGlobal foundation establishing standards for application and AI security.
PEPPolicy Enforcement PointGateway component that enforces access policies before tool or API execution.
RAGRetrieval-Augmented GenerationEnriching LLM prompts with dynamic data retrieved from vector databases.
RARRich Authorization RequestsOAuth 2.0 extension for expressing fine-grained transaction authorization details.
SASTStatic Application Security TestingAnalyzing source code to find security vulnerabilities without executing the program.
SBOMSoftware Bill of MaterialsFormal inventory of all third-party software, libraries, models, and dependencies.
SIEMSecurity Information & Event ManagementCentralized platform aggregating and analyzing enterprise security event logs.
SOARSecurity Orchestration, Automation, & ResponseAutomated workflows for triaging, investigating, and containing security incidents.
SOCSecurity Operations CenterThe team and facility responsible for monitoring and defending enterprise security.
SSRFServer-Side Request ForgeryFlaw where a server/agent is coerced into sending unintended network requests.
UVMUnified Vulnerability ManagementEnd-to-end prioritization, reachability, and remediation of system vulnerabilities.

  1. Our society is long overdue to retire equating ‘black’ with disaster or malice. ↩︎

  2. Semgrep rules are fast, open-source static analysis patterns written in YAML that scan source code for security vulnerabilities, bugs, and anti-patterns. Check here for more. ↩︎

comments powered by Disqus