Zenity Raises $125 Million to Secure the Era of 1 Billion AI Agents

Build Time vs. Runtime: Why AI Security Needs Both

Portrait of Emily Wise
Emily Wise
Cover Image

Key Takeaways

  • Build time and runtime security solve different problems. One secures what you build before it ships. The other secures what an agent actually does once it’s live and interacting with real systems.
  • Static testing cannot see everything an agent will encounter in production. Red teaming and pre-deployment review catch known, reproducible flaws, but they cannot simulate every context, tool combination, or adversarial input an agent meets after launch.
  • The most damaging AI agent incidents happen after deployment, not before it. Prompt injection, tool misuse, and context poisoning are runtime problems that build-time controls were never designed to catch.
  • Runtime security moves the control point from approval to action. Instead of asking whether an agent was cleared to ship, it asks whether this specific action, happening right now, should be allowed.
  • Investing in only one layer leaves the other layer's risk uncovered. Closing the gap requires build-time and runtime controls working together, not a choice between them.

Build time vs. runtime is becoming one of the most important distinctions in AI agent security, and most organizations still treat it as one problem instead of two. Security teams have spent years hardening what happens before software ships, through code review, static analysis, and configuration checks. AI agents changed the equation. An agent that passes every pre-deployment test can still make a decision in production that no one approved, reach for a tool no one expected it to use, or act on an instruction no one wrote.

That gap between what gets tested and what actually happens once an agent is live is exactly where build-time controls run out of runway. Runtime vs. build-time security is not a matter of picking a side. It’s a matter of recognizing that each one catches a different class of failure, and neither one catches both.

What Build Time and Runtime Actually Mean

Every AI agent moves through two distinct phases, and each one carries its own security responsibilities. Understanding where one ends and the other begins is the first step toward closing the gaps between them.

What happens at build time

Build time covers everything that happens before an agent goes live: development, configuration, and testing, plus the decisions about what data it can access, which tools it can call, and what its intended scope actually is. This is where teams define an agent's permissions, wire up its connectors, and run whatever validation or review the release process requires. Build-time security asks a single question: is this agent, as designed, safe to ship?

What happens at runtime

Runtime starts the moment an agent goes live and begins acting on real inputs, in real systems, with real consequences. This is where an agent reads a document, calls a tool, retrieves data, or takes an action, often without a human reviewing each step. Runtime security asks a different question: is this specific action, happening right now, one this agent should be allowed to take?

The two questions sound similar, but they’re not. An agent can pass the first one completely and still fail the second one repeatedly, because the second question can only be answered in the moment the action is attempted.

Why the Risks at Each Stage Look Nothing Alike

Build-time and runtime security fail differently because they are protecting against different kinds of mistakes: design flaws you can catch by inspection, and behavioral failures you can only catch by watching what actually happens.

What goes wrong at build time

Most build-time failures come down to decisions that looked reasonable in isolation and turned out to be too broad in practice.

  • An agent is granted write access to a system when read access would have covered its actual task, because scoping permissions precisely takes more time than granting broad ones.
  • A new connector or plugin ships without a security review because it was added late in development and the release date did not move.
  • An agent's identity is never separated from a human user's or a shared service account, so there is no way to trace which agent did what once it is running.
  • Training or fine-tuning data goes unvalidated, introducing behaviors or blind spots that will not surface until the agent encounters the right, or wrong, input in production.

These are catchable. They are visible in code, in configuration, or in an architecture diagram, if someone is looking closely enough before launch. That is exactly why continuous AI Security Posture Management exists as its own discipline: it gives security teams a standing view of this kind of exposure, rather than relying on a single point-in-time review.

What goes wrong at runtime

Runtime failures are a different animal, because the agent is now interacting with things that didn’t exist, or couldn’t be predicted, at build time. Static tests and one-off benchmarks, the tools traditional application security relies on, are not built to catch behavior that only emerges through live, dynamic interaction. That’s the core problem with treating red teaming as a finish line instead of a starting point.

  • Prompt injection, where instructions hidden in a document, email, or API response get treated as legitimate commands because the agent cannot reliably distinguish content from instruction.
  • Context or memory poisoning, where information the agent accumulates over a session, or across many sessions, gradually pushes it outside the boundaries it started with.
  • Tool misuse in the moment, where an agent uses a capability it was granted for one purpose to do something else entirely, often after a single input manipulated it into combining tools in a way no one anticipated.
  • Unauthorized data access that happens exactly the way the system was designed to allow it, just triggered by an input nobody intended.

