Skip to main content
Self Diagnostics lets your AI agents proactively report their own issues back to your team. Agents often understand their own failures better than we do: if your agent keeps failing to install a package or can’t find something a user is asking for in your docs, it can just tell you, and the report shows up alongside your other signals.

How it works

When you enable Self Diagnostics, the SDK gives your agent a reporting tool and prompt-engineers its description from your category definitions. Whenever the agent hits one of those situations, it reports it, and Raindrop records it as a signal with signal_type: "agent", grouped separately from classifier- and SDK-tracked signals so agent-reported issues don’t get lost in the mix. Raindrop records only what your agent explicitly reports; Self Diagnostics doesn’t scan your conversations on its own. See Default signal categories for what it catches out of the box.

Using Self Diagnostics

Enable it

Enable Self Diagnostics in the SDK that instruments your agent. With the Vercel AI SDK integration (@raindrop-ai/ai-sdk), add selfDiagnostics: { enabled: true } to the wrap() call on the client you create with createRaindropAISDK:
For full SDK integration details, see:

Customize the categories

You can define your own signal categories and add domain-specific guidance. When you provide custom signals, they replace the defaults entirely:
The SDK auto-generates the tool prompt from your signal definitions.

Report without wrap()

Outside the @raindrop-ai/ai-sdk wrap() path, the SDK clients have two entry points: a standalone reporting tool your agent can call (TypeScript), and manual reports from your own code (TypeScript and Java).

Self-diagnostics tool (TypeScript)

createSelfDiagnosticsTool() creates a tool your agent can call to report issues. It gives you:
  • A reusable execute() handler that tracks an agent signal
  • Adapter-specific tool definitions for Vercel AI SDK, OpenAI SDK, and Anthropic SDK
The four default categories are missing_context, repeatedly_broken_tool, capability_gap, and complete_task_failure. You can replace these with your own.
Self diagnostics requires an eventId to correlate the signal with an interaction. Pass eventId, interaction, or getEventId when creating the tool.
You don’t need to mention self diagnostics in your system prompt — the tool description generated by the SDK already tells the model when and how to call it. Just wire the tool into your LLM call using one of the adapters below. When the agent calls the tool, a signal is tracked on the same eventId:

Supported adapters

createSelfDiagnosticsTool() supports these adapters: Vercel AI SDK:
OpenAI SDK:
Anthropic SDK:

UI guidance

__raindrop_report is an internal tool. If your chat UI renders tool calls, hide this tool call from end users to avoid confusing them with internal diagnostics details.

Manual reporting

If your agent already has its own way of detecting issues, use selfDiagnose() to report them directly — no LLM tool call needed. In Java it reports a signal that surfaces in the dashboard’s Self Diagnostics tab, which is useful when your agent detects that it is stuck or degraded.
The options in TypeScript (Java takes the same ones on SelfDiagnoseOptions.builder()):

View reports in the dashboard

Self Diagnostics reports appear in a dedicated Self Diagnostics tab on the Signals page. From there you can:
  • Track issue rates over time with signal charts
  • Drill into individual incidents to see the agent’s description of what went wrong
  • Set up notifications to get notified when problems spike

Reference

Default signal categories

Out of the box, the agent detects and reports four categories of issues: Providing custom signals replaces these defaults entirely (see Customize the categories).

Troubleshooting

Reports aren’t showing up. Confirm selfDiagnostics.enabled is true in your wrap() config, or that your agent includes the tool from createSelfDiagnosticsTool(). Run the agent and confirm it calls the tool. For manual reports, confirm your code calls selfDiagnose() with the event ID. Reports land under the Self Diagnostics tab on the Signals page, not the main Signals list. Custom categories replaced the defaults. That’s expected: custom signals replace the four defaults entirely. Re-add any defaults you still want alongside your custom ones.