Securing the Agent Harness

Start with a number. An agent that opens 1,000 pull requests a week at a 1% vulnerability rate ships 10 new vulnerabilities every week — quietly, confidently, indefinitely. That’s the uncomfortable arithmetic of autonomy: a small per-action error rate, multiplied by machine-speed volume, becomes a steady stream of security holes. A human writing ten PRs a day can’t produce vulnerabilities fast enough to matter at that scale. An agent fleet can.

This reframes the whole problem. Security for AI agents isn’t a model-quality question you can solve with a better prompt. It’s a systems question, and the answer to “how do I keep this safe?” is the same answer we’ve used for every other dangerous-at-scale system: build the controls into the workflow so they can’t be skipped, and contain the blast radius for when — not if — something goes wrong. As the field’s bluntest formulation puts it: autonomy without security is an automated vulnerability.

You’re securing a harness, not a model

The single most useful mental shift in this entire topic: you cannot fully secure the model, so secure the harness instead.

The “harness” is everything around the model — the runtime scaffold that turns a text predictor into something that acts: its tools, its permissions, its credentials, its sandbox, its network access, the context you feed it, and the gates between it and the real world. The model is the part you can’t make trustworthy (more on why in a moment). The harness is the part you can engineer, and it’s where all real agent security lives.

Diagram illustrating the concept of securing the harness rather than the model, highlighting tools, sandbox, credentials, context & data, network, and human & policy gates.

Why can’t you just secure the model? Because of a result every agent builder should internalise. A 2026 joint study by OpenAI, Anthropic, and Google DeepMind — titled, ominously, “The Attacker Moves Second” — found that under adaptive attack conditions, every published prompt-injection defence was bypassed with success rates above 90%. You cannot prompt-harden your way to safety. The only robust posture is to assume the model will be compromised and build controls outside it that contain what a compromised model can do. This is the same shift the security industry made with malware a decade ago: stop trying to prevent every execution, assume breach, and focus on segmentation, least privilege, and blast-radius containment.

The blast radius principle

Here’s the principle that makes the harness concrete: an agent’s potential damage equals that of an employee holding the same credentials. If the agent can merge to main, it can ship a vulnerability. If it holds a production database token, it can drop a table. If it can make outbound network calls, it can exfiltrate data. The blast radius scales precisely with the privileges you hand it — and in 2026 that’s not hypothetical. In April 2026, a coding agent reportedly wiped a startup’s production database. The damage wasn’t exotic; it was simply an over-privileged agent doing a destructive thing with credentials it should never have held.

So the first question for any agent isn’t “is it smart enough?” — it’s “what’s the worst thing it can do with what we’ve given it?”

Prompt injection: the attack that makes it real

The mechanism that turns “the model might be wrong” into “the model is now working for an attacker” is prompt injection — OWASP’s #1 LLM vulnerability, present in an estimated 73% of production deployments. It comes in two flavours:

  • Direct injection: malicious instructions in the user’s own message.
  • Indirect injection: malicious instructions hidden in external content the agent processes — web pages, documents, code comments, dependency docstrings, issue and PR bodies, API responses. This is the dangerous one for coding agents, because a coding agent’s entire job is to ingest untrusted content: the repo, retrieved docs, web search results, package documentation. Every one of those is an attacker-controllable input channel.

In agentic systems this gets worse, not better. The OWASP Top 10 for Agentic Applications 2026 introduces ASI01: Agent Goal Hijack — a single injected instruction doesn’t just corrupt one output, it reprograms the agent’s plan, redirecting its multi-step behaviour, triggering privileged tool calls, and persisting across the workflow. A real example landed in May 2026: a CVSS-10 vulnerability in Gemini CLI where a malicious package injected prompts through code comments and docstrings, causing the agent to execute arbitrary commands it believed were legitimate — indirect injection delivered straight through the software supply chain.

The lethal trifecta

The cleanest model for when prompt injection becomes a breach is Simon Willison’s lethal trifecta. An agent is structurally exploitable when it has all three of:

  1. Access to private data (your repo, your secrets, your database).
  2. Exposure to untrusted content (anything an attacker can influence — issue bodies, web pages, dependencies).
  3. The ability to communicate externally (an outbound channel — an API call, a curl, a public PR comment).
Venn diagram illustrating the concept of 'The lethal trifecta' with three circles labelled 'Private data', 'Untrusted content', and 'External comms', highlighting 'EXFILTRATION' in the overlapping centre.

When all three overlap, a single poisoned input becomes an exfiltration pipeline: the agent reads the malicious instruction, pulls your secrets, and ships them out the door — a confused deputy moving faster than your monitoring can react. Remove any one leg and the attack collapses.

And here’s the catch that makes this urgent for developers: a CI/CD pipeline contains the entire trifecta by default. Workflow secrets sit in the runner’s environment, every public issue and PR body is attacker-controlled input, and tools like gh or curl are ready-made exfiltration channels. The Gemini CLI exploit chained exactly this — injection through a public issue, credentials lifted from .git/config on disk, then a pivot to a token with write access. If you’ve added an AI triager or reviewer to your CI, you may have shipped a trifecta without noticing.

Why bolt-on security fails

Put the pieces together and the conclusion is forced. At 10 vulnerabilities a week, a quarterly pentest is laughably out of phase — you’d accumulate ~130 vulnerabilities between assessments. When the model can be compromised >90% of the time by an adaptive attacker, an after-the-fact review of its output misses the architectural problem entirely. And prompt injection, the field’s consensus holds, needs architectural fixes, not bolt-on filters. The numbers say teams know this and aren’t acting on it: an independent 2026 assessment of 100 production agents found only 11% passed a baseline security assessment, and 57% of organisations lacked the visibility to even audit their agents for the trifecta.

Security that’s added after the agent works is security that’s always behind the agent. The only posture that keeps pace is one where the controls are part of the harness from the first commit.

Building the Secure Harness

We’ve previously reached a conclusion, a design principle: assume the model is compromised, and contain the blast radius with controls outside it. Now, we’ll turn that principle into concrete architecture. The unifying idea is defence in depth — stack independent layers so an attack has to defeat every one of them in series, not just slip past a single clever filter. No layer is sufficient alone (adaptive attacks bypass even good classifiers >85% of the time); stacking them is how production contains risk.

The organising constraint: the Rule of Two

Before the individual controls, the design rule that ties them together. Meta’s “Agents Rule of Two” (October 2025) is the most actionable security constraint in agent design: within a single session, an agent should have at most two of these three properties:

  • (A) processes untrusted input,
  • (B) has access to sensitive systems or private data,
  • (C) can change state or communicate externally.
