Troubleshoot a Custom Target Adapter
Focus
Focus
Prisma AIRS

Troubleshoot a Custom Target Adapter

Table of Contents

Troubleshoot a Custom Target Adapter

Diagnose and resolve common issues with custom target adapters using the Validate run output, scan results, and adapter sidecar logs.
Where Can I Use This?What Do I Need?
  • Prisma AIRS (AI Red Teaming)
Select Validate in the adapter editor (AI Red TeamingCustom AdaptersCreate Adapter) to view your script's print() output while iterating. For scan issues, check the adapter sidecar container logs on your cluster.
The following table lists common symptoms, their causes, and the steps to resolve them.
SymptomCauseAction
Validation fails with "must define call_target or both pre_process and post_process".The script does not implement a complete function pattern.
Define either call_target() or the pre_process()/post_process() pair. Do not define only one of the pre/post pair. If both patterns exist in the same script, call_target() takes precedence and the pre/post functions are not called.
Scan results show adapter_error.The script contains an unhandled exception or a function returns the wrong type.
Run Validate Adapter in the adapter editor and inspect the traceback and stdout output. Ensure each function returns the correct *Result: PreProcessResult, PostProcessResult, CallTargetResult, AuthResult, or SessionPreProcessResult.
Authentication failures repeat.authenticate() returns a bad or short-lived token, or the target rejects it.
  • Confirm that the values in context.secrets are correct for this adapter or the target's overrides.
  • Set a realistic ttl in AuthResult, slightly less than the token's actual expiry, to account for clock skew.
  • Signal raise_auth_error on 401 responses so AI Red Teaming triggers re-authentication.
Adapter shows as "unreachable" or Network Channel errors appear.The adapter sidecar is not enabled or the Network Channel client version is outdated or offline.
  • Confirm that adapterSidecar.enabled: true is set in your chart values and the pod has restarted with the sidecar container running.
  • Verify that the Network Channel client is running v1.4.0 or later. Upgrade the chart if it is older.
  • Check the Network Channel status in AI Red Teaming to confirm it is online.
The reply in scan results is blank.The output is not extracted correctly.
Add print(raw_response.json_body) inside post_process() and run Validate Target to inspect the response structure. Correct the extraction path to match the key your target returns.
A required library is unavailable.The adapter runtime bundles only the Python standard library, httpx, and websockets.
Use context.http and the standard library where possible, or contact AI Red Teaming to request the package.