Product

Agent Recovery: add smarter fixes to API responses

Justina Nguyen · November 13, 2026

When an agent hits an error calling your API, it often gives up, and you never find out.

Agent Recovery shows you those failures and lets you put a fix into the API response that tells the agent exactly what to change for the request to work. The agent reads the hint, fixes the request, and retries, without digging through your docs or guessing. In our benchmark of 3,600 runs across four Claude models, agents with long or missing docs finished every task when the error carried a hint, using about half the tokens.

How does Restless generate hints?

  1. It checks the error for prompt injection before a model reads it, so a malicious request can't trick the model into writing a harmful hint.
  2. A model drafts the hint from your API spec and from the code where the error is thrown. It reads that code only while writing and never saves a copy.
  3. The draft goes through three checks: a pattern scan for secrets and personal data, a quality check, and a privacy review in which two different models must both approve.
  4. The hint goes live, and Restless tests it on real agents.
GET/rates
400
"error": "invalid_rate_type"
From the spec alone
Check that the request parameters are valid and try again.
From the code
Send rate_type as one of standard, express or overnight. It is case-sensitive.
Inserted by Restless

How hints improve over time

Before a hint goes live, a second model reviews it. If the hint fails review, Restless rewrites it using that feedback, up to three times. A hint that still fails after the third try goes to your team for review.

Once a hint is live, Restless checks whether it works. After an agent sees a hint, Restless watches for the same mistake from that agent over the next hour. If it doesn't come back, the hint worked. Once 20 agents have seen a hint, Restless scores it. A hint that worked at least half the time stays. One that didn't is rewritten from what the agents tried next and tested the same way, and Restless keeps whichever version scores best.

Agent can also report that a hint didn't help via send_feedback tool, which triggers a rewrite, and a hint goes back on trial whenever your code or spec changes. A team member can approve or edit any hint at any time. An approved hint is marked Reviewed, and Restless won't change it.

How Restless keeps personal data out

Everything AI writes for your API, including recovery hints, context items, and use cases, has to pass two checks before it's stored or served to an agent:

  1. A pattern scan catches emails, phone numbers, SSNs, card numbers, API keys, tokens, connection strings, internal hosts and IPs, and record IDs. It decodes base64, hex, and URL encoding first, so nothing hides in an encoded string.
  2. One model looks for what patterns miss, like personal data, credentials, and internal or account-specific details. A second, separate model makes the final call, and both must approve.

Try Agent Recovery

  • Already on Restless? Open Agent Recovery in your dashboard to see which errors agents are hitting and review the hints for them.
  • New to Restless? Run npx restless init or sign up here.

GET STARTED

Build with Restless

The modern API toolkit: docs, an API reference, and AI chat, generated from your OpenAPI spec and updated as it ships.

$ npx restless init

More from the blog