Diagram illustrating 'The Rule of Two' concept for managing input and access levels, featuring sections A (Untrusted input), B (Sensitive access), and C (External/write), with safety combinations and a warning about the lethal trifecta.

This is the lethal trifecta restated as a build rule. Keep all three apart and the trifecta never assembles. In practice that often means splitting one risky agent into two safe ones — a read-only agent that ingests untrusted content but holds no secrets and can’t reach the network, handing structured results to a write-capable agent that never touches untrusted input. Separating read and write capability is one of the highest-leverage architectural moves you can make.

With that frame, here are the layers.

Layer 1 — Least privilege and least autonomy

The blast-radius principle from before has a direct corollary: give the agent the minimum tools, data, and credentials its task requires, and no more. Treat an agent exactly like a service account — narrowly scoped, audited, and reviewed. Start each new agent with the narrowest possible capability set and a small, well-defined task where the blast radius of failure is contained, then expand deliberately. “What’s the maximum access available” is the wrong default; “what’s the minimum this task needs” is the right one.

Layer 2 — Sandboxing and isolation

Assume the agent will, at some point, run hostile code — generated by a poisoned dependency, an injected instruction, or its own mistake. So run everything it does in an isolated, ephemeral environment with hard resource limits and the ability to roll back.

The 2026 consensus on strength: default to microVMs for untrusted code (Firecracker — the technology behind AWS Lambda, exposed by platforms like E2B — gives each sandbox its own kernel and network namespace, so a guest-kernel vulnerability can’t reach the host), and relax to gVisor or plain containers only when your threat model justifies it. Make sandboxes per-session and disposable with clean teardown so nothing persists between runs, and set hard memory, disk, and CPU limits to stop resource-exhaustion attacks. For coding agents this dovetails with the isolation you already want for parallelism: each agent gets its own throwaway workspace.

Layer 3 — Network egress control

This is the layer that directly kills the trifecta’s exfiltration leg. Agents should run on a zero-trust network: default-deny all outbound traffic, and allowlist only the specific endpoints the task requires. Add DNS restrictions to prevent command-and-control lookups, segment the agent’s network from production systems and sensitive data stores, and watch for anomalies (connections to low-reputation domains, unusually large outbound POSTs). If the agent can only reach three approved hosts, a stolen secret has nowhere to go.

Layer 4 — Scoped credentials and the broker pattern

Credentials are the crown jewels, and there are two distinct goals: keep them out of the model’s context (so the LLM provider never sees them) and out of the agent runtime entirely (so a compromised agent can’t read them). The pattern that achieves both is a credential broker: the agent never holds a real secret — it calls a tool, and a separate broker process, outside the agent’s reach, attaches the short-lived, narrowly-scoped credential and makes the actual API call.

# The agent asks the broker to act; it never sees the credential.
class CredentialBroker:
def call(self, tool: str, args: dict, session: Session) -> Result:
policy.authorize(tool, args, session) # per-tool PERMIT/DENY
cred = self.vault.mint(tool, ttl_seconds=300, # short-lived, scoped
scope=min_scope_for(tool))
try:
return execute(tool, args, cred) # broker makes the call
finally:
self.vault.revoke(cred) # gone after one use

Credentials are minted just-in-time, scoped to the single operation, and expire in minutes. Even a fully hijacked agent can’t exfiltrate a secret it never possessed — and a stolen short-lived token is worthless minutes later.

Layer 5 — The tool gateway

The agent’s reasoning must never be the thing that decides whether a dangerous action is allowed — because we’ve previously established that its reasoning can be hijacked. So put all tool access behind a single policy gate that enforces authorisation, consent, filtering, and audit centrally, so nothing bypasses policy. Per-tool PERMIT/DENY rules (the Cedar policy engine and the cedar-for-agents pattern are built for this) are evaluated against a declared rule — principal, action, resource, conditions — independent of the agent’s reasoning. Expose tools with fixed schemas so the agent can’t improvise novel calls, and wrap your most sensitive integrations as sealed tools running in a separate container. An MCP gateway is a natural home for this — it’s the chokepoint where you sanitise context and enforce allowlists between the agent and everything it can touch.

def gateway(call: ToolCall, session: Session) -> Result:
if not schema_valid(call): # fixed schema — no improvising
return deny("schema violation")
decision = cedar.evaluate(call, session) # policy, not model judgment
if decision != "PERMIT":
return deny(decision)
if call.is_high_impact: # irreversible / sensitive
require_human_approval(call) # tiered gate
audit_log.record(call, session) # decision, not just output
return broker.call(call.tool, call.args, session)

Notice the gateway is also where the later layers attach: human approval for high-impact actions, and an audit record of every decision.

Putting the harness together

Stacked, these layers form a harness where a compromise stays contained:

A flowchart illustrating a secure harness system for defence in depth, featuring components such as a microVM sandbox, human approval, a tool gateway, a credential broker, and an egress allowlist.

Trace an attack through it. A poisoned dependency injects an instruction. The hijacked agent tries to exfiltrate secrets — but it holds none, because the broker does (Layer 4). It tries to call a destructive tool — but the gateway’s policy denies it regardless of the agent’s “reasoning” (Layer 5). It tries to phone home — but egress is default-deny (Layer 3). It tries to corrupt the host — but it’s in a disposable microVM (Layer 2). Every layer the attack defeats, another stands behind it. That’s defence in depth, and it’s the difference between a bad session and a production incident.

Security in the Workflow

A secure harness is necessary but not sufficient. 10 vulnerabilities a week from a 1%-error agent fleet is a flow problem, and flow problems need controls in the flow. A harness you configure once protects the runtime; it doesn’t catch the vulnerability in PR #847 on Tuesday afternoon. For that, security has to live in the workflow itself, running on every action the agent takes, automatically. This is the “built-in, not bolted-on” thesis made operational.

Gate every agent PR like untrusted code

The agent’s output is untrusted code — we’ve already established the model can be hijacked, so its commits deserve the same suspicion as a pull request from an anonymous outside contributor:

Diagram illustrating security gates in the agent workflow, including agent PR, deterministic security gates with various checks, risk routing based on security impact, and audit logging for decisions.

The deterministic gates run on every agent PR and block on failure:

  • SAST (static application security testing) for vulnerability patterns — the direct defence against the 10-vulns-a-week problem.
  • Secret scanning so a credential never lands in a commit.
  • Dependency and CVE scanning, plus a hallucinated-package check — does every new import actually exist and is it the real package, not a slopsquatted look-alike registered to catch exactly the names models invent (the supply-chain attack).
  • IaC scanning for misconfigured infrastructure.