None of these require sophisticated malware or a network breach. They require text, timing, and a moment where nothing was watching.

The Attacks That Only Show Up After Deployment

Consider a sales assistant agent connected to a CRM, an email inbox, and an internal dashboard. During build time, the agent passed every scoping review: it can read customer records, draft emails, and pull dashboard metrics, nothing more. Nothing about that design is wrong.

At runtime, the agent processes an inbound email that includes a block of text formatted to look like an internal instruction, telling it to forward a customer's full account history to an external address for verification. The agent has no reliable way to know that the instruction did not come from someone authorized to give it. It already has the tool access to comply, and the instruction sits inside content the agent was designed to read. Nothing in the build-time review would have caught this, because the vulnerability is not in how the agent was built. It is in what the agent was asked to do once it was live.

This is part of why prompt injection remains, as several security researchers have put it, unresolved at the model level: instructions and data share the same channel, so filtering one from the other reliably is not a problem pre-deployment testing can fully close on its own. A runtime detection and response layer that inspects what an agent is actually doing, in the moment, is the only place this kind of manipulation can be caught before it turns into an incident.

Why the Distinction Matters for Security Teams

The gap between build-time confidence and runtime reality is measurable, and it is wide. A 2026 Zenity and Cloud Security Alliance survey of 445 IT and security professionals found that 53% of organizations have had AI agents exceed their intended permissions, acting outside the scope they were built for. Nearly half, 47%, had already experienced a security incident involving an AI agent in the past year, and when incidents did occur, detection and response often stretched into hours or even days.

Confidence at launch doesn’t predict safety in production. Security teams that treat a passed build-time review as the end of the job are the ones showing up in that 88%. Most of the work happening today is concentrated at build time, while most of the measured risk is showing up at runtime.

Part of the reason the gap persists is that agents are still, in most environments, treated like features instead of like Shadow AI waiting to happen: something approved once rather than something continuously governed. An agent that behaves exactly as designed for months can still be manipulated into acting outside its intended scope the moment the right input reaches it, and if nothing is watching for that moment, no one finds out until after the fact.

Intent is not control. An agent designed with the right intent and the right permissions can still be pushed into the wrong action by content it was never built to reject. Runtime security exists to catch that gap between intent and behavior in real time, not after the fact.

Why You Need Both, Not One or the Other

Build-time and runtime security are not competing priorities. They cover two different halves of an agent's life, and skipping either one leaves the other half of the risk uncovered.

Stage

Risk

Real-World Example

Why It's Missed at That Stage

Build time

Over-privileged tool access baked into agent design

An HR agent is configured with write access to the entire employee database when it only needs read access to one table.

Static review focuses on whether access was granted, not on how it will be used in practice.

Build time

Insecure or unvetted third-party integrations

A connector is added late in development without a security review because the release date is fixed.

Time pressure compresses architecture review into a checkbox.

Runtime

Prompt injection via untrusted content

A sales assistant agent reads an email containing hidden instructions and acts on them as if they came from an authorized user.

The instruction looks identical to a normal one at the code level, so no static rule can flag it in advance.

Runtime

Context or memory poisoning

An agent's accumulated conversation history is manipulated over many turns until it takes an action outside its intended scope.

The manipulation happens gradually, across a session, not in a single input.

Detection after exfiltration is not security. Runtime protection is what allows a security team to intervene before an agent finishes an action, not just log what happened after the fact. But runtime protection without build-time discipline is just as incomplete: an agent that was over-permissioned from day one gives an attacker a much bigger blast radius to work with once they find a way in.

Consider an HR agent that processes employee documents on a weekly cycle. If build-time review never questioned why it has write access to the compensation database, that is a standing risk regardless of how well runtime controls are tuned. And if runtime protection isn’t watching for the moment someone manipulates that agent into using that access outside its normal pattern, the build-time review will not matter either.

Defense in depth, applied from build time to runtime, means neither layer has to be perfect on its own.

Securing AI Agents From Build Time to Runtime

The agent is the new endpoint. It is the system executing actions, calling tools, and making decisions inside your environment, and it needs security controls that follow it through both halves of its life: the review before it ships and the enforcement while it runs.

Want to see where your AI agents' build-time approvals stop covering their runtime behavior? Book a demo to see full-lifecycle AI agent security in action.

FAQs About Build Time vs. Runtime AI Security

What kinds of AI failures and attacks can only be caught with deep runtime observability?

