Input Parameters
Focus
Focus
Prisma AIRS

Input Parameters

Table of Contents

Input Parameters

Objects the platform passes to your adapter functions at runtime. You read from them; you do not construct them.
Where Can I Use This?What Do I Need?
  • Prisma AIRS (AI Red Teaming)

The context Object

Passed to every function.
PropertyTypeDescription
context.varsdict[str, str]Non-secret config declared in the adapter; visible in the UI.
context.secretsdict[str, str]Secret config; masked in the UI and scrubbed from logs.
context.authdict | NoneWhat authenticate() returned; None if authenticate() is not defined.
context.sessiondict | NoneWhat session_pre_process() returned, carried across turns; None if not used.
context.httphttpx.ClientPreconfigured HTTP client. Use this for all HTTP calls instead of importing another client.
context.http verifies the target's TLS certificate against the system trust store and any custom CA bundle given to the Network Channel client. If the client is installed with disableSSLVerification, certificate verification is skipped for context.http and for the HTTP call AI Red Teaming makes in Pattern A.

Turn Input

Passed to pre_process and call_target.
PropertyTypeDescription
inference_input.promptstr | NoneThe current turn's red-team input. None on an audio turn, where the audio clip replaces the prompt.
inference_input.previous_messageslist[Message]Prior turns built and managed by the platform (read-only). Empty on the first or only turn.
inference_input.audioModalityInput | NoneThe audio attack for this turn. None on other turns. See Audio and File Input.
inference_input.fileModalityInput | NoneThe document attack for this turn. None on other turns. See Audio and File Input.
Each Message in previous_messages:
PropertyTypeDescription
message.rolestr"user" or "assistant"
message.contentstrThe message text.

Audio and File Input

The platform sends audio and document attacks only when the matching modality is selected on the target. A text-only adapter never sees them and needs no change.
  • An audio clip replaces the prompt. When inference_input.audio is set, inference_input.prompt is None. Send the audio, not text. Audio is single-turn.
  • A document accompanies the prompt. When inference_input.file is set, inference_input.prompt is set too. Send both.
  • Send the payload as-is. Converting an audio clip to another format weakens the attack.
Audio and document attacks require Network Channel client v1.5.0 or later. The inference_input.audio and inference_input.file objects require v1.9.0 or later; older clients receive the payload only in the deprecated fields.
The inference_input.audio and inference_input.file are ModalityInput objects. A ModalityInput holds every payload on offer for the turn, keyed by format.
MethodReturnsDescription
.first(*preferred)Data | NoneThe first payload on offer, in the order you list the formats.
.get(format)Data | NoneThe payload in exactly that format.
.any()Data | NoneWhichever payload is present.
.formats()listThe formats on offer this turn.
Each payload is a Data object:
PropertyTypeDescription
data.b64strThe payload, base64-encoded. Pass it to your target as-is.
data.formatAudioFormat | FileMimeTypeThe payload's format. Use data.format.value for the string, which is the MIME type for files.
A format that is not on offer returns None; it never raises an error. A target has one audio format. Validating an adapter before you attach it to a target can offer several formats, so prefer .first(...) over .get(...).
Audio formats (AudioFormat)—WAV, MP3.
File formats (FileMimeType)
MemberMIME type
FileMimeType.PDFapplication/pdf
FileMimeType.DOCXapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
FileMimeType.DOCapplication/msword
FileMimeType.MDtext/markdown
FileMimeType.TXTtext/plain
FileMimeType.HTMLtext/html
FileMimeType.CSVtext/csv
def pre_process(context, inference_input): if inference_input.audio is None: # not an audio attack: send the prompt as text return PreProcessResult( url=context.vars["endpoint"], json_body={"message": inference_input.prompt}, ) clip = inference_input.audio.first(AudioFormat.MP3, AudioFormat.WAV) if clip is None: offered = ", ".join(f.value for f in inference_input.audio.formats()) raise_target_error(f"no supported audio format; offered: {offered}") return PreProcessResult( url=context.vars["endpoint"], json_body={"audio": clip.b64, "format": clip.format.value}, )
See Adapter Contract Examples for complete audio and document examples.

Deprecated Input Fields

These fields hold a single payload. They are still filled, and they are the only way to read audio and documents on clients older than v1.9.0. Reading one adds a deprecation notice to the adapter's error output (stderr). Move to inference_input.audio and inference_input.file when your clients are v1.9.0 or later.
PropertyTypeReplaced by
inference_input.audio_b64str | Noneinference_input.audio
inference_input.audio_formatAudioFormat | Noneinference_input.audio
inference_input.file_b64str | Noneinference_input.file
inference_input.file_mime_typestr | Noneinference_input.file
When the platform offers several audio formats, audio_b64 holds the MP3 clip if there is one, otherwise the first format. file_b64 holds the first document.

HTTP Response

Passed to post_process (Pattern A only).
PropertyTypeDescription
raw_response.status_codeintHTTP status code.
raw_response.headersdict[str, str]Response headers.
raw_response.textstrRaw response body.
raw_response.json_bodydict | list | NoneParsed JSON body; None if the response is not JSON.