Because these are deterministic, they make trustworthy hard gates — no human time spent on a leaked key or a known-vulnerable dependency. This is shift-left security applied to a contributor that never sleeps.

Tier human oversight so it survives contact with volume

Human approval is the control that stops a hijacked agent’s high-impact action — but naive human review doesn’t scale to agent volume, and worse, it breeds approval fatigue: ask a human to rubber-stamp 200 trivial changes and they’ll rubber-stamp the one dangerous one too. The fix is risk-based tiering, the same Green/Yellow/Red routing, applied to security impact:

  • Low-risk (docs, tests, isolated non-sensitive code) → auto-merge with notification.
  • High-impact / irreversible (auth, payments, data migrations, production deploys, anything touching the paths from your risk map) → mandatory human approval, every time.

Tiering concentrates scarce human attention exactly where the blast radius is largest, and keeps it sharp by not wasting it everywhere else. Even a lightweight approval step — a Slack confirm, a required reviewer on protected paths — is a meaningful gate. The goal is that no irreversible action happens without a human, without drowning humans in reversible ones.

Audit decisions, not just outputs

You detect a hijacked agent not by reading its final answer but by watching its behavior. So log the agent’s decisions — every tool call, every delegation, every retrieval, every hand-off — not just its outputs. Baseline what a normal tool-call sequence looks like, and alert on deviations: a triage agent that suddenly reads .git/config and opens a network connection is mid-exploit, and only a decision-level trace shows it.

This audit trail does double duty. It’s your incident-response timeline, and it’s your compliance evidence — the record of which agent accessed which data, under which policy, authorized by which human, at what time. (Treat memory writes as security events too: a poisoned memory entry is a backdoor that reloads every session.) The 900+ agent gateways found exposed on the public internet in early 2026 — plaintext credentials, no authentication — failed precisely because there was no governance layer recording and enforcing any of this. Audit is the floor of that governance layer.

The trifecta audit: a gate before production

The lethal trifecta becomes a concrete pre-deployment gate. Before any new agent ships, audit it explicitly:

TRIFECTA AUDIT (run before every agent goes to production)
[ ] Does it access private data? (repo, secrets, DB, customer data)
[ ] Does it process untrusted content? (issues, PRs, web, dependencies)
[ ] Can it communicate externally? (network, public comments, APIs)

All three present? → DO NOT SHIP without compensating controls:
• break it with the Rule of Two (split read-only from write-capable), OR
• content inspection + strict tool scoping + mandatory human gates on egress
Assign an explicit owner to each leg. "Logging" is not "prevention."

Make this audit a required, version-controlled step — not tribal knowledge. Only 11% of production agents passed a baseline security assessment in 2026, and 57% of organizations couldn’t even answer these three questions for their agents. Being able to answer them, on every agent, before it ships, already puts you ahead of the overwhelming majority.

Govern from day one

Tie it together with a governance layer that exists from the first commit, not after the first incident. Version-control your agent security policy and risk map alongside the code; align your controls to a recognised framework — the OWASP Top 10 for Agentic Applications 2026, MITRE ATLAS for adversary techniques, and the NIST AI Risk Management Framework for lifecycle governance — so you’re not inventing controls from scratch; and gate the installation of new tools and plugins behind review (CODEOWNERS plus CI schema validation), since a new tool is a new capability and a new piece of attack surface. Governance isn’t a launch-day checklist; it’s the substrate the agent runs on.

The whole picture

Assemble the three parts and the architecture is coherent. You secure the harness, not the model, because the model can be compromised — and a coding agent’s blast radius at machine speed makes that compromise expensive. The harness is defence in depth organised by the Rule of Two — least privilege, ephemeral sandboxing, default-deny egress, a credential broker, and a policy gateway that doesn’t trust the model’s reasoning. Security lives in the workflow — deterministic gates on every PR, risk-tiered human approval, decision-level audit, and a trifecta gate before production — all sitting on a governance layer present from day one.

The thread through every layer is the same: a single compromised agent should stay a single bad session, never a production-wide incident. You get there not by trusting the agent more, but by engineering the workflow so that trust is never required — the controls run whether the agent is behaving or not. That’s what “built into the workflow, not bolted on” actually means, and at 10 vulnerabilities a week, it’s the only thing that keeps pace.

RAG for Knowledge-Grounded Agents

An ungrounded agent is a confident liar. Ask it about your company’s refund policy, last quarter’s numbers, or a customer’s order history, and it will produce a fluent, plausible, well-structured answer — drawn from its training data, its priors, or nothing at all. The words are right; the facts may be invented. That’s the hallucination problem, and it’s the single biggest barrier between a demo and a system you’d let talk to customers.

Retrieval-Augmented Generation (RAG) is the answer the industry converged on, and in 2026 it’s the default architecture for any agent that needs to answer from private or current data. The idea is simple: instead of hoping the knowledge is baked into the model’s weights, you retrieve the relevant facts at query time and hand them to the model as context, so its answer is grounded in real, citable documents.

RAG earns its place over the alternative — fine-tuning — for most knowledge tasks because your knowledge changes. Fine-tuning bakes information into weights: expensive, slow, and stale the moment a policy updates. RAG reads from a source you can edit in seconds. The rule of thumb: use RAG when your data changes, you need citations, or you face diverse queries; reach for fine-tuning when you need a consistent style, format, or domain-specific reasoning. Knowledge-grounding is squarely RAG’s job.

The anatomy of a RAG pipeline

Every RAG system has two halves: an offline ingestion path that prepares your knowledge, and an online query path that answers questions against it.

Diagram illustrating the anatomy of a RAG (Retrieval-Augmented Generation) pipeline, showing the processes involved in data ingestion and query handling. The pipeline includes stages for document ingestion, chunking, embedding, and querying with a focus on vector databases and language models.
  • Ingestion: split documents into chunks, convert each chunk into an embedding (a vector capturing its meaning), and store those vectors — with metadata — in a vector database.
  • Query: embed the user’s question, retrieve the most similar chunks, optionally rerank them, and pass the best ones to the LLM, which generates an answer grounded in (and ideally citing) those chunks.

That’s the whole concept. As a wise practitioner put it: the concept is simple, the execution is not. And the execution problem has a specific location.

The uncomfortable truth: retrieval is the bottleneck, not the model

