All articles
AI & Automation·

Your AI Agent Is One Bad Output Away from a Disaster

AI agents that run without guardrails will eventually leak data, hallucinate a policy, or take an action nobody approved. We built a system to catch these problems before they happen — and we can review yours.

Your AI Agent Is One Bad Output Away from a Disaster

A client asks you to set up an AI agent that sends follow-up emails to leads. Simple enough. The agent pulls contact info from the CRM, writes a personalized message, and sends it.

Two weeks later, someone notices the agent has been including internal pricing notes in the emails. Not the customer-facing pricing — the internal margin calculations from a spreadsheet that happened to be in the same folder the agent had access to. Forty-seven leads received emails with your cost structure.

Nobody told the agent to include that data. Nobody told it not to. And nobody was checking.

The Problem Isn't the AI — It's the Missing Guardrails

Every AI agent failure we've seen follows the same pattern: the agent worked exactly as configured, but nobody built the checks that would catch a bad output before it reached the real world.

The AI didn't malfunction. The guardrails were never installed.

This is the gap most businesses don't see until it's too late. They focus on what the agent can do — write emails, process invoices, update records — and skip what the agent shouldn't do. What data should it never access? What outputs need human review? What happens when the model hallucinates something that looks right but isn't?

What Actually Goes Wrong

We've audited AI setups where:

Credentials were exposed. API keys hardcoded in scripts. Database passwords in config files that the AI could read and — in some cases — output in responses. One setup had the business owner's email password in a .env file that the AI agent loaded as context for "understanding the business."

Outputs went unchecked. An agent generating social media posts had no filter for PII. An agent summarizing customer feedback was including verbatim quotes with names and phone numbers. An agent drafting contracts was hallucinating terms that didn't exist in the template.

Permissions were too broad. Agents with read/write access to entire file systems when they only needed one directory. Agents that could send emails, post publicly, or modify databases with no confirmation step. The principle of least privilege — give each component only the access it needs — was nowhere.

Nothing ran without the AI watching. No deterministic validation. No regex scans. No format checks. Every safety check was "ask the AI if this looks right," which is like asking the person who wrote the email to proofread their own email.

Why "The AI Checks Itself" Doesn't Work

This is the most common mistake. A business sets up an AI agent to do a task, then sets up the same AI (or another AI) to review the output. AI reviewing AI.

The problem: AI models share failure modes. If one model hallucinates a plausible-sounding policy, another model reviewing it will often agree it sounds correct. Both are pattern-matching against what "looks right." Neither is checking against ground truth.

Real guardrails use deterministic checks — code that runs without AI, without judgment, without interpretation. A regex that catches email addresses in output that shouldn't contain email addresses. A format validator that rejects entries missing required fields. A credential scanner that flags anything that looks like an API key or password.

These checks can't be fooled. They can't hallucinate. They can't be convinced by a well-structured wrong answer. That's the point.

We wrote about how we built this into our own system in Self-Validating AI Agents: The Feature That Changes Everything. The short version: every automated task in our system runs through a three-phase pipeline — fetch data with no write access, scan it with deterministic code (no AI), then process the pre-scanned content. The AI never sees unscanned external content. The scanner can't be prompt-injected because it doesn't use AI.

What a Guardrails Review Looks Like

We look at six things:

Architecture and permissions. What can your AI agents access? What can they modify? Are permissions scoped to what's needed, or does the agent have the keys to everything?

Output validation. What happens between "the AI generates something" and "that something reaches a customer, a database, or a public channel"? If the answer is "nothing," that's the first fix.

Credential exposure. Are API keys, passwords, tokens, or sensitive configuration values accessible to the AI? Could the AI output them in a response? We scan code, config files, and environment variables.

Prompt injection resistance. If your AI processes external input — customer messages, web content, uploaded documents — can that input manipulate the AI's behavior? We test for the common injection patterns that bypass naive safety prompts.

Unattended task risk. Which tasks run without human review? What's the worst-case outcome if one of those tasks goes wrong at 3 AM? We assess the blast radius of every automated process.

Fix prioritization. Not everything needs to be fixed immediately. We rank findings by likelihood and impact, and we give you specific implementation steps — not just "you should improve your security posture."

The Bar Is Low — That's the Opportunity

Most businesses running AI agents have zero guardrails. No output validation. No credential scanning. No separation between what the AI can read and what it can write. The agent works, so nobody questions the setup.

This is where the industry was with web security in 2005. Websites worked, so nobody questioned whether the login form was vulnerable to SQL injection. Then the breaches started.

AI agent security is at that same inflection point. The businesses that install guardrails now — before something goes wrong — avoid the fire drill later. And they can tell their customers, honestly, that their data is handled with care.

What You Can Do Right Now

Before you hire anyone to audit your setup, check these yourself:

Search your codebase for hardcoded secrets. Look for API keys, passwords, and tokens in files your AI agent can access. If you find any, move them to environment variables and restrict the agent's file access.

Add one deterministic check to your most critical output. If your agent sends emails, add a regex that scans for patterns that look like SSNs, credit card numbers, or internal-only email addresses. Block the send if it triggers. One check is better than zero.

Review your agent's permissions. List every system, file, and API your agent can access. For each one, ask: does it actually need this? Remove what it doesn't need.

Separate fetch from process. If your agent reads external data (web content, customer uploads, incoming emails), don't let it process that data in the same step it fetches it. Fetch first, scan for problems, then process. This one architectural decision prevents the most common prompt injection attacks.


If you're running AI agents and you're not sure what could go wrong, we can tell you. The AI Guardrails Review is available as a Quick-Start Package — specific findings, specific fixes, no fluff.

Share:

Stay Connected

Get practical insights on using AI and automation to grow your business. No fluff.