TL;DR
- AI agents are notoriously unreliable in production despite excelling in demos—the gap is testing, not capability
- Agentic red-teaming systematically stress-tests AI agents against adversarial prompts, jailbreaks, and failure modes before shipping
- promptfoo (5,060 GitHub stars) has emerged as the leading open-source framework for this practice
- Reliability is becoming the true competitive moat: teams that ship fast without testing are learning the hard way
The Hook That Wasn't a Hook
Your AI agent passed the demo. The slides were beautiful. The live test had the audience applauding.
Three weeks into production, it's a different story. Responses drift. Edge cases trigger hallucinations. A cleverly worded prompt leaks system instructions. The agent that "just worked" is now your team's biggest headache.
This isn't a capability problem. It's a testing problem.
The Reliability Crisis: Why Agents Break in the Wild
The gap between AI agent demos and production is now legendary in engineering circles. A tool that handles 90% of queries flawlessly still fails catastrophically on the 10%—and in production, that 10% arrives constantly, in forms you never anticipated.
The root cause isn't mysterious:
- Demo conditions are pristine: curated inputs, favorable context, human-in-the-loop at every turn
- Production is adversarial by default: users click wrong, adversaries probe, edge cases compound
- No systematic failure discovery: teams ship first, discover bugs later, patch reactively
The HN signal is unambiguous: "AI agents: Less capability, more reliability, please" garnered 423 points. The community is screaming for stability, not more features.
What Is Agentic Red-Teaming?
Agentic red-teaming is the practice of systematically attacking your own AI agent before attackers do it for you. It draws from cybersecurity's red-team tradition and adapts it for LLM-based systems.
Three primary threat vectors get probed:
Prompt Injection: Can a user inject instructions that override system directives? Can adversarial content in a webpage the agent reads hijack its behavior?
Jailbreaks: Can carefully crafted multi-turn conversations bypass safety guardrails or elicit out-of-scope behaviors?
Edge Case Cascades: What happens when the agent encounters ambiguous inputs, tool failures, or ambiguous tool outputs? Does it fail gracefully or spiral unpredictably?
The goal isn't to find every bug—it's to find the ones that matter before they matter.
promptfoo: The Leading Open-Source Agent Testing Framework
With 5,060 GitHub stars and a rapidly growing contributor base, promptfoo has emerged as the de facto standard for AI agent evaluation. It provides:
- Parameterized test cases: Define inputs, expected outputs, and scoring logic—then run hundreds of test variants automatically
- Evaluation datasets: Curate real-world failure cases into reproducible test suites
- Red-team plays: Built-in patterns for common attacks including prompt injection, indirect injection, and role-play jailbreaks
- Scoring and reporting:量化 the reliability of your agent across dimensions like instruction adherence, safety, and task completion
The framework treats your AI agent as a system under test, not a black box. You define the expected behavior; promptfoo measures reality against it.
How to Actually Test an AI Agent
The practical workflow breaks into four phases:
Phase 1: Baseline your critical paths. Identify the 10-20% of agent capabilities that drive 80% of user value. Write test cases that cover happy paths, expected edge cases, and common failure modes.
Phase 2: Build your adversarial dataset. This is where red-teaming starts. Add prompts designed to:
- Inject instructions via user input
- Inject instructions via third-party content (web pages, documents)
- Bypass safety measures via role-play or hypothetical framing
- Trigger hallucination on ambiguous queries
Phase 3: Run, measure, iterate. Execute your test suite against every significant change. Track reliability scores over time. Treat a declining score as a blocking signal.
Phase 4: Automate. Integrate test execution into your CI/CD pipeline. No agent ships without passing the red-team suite.
The Business Case: Reliability Equals Trust Equals Adoption
The math is brutal and simple: one high-profile agent failure—data leak, embarrassing hallucination, security breach—can destroy user trust faster than months of marketing built it.
Conversely, teams that ship reliable agents accumulate a compounding advantage. Users learn they can trust the tool. Adoption spreads by word of mouth. The agent becomes infrastructure rather than novelty.
In enterprise contexts, reliability is often the gating factor for AI adoption. A procurement team will reject a 95%-reliable agent in favor of a 99%-reliable alternative—even if the capability delta is imperceptible. Reliability isn't just a technical metric; it's a sales metric.
Where Copanion Fits in the Reliability Stack
Copanion is being built with stability as a first-class concern, not an afterthought. The architecture prioritizes graceful degradation, structured output validation, and systematic failure recovery.
The reliability stack looks like this:
- Training: High-quality, diverse training data that builds robust foundational behavior
- Testing: promptfoo-style red-teaming and evaluation suites that catch failure modes before they ship
- Runtime guardrails: Structured constraints that prevent catastrophic outputs even when the model drifts
- Observability: Real-time monitoring that surfaces reliability regressions as they happen
This is the reliability stack that turns "impressive demo, unreliable product" into "boring reliability, growing adoption."
FAQ: Tooling, Team Setup, and Testing Frequency
What tooling do I need to get started?
Start with promptfoo (open-source, self-hosted) for test case management and evaluation. Add a simple CI/CD hook for automated test execution. For teams needing more, commercial solutions like Anthropic's evaluation platform or Azure AI Studio offer managed evaluation pipelines.
How do I staff for agentic red-teaming?
You don't need a dedicated team. Start with one engineer who owns the test suite and treats it as a first-class part of the development workflow. As the agent matures, add red-teaming review to your standard code review process—treat it like security review, not a separate function.
How often should I run red-team evaluations?
Minimum: before every significant release. Ideal: continuous evaluation integrated into CI/CD, with every pull request triggering a subset of critical tests and a full suite run on merge to main.
What's the most common failure mode teams miss?
Indirect prompt injection: content the agent encounters during execution (web pages, documents, database records) that contains adversarial instructions. Most teams test direct user input and completely overlook content the agent fetches autonomously.
Final Take: Ship Less, Test More
The 2026 AI engineering discipline is crystallizing around a simple principle: the competitive moat isn't the model—it's the reliability stack around it.
The teams winning are not shipping the most capable agents. They're shipping the most trustworthy ones. And trust, in this market, comes from systematic testing.
promptfoo and agentic red-teaming represent a maturation milestone for the entire industry. The question for every AI team is simple: are you stress-testing your agents, or are you waiting for production to do it for you?
Start your red-team suite today. Your future users—your future self—will thank you.
Copanion is being built for developers who ship AI agents that need to work. If that's you, we're building something worth waiting for.