Here is the most important thing to internalise before you build anything. In 2026, RAG systems don’t usually fail because the model isn’t smart enough to write a good answer. They fail because the model was handed the wrong documents. The generation step is largely solved; the retrieval step is where quality leaks out.

The numbers are sobering. A naive RAG pipeline — the kind you build in a weekend tutorial — fails at retrieval roughly 40% of the time, and the failure is the dangerous kind: the LLM produces a confident, fluent, well-structured answer grounded in the wrong chunks. Naive retrieval plateaus around 70–80% precision for anything beyond simple factual lookups. If retrieval hands over irrelevant context, no model on earth can save the answer — garbage in, confident garbage out.

This connects directly to the “AI slop” problem: an answer that looks correct but isn’t. In RAG, the root cause is almost always retrieval, and that’s where your engineering effort belongs.

The maturity ladder: naive → advanced → agentic → adaptive

RAG has evolved well past the weekend-tutorial pattern. There’s a clear ladder of sophistication, each rung buying more accuracy at more cost and complexity.

Diagram illustrating the RAG maturity ladder with four stages: Naive RAG, Advanced RAG, Agentic RAG, and Adaptive RAG, highlighting their characteristics and performance metrics.
  • Naive RAGquery → embed → top-k vector search → stuff into prompt → generate. The 2023 pattern. Fine for simple questions over a clean knowledge base; plateaus at 70–80% precision and fails ~40% of the time on harder queries. If a tutorial stops here, it’s out of date.
  • Advanced RAG — adds hybrid search (semantic + keyword), a reranker to sort retrieved chunks by true relevance, and query rewriting/decomposition. This is the rung that fixes most retrieval failures, and most production systems should live here. The cheapest upgrades win the most.
  • Agentic RAG — the LLM stops being a passive consumer of whatever chunks came back and instead controls the retrieval loop: it plans, decomposes a question into sub-queries, retrieves, evaluates whether it has enough, reformulates and retrieves again, and self-checks before answering. Worth the extra cost for complex, multi-hop questions or when accuracy is non-negotiable (legal, medical, financial).
  • Adaptive RAG — a lightweight classifier routes each query by complexity: simple lookups take the cheap Advanced path, complex multi-hop questions trigger the expensive Agentic path. You get agentic quality where it matters and advanced-RAG cost everywhere else — cost discipline built into the architecture.

The trap most teams fall into is jumping straight to agentic complexity. The right path is to get Advanced RAG solid first — most use cases never need more.

Grounding is a discipline, not a side effect

A grounded-looking answer isn’t the same as a grounded one. The practice that turns RAG from “usually right” into “verifiably right” is citation grounding: require the agent to attribute every claim in its answer to a specific retrieved chunk, by ID. Any claim it can’t cite gets flagged for human review rather than shipped. This one discipline, according to 2026 practitioners, eliminates the majority of synthesis hallucinations — the cases where the model blends real chunks into a plausible falsehood.

Grounding is also measurable, and you should measure it continuously. The standard tools: RAGAS for answer-level metrics (faithfulness, answer relevance, groundedness) and classic information-retrieval metrics (nDCG, MRR, Recall@K) for the retrieval step itself. If you only measure whether the final answer “sounds good,” you’re flying blind through exactly the step that fails 40% of the time. Instrument retrieval quality directly.

The payoff is real: a May 2026 MLOps Community benchmark across 47 production deployments found agentic RAG paired with knowledge graphs cut hallucination by roughly 62% — though, as we’ll see, the foundational fix is almost always better retrieval, not exotic architecture.

RAG is how agents stay honest

Step back and the strategic picture is clear. As foundation models commoditise, the differentiator shifts from the model to your data orchestration and retrieval strategy — what your agent can accurately look up. For knowledge-grounded agents, RAG isn’t a feature; it’s the mechanism that keeps the agent tethered to reality. It’s also increasingly a tool the agent calls rather than a fixed pre-step — retrieval exposed over an interface (often MCP), invoked when the agent decides it needs facts.

The canonical pipeline: retrieve wide, rerank narrow

The single highest-leverage pattern in production RAG is two-stage retrieval: retrieve a wide net with hybrid search, then rerank down to a precise few.

Diagram illustrating a hybrid retrieval and reranking process with two stages: Stage 1 involves dense semantic search and sparse keyword search leading to the selection of top results, while Stage 2 focuses on precision through a cross-encoder and a large language model (LLM).

Stage 1 — hybrid search (recall). Pure vector search is great at meaning but misses exact terms — product codes, error strings, proper nouns, the literal word a user typed. Pure keyword search (BM25) is the opposite. Hybrid search runs both and fuses the results, and in 2026 it’s no longer optional for production RAG. Cast a wide net here: retrieve the top ~50 candidates. You want recall — get the right chunk somewhere in the set.

Stage 2 — reranking (precision). A cross-encoder reranker (such as Cohere Rerank v3) then scores each of those 50 candidates against the query with far more nuance than the first-pass similarity, and you keep only the top ~5. Crucially, irrelevant chunks are discarded rather than stuffed into the prompt — which both improves the answer and cuts token cost. This retrieve-50-rerank-to-5 pattern consistently improves answer quality by 15–30% on RAGAS metrics.

def retrieve(query: str, k_dense=50, k_final=5) -> list[Chunk]:
# Stage 1: hybrid recall — semantic + keyword, fused
dense_hits = vector_search(embed(query), top_k=k_dense) # meaning
sparse_hits = bm25_search(query, top_k=k_dense) # exact terms
candidates = reciprocal_rank_fusion(dense_hits, sparse_hits)

# Stage 2: precision — cross-encoder rerank, discard the rest
ranked = rerank(query, candidates) # e.g. Cohere Rerank v3
return ranked[:k_final]

Get this two-stage pipeline working before anything else. It fixes the majority of retrieval failures on its own.

The inputs that set your ceiling: chunking and embeddings

Two upstream choices cap how good retrieval can ever be — get them wrong and no reranker rescues you.

Chunking. How you split documents determines what can be retrieved. Naive fixed-size splits cut sentences in half and orphan context. Prefer heading-aware or semantic chunking that respects document structure, and attach metadata to every chunk from day one: source, owner, effective dates, and — critically — access-control labels (ACLs). Metadata is what lets you filter (“only docs this user may see,” “only the current policy version”), and retrofitting ACLs later is painful. Enforce document-level access from day one.

Embeddings. The embedding model sets the ceiling on semantic retrieval quality. In 2026, OpenAI’s text-embedding-3-large (~64.6 MTEB) is the safe default; the open Qwen3-Embedding-8B tops the multilingual leaderboard (~70.58) if you self-host or need many languages. Whatever you pick, the same model must embed both your chunks and your queries.

