Agent Immunization: A New Model for Building Trusted AI Agents

The riskiest thing agents do all day isn’t writing code; it’s “shopping”. Every minute, they reach out to the internet for a package, a plugin, or an MCP server and consume them with no verification or guarantee of what’s inside.

Most of the industry is trying to make agents “shop” safely from the outside by placing a guardrail around the agent’s reasoning, a scanner bolted externally to the supply chain, or a sandbox wrapped around the agent. Each covers a small slice of the problem, but each one also leaves the biggest problem untouched, because none of them control what the agent actually consumes and builds.

As we know in biology, you don’t keep a body healthy with a single line of defense. Immunity comes from multiple lines of defense: knowing what belongs and what doesn’t, neutralizing threats fast, and blocking entry outright. You have to build immunity: it’s layered, intrinsic, and always on.  That’s what agents need too. We call it Agent Immunization and Control, your safest way to build a trusted agentic workforce.

An Agent is Only as Trustworthy as What It Consumes and Builds

Strip away the buzz, and a coding agent is basically software writing software. What it builds is software: The code, services, and releases it produces. What it consumes is software as well: The tools and components (e.g., MCP servers, agent skills) it pulls in to do the job. All of these are artifacts moving through your supply chain, and they carry risk that was there to begin with.

The risk manifests in a couple of ways:

1. An AI asset can be poisoned, carrying hidden prompt-injection instructions that hijack any agent that loads it.

  1. An AI asset can simply be vulnerable, a component with a known flaw, never malicious, but dangerous all the same. The agent can’t tell the difference. Neither can anyone downstream, once it’s already been consumed.

It’s important to emphasize that an agent can’t correct itself in the way a human developer does. A programmer carries years of experience regarding which tools are sanctioned and what’s off-limits. An agent simply does not have that knowledge. Nobody has told it, in an enforceable way, what it may or may not use, so every choice defaults to no limitations. The agent will try anything to finish the task, even things a person would reject on sight.

Why Guarding the Agent From the Outside Isn’t Enough

Three popular approaches dominate how agents are protected. Each is useful, but none is sufficient alone.

  1. Guard the reasoning. Prompt firewalls and injection filters watch what goes into the agent’s reasoning. They’re necessary, but don’t instruct the agent regarding what it can and can’t do. You can filter every prompt perfectly and still allow the agent to load a backdoor skill and ship compromised software.
  2. Add a separate AI security tool. Bolt on a standalone AI scanner or gateway, and now you have two supply chains: one for software, and one for AI assets. Each has its own policy and audit trail, which creates the very gaps that can be used to launch attacks.
  3. Sandbox the agent. While isolation limits where an agent can reach, it doesn’t change what the agent consumes or produces. The bad artifact still gets built in, and it still ships.

The pattern is the same every time: Trust is applied from the outside, after the fact, sitting apart from where the software actually gets built. Immunity doesn’t work that way; it has to be engineered in.

What Multi-Layered Protection Actually Is

Immunization and control aren’t just one checkpoint. It’s a set of layers, where each layer picks up where the previous one leaves off. What’s most important is that all of the layers are intrinsically part of the supply chain where the agent already works.

Diagram illustrating four defense-in-depth security layers for AI agents.
Securing AI agents relies on a four-layer defense-in-depth security model: scoped identity, in-agent enforcement, vetting before pulling assets, and network-level interception.

 

Let’s take a closer look at these layers.

Layer 1: Give every agent an identity and scope according to its tasks

The most sophisticated thing an immune system does is differentiate between itself and foreign entities in a precise, targeted manner. Every agent gets a verifiable, cryptographically rooted identity, based on the actual tasks it is required to do. The scope is further refined by what the agent is allowed to do, how often, and which resources it requires. So when an agent acts, you know its identity, whose authority it acts under, and what it touched. This way, no agent inherits access that goes beyond the scope of its task.

Layer 2: Vet before the pull

Once traffic is routed through, the controls you already trust inspect it. Every asset an agent reaches for, whether it’s a package, dependency, or MCP server, is untrusted until proven otherwise. This places your existing curation and scanning at the point of request, as an allow-or-block action, rather than a runtime alert fired after a poisoned tool has already run. This is innate immunity: A fast, nonspecific screen that recognizes what’s known to be dangerous and neutralizes it before it spreads. This ensures that your AI assets pass through the same screening your software already does, with no AI exception.

Layer 3: Enforce in the agent’s environment

A rule only matters where the work happens. Because agents operate inside their own tool environments, enforcement has to live there too; native to the agent, so it can only ever consume the skills, tools, and connectors you’ve approved. This is the response mounted right at the point of contact, in the tissue where a pathogen tries to enter, rather than somewhere upstream. It’s also the layer that makes the others hold.  Even a single overlooked or misconfigured path is caught, because enforcement is inside the agent instead of a barrier wall it can circumvent.

Layer 4: Intercept at the network level

The final layer is the boundary itself. Left alone, agents and developers reach straight past your controls to public registries. Agents especially are known to bypass pre-defined configurations to get what they want. So the outermost layer sits at the network: intercept those requests and reroute them back through your system of record by default, so no pull escapes governance no matter how the agent was set up.

Defense Has to Live Inside the Agent’s Toolchain

However, multi-layered defense only works if it reaches the agent through the agent’s own tools and interfaces, meaning the same plugins, harnesses, and coding-agent surfaces that are part of the development environment. It’s simply not effective to impose safeguards from the outside. Agents only use what’s in their path, so trying to control them using an external human checkpoint is a control the agent never sees and simply routes around.

Beyond Barriers: Immunization and Control

Agents move at machine speed. Human review can’t provide a gate for every step, and a barrier around the perimeter can’t either. The organizations that will thrive in the agentic era aren’t the ones with the most advanced agents; they’re the ones whose advanced agents are trustworthy enough to make agentic autonomy an advantage instead of a risk.

This model is the key to building a trusted agentic workforce: Intercept what agents pull at the network, vet it before the pull, enforce approved-only AI assets inside the agent, and give every agent a scoped identity for what it does. Add overlapping layers to eliminate gaps that are delivered through the tools the agent already runs on, and you’ve got pretty formidable protection.

Let’s stop caging our agents. Let’s immunize them and let them run.

Learn more about JFrog’s products and solutions for agent immunization and control, or schedule a meeting with one of our solution engineers today.