Failures that depend on live context, such as prompt injection triggered by a specific document, gradual context poisoning across a long session, or an agent combining two permitted tools in an unpermitted way, only take shape once the agent is running against real data. Build-time testing can rule out known attack patterns, but it cannot observe a failure that only emerges through actual interaction with production inputs. Deep runtime observability closes that gap by watching an agent's decisions, tool calls, and data access as they happen, not as they were predicted to happen.

What is AI runtime protection, and why can't pre-deployment testing alone secure AI systems?

AI runtime protection evaluates and enforces policy on an agent's actions in real time, at the moment it tries to take them, rather than relying solely on approvals granted before deployment. Pre-deployment testing, including red teaming, is a point-in-time exercise that validates a system against scenarios someone thought to test, but AI behavior shifts with context, phrasing, and the data it encounters. Research cited by AGAT Software on AI agent security found that fine-tuning attacks alone stripped away model-level guardrails in the majority of controlled test cases, which is why testing at build time, however rigorous, cannot substitute for controls that operate continuously once an agent is live.

What happens when an AI system is manipulated at runtime with no protection in place?

Without runtime protection, a manipulated agent completes whatever action it was pushed toward, using the real credentials and real access it already has, because nothing is positioned to intervene before the action executes. Security teams typically discover what happened only through downstream effects: data that surfaces somewhere it should not, a customer report, or an audit that flags the anomaly weeks later. By that point, the response is forensic instead of preventive.

How do you implement runtime protection for AI applications without introducing unacceptable latency?

The practical approach is to apply the heaviest inspection to the actions that carry the most risk, such as data exfiltration, external communication, or write access to sensitive systems, while letting low-risk, well-understood actions proceed with lighter checks. Policy enforcement that sits inline with tool calls, rather than as a separate post-hoc review step, keeps added latency close to the cost of a single additional call. Risk-based tiering, not blanket inspection of every action, is what keeps runtime protection usable at production scale.

What signals indicate that an AI system is being actively manipulated or abused at runtime?

Common signals include an agent calling tools or accessing data outside its normal pattern for a given task, a sudden shift in the source or structure of the instructions it is acting on, repeated attempts to reach a resource it was previously denied, and output that references content the agent had no reason to retrieve. Individually, some of these can be benign. Evaluated together against a behavioral baseline, they are the clearest early indicator that something other than the intended workflow is driving the agent's actions.

How should runtime AI threats be triaged and escalated within a security operations workflow?

Runtime findings should be triaged by the sensitivity of what the agent touched, the reversibility of the action, and whether the behavior matches a known pattern or looks novel. Findings tied to regulated data, financial systems, or irreversible actions should escalate immediately to a human reviewer, while lower-risk anomalies can queue for batch review. Feeding confirmed incidents back into both the runtime policy and the build-time review process keeps the triage workflow from surfacing the same finding indefinitely.

What does a layered runtime defense strategy look like for a large-scale AI deployment?

At scale, layered runtime defense combines identity-aware policy enforcement at the point of every tool call, behavioral baselining to flag deviations from an agent's normal activity, and inline prevention that can block a risky action before it completes rather than only logging it afterward. No single layer catches everything on its own, which follows the same logic as defense in depth in traditional security. The difference with AI agents is that each layer has to evaluate intent and context in real time, not just match a known signature.

How do you maintain runtime protection across AI systems that are updated or retrained frequently?

Runtime protection has to be tied to continuous behavioral baselining rather than a fixed rule set, because a model update, a new fine-tuning pass, or an added tool can shift an agent's behavior in ways a static policy will not anticipate. Re-validating an agent's runtime baseline after every meaningful change, the same discipline good build-time regression testing already applies, keeps protection aligned with what the agent actually does today. Treating runtime protection as a one-time setup rather than an ongoing practice is one of the most common gaps security teams overlook.

What mechanisms exist for enforcing AI boundaries at runtime versus at the model level?

Model-level boundaries, such as alignment training and built-in refusals, shape what a model will attempt, but they operate inside the model and can be degraded by fine-tuning or bypassed by a sufficiently crafted input. Runtime boundaries operate outside the model, at the point where an agent tries to call a tool, access data, or take an action, and they enforce policy regardless of why the model attempted it. This is the logic behind combining hard boundaries an agent cannot cross under any circumstance with soft guardrails that adjust to context and risk.

All Academy Posts

Secure Your Agents

We’d love to chat with you about how your team can secure and govern AI Agents everywhere.

Get a Demo