Helping the query find the answer

Sometimes the user’s question, as typed, is a poor search query. Two cheap techniques close the gap:

  • Query rewriting and decomposition. Reformulate a vague question into a better search query, or split a multi-part question into sub-queries you retrieve for separately. “How did our refund and shipping policies change last year?” is two retrievals, not one.
  • HyDE (Hypothetical Document Embeddings). For vague or under-specified queries, have the LLM generate a hypothetical answer first, then embed that to drive retrieval — the hypothetical often sits closer in vector space to the real documents than the bare question did. You still ground the final answer on the real retrieved docs, never the hypothetical.

The agentic loop: retrieval as a decision, not a step

Everything so far is Advanced RAG — a fixed retrieve-then-generate flow. Agentic RAG turns retrieval into something the model actively controls. Instead of one pass, the agent runs a loop: plan, retrieve, reflect, and decide whether it has enough to answer or needs to search again.

Diagram illustrating the agentic RAG loop, featuring stages: Adaptive Router, Plan, Retrieve, Reflect, and Answer with citations, with arrows indicating flow and decision points.

The loop, drawn from ReAct-style reasoning, looks like this:

def agentic_rag(question: str, max_steps=4) -> Answer:
if not is_complex(question): # adaptive routing — cost control
return advanced_rag(question) # simple query: one cheap pass

goals = plan(question) # decompose into sub-goals
evidence = []
for _ in range(max_steps): # bounded loop — no runaway cost
q = rewrite(next_open_goal(goals), evidence)
evidence += retrieve(q) # hybrid + rerank from above
if reflect(question, evidence).is_sufficient:
break # stop when grounded enough
return synthesize_with_citations(question, evidence)

Three things make this production-grade rather than a runaway token-burner:

  • Adaptive routing sends simple queries to the cheap path — you don’t pay agentic cost ($0.02–0.10/query versus ~$0.005 for advanced) on questions that don’t need it.
  • A bounded loop (max_steps) caps retrieval iterations, the same resource-bounding discipline that keeps any agent from looping forever.
  • Reflection lets the agent recognise when retrieval came back empty and try a different query instead of confidently answering from nothing — directly attacking the 40% failure mode.

Citation grounding, made concrete

Above, we named citation grounding as the discipline that kills synthesis hallucinations. In the pipeline it’s a hard rule on the generation step: every claim must carry the chunk ID it came from, and uncited claims are flagged rather than shipped.

SYSTEM = (
"Answer ONLY from the provided chunks. After every claim, cite its chunk "
"id like [c3]. If the chunks don't support an answer, say so — do not "
"use outside knowledge. Uncited claims will be rejected."
)
# post-process: parse citations, verify each maps to a real retrieved chunk,
# and route any uncited sentence to human review instead of the user.

This is the RAG-specific form of the verification gate from the code-review: don’t trust the output, check it — here, by confirming every sentence traces to real evidence.

When to add GraphRAG (and when not to)

GraphRAG (Microsoft, open-sourced July 2024) supplements vector retrieval with a knowledge graph of entity relationships. It’s genuinely powerful for cross-document, “connect-the-dots” questions that require reasoning over relationships (“which suppliers are affected if this factory closes?”). But it earns its cost only there — for ordinary lookups it’s expensive over-engineering. Reach for it when theme-level, multi-entity reasoning is a real requirement, not before.

Measure it, or you’re guessing

Build the eval harness before you add agentic complexity, not after. Use RAGAS for faithfulness, answer relevance, and groundedness; use IR metrics (nDCG, MRR, Recall@K) to measure retrieval directly. Profile your actual query distribution to decide whether you even need the agentic path. Without this, you can’t tell whether a change helped — and in a system that fails 40% of the time at one specific step, measuring that step is the whole game.

On frameworks: use LlamaIndex when retrieval quality is your focus (its ingestion and retrieval tooling is strong), LangGraph when you need durable, stateful agentic orchestration, and LangChain to assemble something quickly. Many teams combine LlamaIndex ingestion with LangGraph control.

Start with the caveat that saves you a month

Before comparing anything, the single most useful fact in this entire post: your vector database choice accounts for maybe 5–10% of your RAG system’s quality. Chunking strategy, embedding model, retrieval pipeline, and prompting matter far more. Teams routinely agonize over Pinecone-versus-Qdrant while shipping naive retrieval that fails 40% of the time. Don’t be that team. Pick a reasonable default, get the pipeline right, and switch databases later only if scale or features force you to.

With that said, picking the wrong database can create real operational pain, so here’s how the three honestly compare.

A useful framing: as context windows have grown to a million-plus tokens, the vector DB’s role has shifted from “essential storage” to a smart retrieval layer that controls cost and improves quality. All three options below do that competently. They differ in who runs them and what they cost as you scale.

Three databases, three philosophies

Comparison table of Pinecone, Qdrant, and pgvector highlighting their philosophy, operational burden, cost at scale, sweet spot, filtering methods, and lock-in.

pgvector — “use the database you already have”

pgvector is a PostgreSQL extension that adds vector search to the database you’re probably already running. Its whole philosophy is don’t add infrastructure: vectors live in the same tables as the rest of your data, so you get joins, transactions, and role-based access control for free, with no separate service to operate or sync.

  • Best for: teams already on Postgres, under roughly 5–10 million vectors. This is the right default for most builds.
  • Performance: with an HNSW index, queries return in ~5–8ms — at typical scale the database is not your latency bottleneck (embedding generation usually dominates). Performance degrades past ~10M vectors, though the pgvectorscale extension pushes that ceiling dramatically (benchmarks show 471 QPS at 99% recall on 50M vectors).
  • Cost lever: running pgvector on serverless Postgres like Neon (which scales compute to zero when idle) can cut a bursty workload’s bill from ~$260/month on RDS to ~$30–50/month. One database for app data and vectors is an underrated simplification.

Qdrant — best performance per dollar

Qdrant is an open-source vector database written in Rust, built specifically for high-throughput vector search. You can self-host it or use Qdrant Cloud, and its defining trait is economics: self-hosted on a ~$30–50/month VPS it comfortably handles 10M+ vectors — roughly 10× cheaper than equivalent Pinecone capacity.

  • Best for: cost-conscious teams that can run a container, wanting the best price-performance and strong filtering.
  • Strengths: very fast HNSW with excellent payload/metadata filtering (“vectors where tenant_id = X”) — important for multi-tenant and ACL-aware retrieval. Published benchmarks show ~850 QPS at p95 ~8ms on 1M vectors.
  • Watch-outs: the ecosystem is smaller than Pinecone’s (though LangChain and LlamaIndex both integrate cleanly), and you should verify behaviour at your scale if you have very large datasets or heavy concurrent writes — at 50M vectors a single Qdrant node trailed pgvectorscale badly in one benchmark. Test before committing at the high end.

