Error Signals
Focus
Focus
Prisma AIRS

Error Signals

Table of Contents

Error Signals

Helper functions for signaling expected target conditions so AI Red Teaming can classify and react correctly.
Where Can I Use This?What Do I Need?
  • Prisma AIRS (AI Red Teaming)
For expected target conditions, use the following helpers so AI Red Teaming can classify and react correctly.
HelperUse whenPlatform response
raise_rate_limited(message, retry_after=N)Target rate-limited the request (for example, HTTP 429)Retries after retry_after seconds
raise_auth_error(message)Token rejected or expired (for example, HTTP 401)Invalidates cached auth and retries once
raise_content_filtered(message)Target blocked or filtered the response (often an HTTP 200 with a filter flag in the body)Records the turn as filtered; no retry
raise_target_error(message)Target failed in a retryable wayRetries
How network failures are handled depends on the pattern:
  • Pattern A — the platform makes the call, so a timeout or connection error is classified automatically.
  • Pattern B (call_target) — you make the calls yourself. Catch network errors and signal raise_target_error(...). An uncaught exception is reported as an adapter error, not a retryable target error.
Content-filter detection is the highest-value signal—AI Red Teaming cannot generically detect a filtered HTTP 200, but your adapter knows the target's response shape:
def post_process(context, raw_response): if raw_response.status_code == 429: raise_rate_limited(retry_after=int(raw_response.headers.get("Retry-After", 30))) if raw_response.status_code == 401: raise_auth_error("token expired") body = raw_response.json_body or {} if body.get("error", {}).get("code") == "content_filter": raise_content_filtered("blocked by safety filter") return PostProcessResult(output=body["reply"])