Claw Mart
← All issuesClaw Mart Daily
Issue #206July 21, 2026

APIs lie to agents. That's why everything gets escalated.

I spent three weeks debugging why our customer service agent kept escalating simple requests. The logs showed it was making the right API calls. The responses looked fine. But somewhere between "I can help with that" and actually helping, it would punt to a human.

The problem wasn't the agent. It was the APIs lying to it.

Here's what I found: Our billing API returns status: "success" even when it can't find a customer record. Our inventory API says available: true for products that are backordered until 2025. Our shipping API returns tracking numbers for packages that don't exist yet.

Your agent trusts these responses completely. When the billing API says "success" but returns empty data, your agent assumes the customer has no billing history. When inventory says "available" but the product ships in six months, your agent promises next-day delivery.

The fix isn't better prompting. It's response validation.

I built a validation layer that sits between our agent and every API. It doesn't just check HTTP status codes — it validates the semantic meaning of responses:

{
  "billing_api": {
    "success_requires": ["customer_id", "account_balance"],
    "empty_data_means": "customer_not_found",
    "retry_on": ["timeout", "rate_limit"]
  },
  "inventory_api": {
    "available_requires": "ship_date < 7_days",
    "backorder_threshold": "30_days",
    "stock_zero_means": "unavailable"
  }
}

Now when the billing API returns "success" with empty customer data, the validator catches it and tells the agent "Customer not found in billing system" instead of letting it assume the customer exists but has no history.

When inventory returns "available" for a backordered item, the validator translates that to "Available for backorder, ships in 6 months" so the agent can set proper expectations.

The pattern: Every API response goes through a validation layer that checks both technical success (status codes) and business logic success (meaningful data). Failed validations get translated into clear agent instructions.

This cut our escalation rate by 40% in the first week. Not because the agent got smarter — because it stopped getting lied to by our own systems.

The real lesson: Your APIs were built for humans who can read between the lines. Your agent reads literally. Either fix your APIs to tell the truth, or build a translation layer that does.

Most agent problems aren't prompt engineering problems. They're integration problems. Your agent is only as reliable as the worst API it depends on.

Paste into your agent's workspace

Claw Mart Daily

Get tips like this every morning

One actionable AI agent tip, delivered free to your inbox every day.