Pinecone — zero-ops managed scale

Pinecone is fully managed and serverless-first: there’s no infrastructure to run, indexes partition and replicate themselves, and you get consistent low-millisecond latency at essentially any scale. Multi-tenant isolation via namespaces is a clean first-class feature, and it supports dense+sparse hybrid search.

  • Best for: teams with no infrastructure team, or workloads past ~5M vectors where its purpose-built scaling shines (sub-20ms p95 at 5M+).
  • The trade-offs are real: you cannot tune the index to control the recall/latency trade-off — their docs say so plainly, and for some applications that opacity is fine, for others disqualifying. Cost scales steeply (often 3–8× pgvector past ~2M vectors, and “budget surprises are common”). There’s no self-hosting and meaningful vendor lock-in — the API, index format, and data are tied to Pinecone. You’re buying operational simplicity, and at scale it’s a genuine premium.

The decision, in one pass

The choice is mostly mechanical once you’re honest about scale and ops appetite.

Flowchart guiding the selection of a vector database based on criteria such as existing Postgres usage, infrastructure capability, and cost-performance needs, highlighting options like pgvector, Qdrant, and Pinecone.
  • Already on Postgres and under ~5–10M vectors?pgvector. The migration cost is near zero and you avoid a second system entirely. This is most teams.
  • Want the best cost-performance and can run a container?Qdrant (self-hosted). ~10× cheaper than Pinecone at small-to-mid scale, with first-class filtering.
  • No infra team, or past ~5M vectors and want zero ops?Pinecone, accepting the cost curve and lock-in for genuine operational simplicity.

All three support cosine/dot-product/L2 distance and metadata filtering, so the differentiator isn’t features — it’s the operational model and the cost curve.

Keep the database swappable

One architectural habit pays for itself: hide the vector store behind a thin retrieval interface. Your pipeline should call retrieve(query), not Pinecone-or-Qdrant-or-pgvector-specific code. Then the database becomes an implementation detail you can change when scale demands — start on pgvector, move to Qdrant or Pinecone if and when you cross the thresholds above — without rewriting your application.

class Retriever(Protocol):
def search(self, query_vec: list[float], top_k: int,
filters: dict) -> list[Chunk]: ...

# PgvectorRetriever, QdrantRetriever, PineconeRetriever all implement this.
# The rest of the RAG pipeline neither knows nor cares which one is wired in.

The bottom line

This post traced grounding from principle to production. Retrieval, not the model, is where RAG fails — naive pipelines miss ~40% of the time, so grounding and measurement are the disciplines that matter. The fix is unglamorous and cheap — hybrid search, a reranker, good chunking, citation grounding, and an adaptive agentic loop, all measured with RAGAS and IR metrics. The database under it is a real but secondary decision — pgvector by default, Qdrant for cost-performance, Pinecone for zero-ops scale — and a thin interface keeps it swappable.

The strategic point ties back to where we started: as models commoditise, your edge is the quality of what your agent can accurately retrieve. Get the retrieval pipeline right and a knowledge-grounded agent stops being a confident liar and becomes something you can trust in production — which is the entire goal.

Why Agentic Projects Fail

Almost everything written about agentic AI is a showroom: the demo that dazzled, the workflow that now runs itself. This article is the morgue. Because the most useful thing you can study before building an agentic system isn’t the success stories — it’s the autopsies. And there are a lot of bodies.

The headline number is Gartner’s, from June 2025: over 40% of agentic AI projects will be cancelled by the end of 2027 — not scaled back, not pivoted, cancelled — citing escalating costs, unclear business value, and inadequate risk controls. It’s not a speculative warning; Gartner frames it as a structural forecast grounded in deployment realities. And the candid part, the part that should reframe how you build, is why they fail.

Where projects go to die: the production cliff

Start with the gap that defines the whole problem. Adoption looks healthy — agentic AI hit ~35% adoption in two years, faster than any prior AI wave. But adoption is not production. Deloitte’s late-2025 research found only about 14% of organisations have a solution ready to deploy, and just 11% are actually running agents in production. Meanwhile a far larger share — depending on the survey, 35–40% — are stuck experimenting and piloting.

That space between “piloting” and “in production” has a name in the trade: pilot purgatory. It’s where agentic projects go to die.

A visual representation illustrating 'The production cliff' concept, showing three sections: 'Experimenting/Interested', 'Piloting', and 'In Production' with corresponding percentages indicating project progression, highlighting challenges in moving from pilot to production.

The cliff is steep and consistent across studies. MIT’s NANDA report found that of enterprise-grade AI systems, 60% of firms evaluated them, only 20% reached a pilot, and just 5% went live. The pattern repeats everywhere: getting started with agentic AI is easy and cheap. Getting to production — reliable, governed, valuable, affordable at scale — is where the wheels come off.

The most candid finding: it’s not the model

Here is the single most important and most overlooked fact in all of this research. MIT’s “GenAI Divide: State of AI in Business 2025” studied 300 deployments, 150 executive interviews, and 350 employees, and found that 95% of enterprise GenAI pilots fail to deliver measurable impact on P&L — and the primary cause is not the capability of the AI models. It’s flawed enterprise integration.

Read that again, because it inverts the usual instinct. When an agentic project dies, the post-mortem rarely reads “the model wasn’t smart enough.” It reads “we pointed a capable model at the wrong problem, in the wrong process, with the wrong data, and no plan to get it to production.” As one manufacturing COO told the MIT researchers: “The hype on LinkedIn says everything has changed, but in our operations, nothing fundamental has shifted.” The models are good. The engineering and judgement around them are missing.

The cause of death you’ll see most: automating a broken process

The most common root cause deserves to be named first and loudly: organisations automate broken processes.

It happens like this. A process is slow, inconsistent, and poorly understood. Instead of fixing it, someone points an agent at it, because automating sounds easier than redesigning. The agent learns the broken process and executes it — faster, at scale, autonomously. You haven’t fixed anything; you’ve built a machine that makes the same mess more efficiently and at higher volume. As one analysis put it, the agents end up executing the wrong things, in the wrong ways, at the wrong times.

A broken process automated is not an improvement. It’s a faster broken process with a higher blast radius — and now it’s also a black box. This is why Gartner’s own guidance is that “rethinking workflows with agentic AI from the ground up is often the ideal path,” rather than bolting agents onto legacy flows. If your process is broken, automating it isn’t a shortcut — it’s malpractice.

The other causes on the certificate

Automating broken processes is the headline, but the death certificate usually lists several contributing causes. The honest taxonomy:

Graphic listing the causes of project failure with seven bullet points including "Automating a broken process", "No clear business value or ROI", and "Poor data quality & broken integration".
  • No clear value or ROI. “Nice, but not transformational.” The agent writes better emails or summarises a few tickets, an executive asks “where’s the actual impact?”, and there’s no answer. Without a clear path to value, nobody will fund the cost of running it at scale.
  • FOMO instead of strategy. Projects launched out of fear of being last, not because there’s a problem worth solving. Fear is what produces agents built on broken workflows, fed poor data, with no governance.
  • “Agent washing” and over-engineering. Gartner estimates only about 130 of the thousands of “agentic” vendors are real, and bluntly notes that many use cases positioned as agentic today don’t require agentic implementations. A huge share of failures are projects that built a complex autonomous agent for something a script, a workflow automation, or a simple assistant would have done better, cheaper, and more reliably.
  • Escalating and hidden costs. Teams budget the visible costs — compute, API calls, development — and miss the iterative trial-and-error engineering and the ongoing human-oversight cost. Agentic systems are tuned by deploy-observe-adjust loops, which burn far more engineering time than traditional software, and the bill arrives after the pilot’s glow fades.
  • Inadequate governance and risk controls. Over-permissioned agents acting across your stack with little oversight — a data leak or compliance failure waiting for a trigger. Gartner predicts a third of companies will harm customer experience in 2026 by deploying AI prematurely.
  • Bad data and integration. Agents act on their inputs at machine speed; feed them fragmented, dirty data and they produce confident wrong decisions, fast.

Notice what every one of these has in common: they’re human and engineering failures, not AI failures. The 40% cancellation rate isn’t the technology falling short. It’s the predictable result of choices that could have been made differently.

You probably need fewer agents than you think

One last reframe to carry forward, because it prevents a whole category of death. Gartner’s recommendation is refreshingly unglamorous: use agents when a decision is genuinely needed, automation for routine workflows, and assistants for simple retrieval. Most of what gets branded “agentic” is one of the latter two wearing a costume. The simplest tool that solves the problem is almost always the one that survives to production.

The Six Autopsies

Across the post-mortems — Gartner’s cancellation analysis, MIT’s GenAI Divide, McKinsey’s barrier list, and the well-known wreckage of projects like IBM Watson at MD Anderson and McDonald’s AI drive-thru — the same six failure modes recur. Learn to recognise each one early, because every one of them is survivable if you catch it before production.

An infographic outlining six common issues in processes, titled 'The six autopsies — and the fix for each'. It details broken processes, lack of clear value, wrong tools, trust breakdown, governance later, and economic failures, along with suggested fixes for each issue.

Autopsy 1 — Automating a broken process

Symptom: The agent dazzles in the demo and falls apart in production. Worse, it doesn’t crash — it diligently does the wrong thing at scale.

Root cause: The underlying process was slow, ambiguous, or undocumented, and instead of fixing it, the team automated it. The agent faithfully learned and amplified the dysfunction.

Post-mortem lesson: Map and fix the process before you automate it. If you can’t write down the steps, the decision rules, and what “done correctly” means, an agent can’t either — it will just guess, confidently, forever. Gartner’s guidance is to rethink the workflow from the ground up rather than bolt an agent onto a broken legacy flow. The blunt test: would you hand this process, exactly as written, to a brand-new employee with no judgement and no ability to ask questions? If not, it’s not ready for an agent.

Autopsy 2 — No clear value (or the wrong ROI bar)

Symptom: A working agent that nobody can justify funding. It does something nice — better emails, summarised tickets — but when an executive asks “what did this move?”, the room goes quiet. Cancelled.

Root cause: The project optimised for “we’re doing AI,” not for a defined business outcome. Often compounded by FOMO: it was launched to avoid being last, not to solve a measured problem.

Post-mortem lesson: Define the value before you build, in terms of cost, quality, speed, or scale — and pick high-value, connected use cases over isolated party tricks. MIT’s data is pointed here: budgets pile into sales and marketing demos while the durable ROI sits in back-office and operations automation. A caveat for balance: don’t swing so far that you demand perfect ROI proof before any experimentation — emerging tech earns its returns after an iteration phase. The failure isn’t experimenting; it’s experimenting without a hypothesis about value.

Autopsy 3 — The wrong tool (“agent washing” in-house)

Symptom: A complex, brittle, expensive autonomous agent doing a job a 50-line script or a simple assistant would do better and more reliably.

Root cause: “Agentic” became the goal instead of the means. Gartner notes plainly that many use cases positioned as agentic today don’t require agentic implementations — and estimates only ~130 of thousands of “agentic” vendors are the real thing. Teams do this to themselves too, reaching for autonomy where determinism would serve.

Post-mortem lesson: Match the tool to the job. Agents when a genuine decision is needed; automation for routine, deterministic workflows; assistants for simple retrieval. Autonomy is a cost, not a feature — every degree of it adds nondeterminism, expense, and failure surface. Reach for the simplest thing that solves the problem, and add agency only where the problem genuinely demands judgement.

Autopsy 4 — Trust breakdown

Symptom: The agent hallucinates, drifts silently over time, or behaves as an unauditable black box — and eventually does something visibly wrong to a customer. McKinsey lists this as a top barrier; Gartner predicts a third of companies will harm CX with premature AI in 2026.

Root cause: The system was shipped without a way to know whether it’s right. No evaluations, no observability, no human checkpoint on consequential actions.

Post-mortem lesson: You cannot deploy what you cannot verify. Build the verification scaffolding before production: an eval suite that measures whether the whole system produces good outcomes, tracing so you can see what the agent did and why, and a human checkpoint on anything consequential.

Autopsy 5 — Governance as an afterthought

Symptom: An over-permissioned agent acting across your stack, touching sensitive data and taking actions on behalf of users with little oversight — until a rogue request or misconfigured permission causes a leak, an inappropriate action, or a compliance failure.

Root cause: Security and governance were treated as a phase-two concern, bolted on after the capability worked. By then the agent already has broad standing access.

Post-mortem lesson: Governance is a day-one requirement, not a launch-day checklist. Give every agent a scoped identity, least-privilege access to only the tools and data its task needs, and an audit trail for every action. “Inadequate risk controls” is one of Gartner’s three named cancellation causes for a reason — an ungoverned agent isn’t a feature you’ll harden later; it’s a liability you’ve already shipped.

Autopsy 6 — Economics that don’t hold

Symptom: A project cancelled for “escalating costs” — the agent works, but it costs more to build, run, and supervise than the value it returns.

Root cause: The budget counted the visible costs (compute, API calls, development) and missed the big ones: the trial-and-error engineering loop that tuning an agent requires, and the ongoing human-oversight cost. Multi-agent and tool-heavy designs compound this — recall that some multi-agent architectures use ~15× the tokens of a single call.

Post-mortem lesson: Budget the full cost before you start: iteration time, human oversight, and the token bill at production volume — then check it against the value from Autopsy 2. If the economics don’t clear with honest numbers, the project is already dead; you just haven’t held the funeral.

The pattern across all six

Step back and the six autopsies tell one story. Not one of them is “the model wasn’t capable.” Every single one is a failure of engineering discipline or business judgement: an unfixed process, an undefined value, a mismatched tool, missing verification, absent governance, unbudgeted economics. That’s the candid lesson of the whole graveyard — and it’s good news, because every one of these is a choice you control. Next, we’ll turn them into a checklist that keeps you out of the 40%.

Building Survivors

The 40% cancellation rate is not a law of nature. It’s the aggregate of avoidable choices, and the corollary is encouraging: the projects that survive aren’t luckier or better-funded — they make a recognisable, repeatable set of decisions differently. Here’s what’s in the survivor’s playbook.

1. Start with the process, not the agent

Every survivor starts in the same unglamorous place: the process, not the technology. Before anyone evaluates a model or a framework, they answer “is this process well-understood, well-defined, and worth doing at all?” If the process is broken, they fix it first — or redesign it from the ground up for agents, as Gartner recommends — because the first autopsy is also the most common cause of death. Automating a process you can’t cleanly describe is how you build a fast, scaled, autonomous version of your existing dysfunction.

The discipline here is pre-AI and boring: process mapping, clear decision rules, a written definition of “done correctly.” Boring is what survives.

2. Pick a use case that can live

Not all agentic use cases are created equal, and the survivors are ruthless about which ones they pursue. A useful lens (Trullion’s survivability matrix) scores a candidate on two axes:

  • Workflow integration — how deeply the agent embeds into a real, core process versus operating in a demo silo.
  • Domain specificity — how much it’s grounded in your actual data, rules, and context versus being a generic assistant.
A diagram titled 'The survivability matrix', showcasing four quadrants: 'Generalist copilots', 'Hype experiments', 'Survivors', and 'Stranded demos'. Each quadrant includes descriptive text about integration and domain specificity.

The bottom-left quadrant — generic and siloed — is where the 95% of failed pilots live: flashy demos that never touch a real workflow. The survivor quadrant is top-right: deeply integrated into a core process and grounded in your specific domain. Before committing, plot your use case honestly. If it lands bottom-left, you don’t have a project — you have a demo, and demos don’t graduate to production.

3. Right-size the autonomy

Survivors reach for the least autonomy that solves the problem, because every degree of agency is a cost in nondeterminism, expense, and failure surface (Autopsy 3). The rule, made operational:

Does the task require a genuine decision under uncertainty,
across multiple steps, that can't be expressed as fixed rules?
├─ NO, it's routine and deterministic → workflow automation
├─ NO, it's just fetching/summarising → an assistant
└─ YES, it needs judgement + action → an agent (and only here)

Most “agentic” projects that die never needed to be agentic. The survivors use agents surgically — only where a decision genuinely lives — and use cheaper, more reliable automation everywhere else.

4. Engineer for production, not the demo

This is the heart of it. The gap between a demo and a production system is exactly the scaffolding that the failures lacked. Survivors build it in from day one:

  • Evals — a suite that measures whether the whole system produces good outcomes, so you’re not flying blind through a nondeterministic system (Autopsy 4).
  • Observability and tracing — see what the agent did and why; you cannot operate a black box.
  • Governance and identity — scoped identity, least privilege, audit trail per agent, from the start (Autopsy 5).
  • Cost discipline — budget iteration time, human oversight, and the production token bill; favour the cheapest mechanism that works (Autopsy 6).
  • Human checkpoints — a person at the boundary of anything consequential (merging code, spending money, touching customers).

None of this is novel or AI-specific — it’s the production-engineering discipline reliable systems have always required. Agentic projects don’t fail for lack of model capability; they fail for lack of this scaffolding. As one framing of the MIT and McKinsey findings put it: the models aren’t weak, the discipline is missing.

5. Weigh buy vs. build honestly

One of MIT’s more uncomfortable findings: externally-built solutions succeeded roughly twice as often as internal builds, largely because vendors ship adaptive, integration-ready systems while internal teams underestimate the integration and iteration work (the very thing we’ve named as the real failure cause). This isn’t a blanket “always buy” — vendor lock-in is a real strategic risk, and deeply domain-specific advantages may demand building. But the default assumption that you’ll build it yourself is one the data does not support. Be honest about whether your team has the bandwidth for the deploy-observe-adjust grind that production agents require.

6. Run a pre-mortem before you build

The single highest-leverage habit of survivors: they hold the funeral before the project starts. A pre-mortem inverts the post-mortem — you imagine the project has been cancelled in 18 months and ask “why did it die?”, then address each cause in the plan. The six autopsies make a ready-made checklist.

Checklist titled 'Pre-flight checklist — run the pre-mortem first' with seven green check marks indicating completed items.

Run down the list honestly before committing budget. Every box you can’t check is a probable cause of death you’ve just identified while it’s still cheap to fix. Projects that pass this gate are the ones that cross the production cliff; projects that skip it become the 40%.

The bottom line

The candour of this article cuts both ways. Yes, most agentic projects fail — but almost none of them fail because the technology couldn’t do the job. They fail because someone automated a broken process, couldn’t articulate the value, reached for an agent where a script would do, shipped without verification or governance, or never budgeted the true cost. Every one of those is a decision, and every decision can be made differently.

So the question agentic AI poses to your organisation isn’t “is the technology ready?” — it largely is. It’s “are we disciplined enough to deploy it well?” The surviving 11% answer yes by being relentlessly boring about the fundamentals: fix the process, prove the value, right-size the autonomy, engineer for production, and run the pre-mortem. Do that, and the 40% statistic isn’t a threat — it’s your competitive advantage, because most of your competitors won’t.