Interface: ImageGuardrailOptions
Defined in: packages/agentos/src/safety/guardrails/builtin/ImageGuardrail.ts:72
How an image guard is built.
Properties
checks
checks:
ImageCheck[]
Defined in: packages/agentos/src/safety/guardrails/builtin/ImageGuardrail.ts:79
Every match check runs on every image before any classify check runs. Every match check must come before
every classify check in the list, and at least one classify check is listed.
id
id:
string
Defined in: packages/agentos/src/safety/guardrails/builtin/ImageGuardrail.ts:74
A word (letters, digits and _ . : -, at most 64).
loadImage()?
optionalloadImage: (url,context) =>Promise<{bytes:Uint8Array;mimeType?:string; }>
Defined in: packages/agentos/src/safety/guardrails/builtin/ImageGuardrail.ts:86
Fetches an image_url input once, under the host's own egress rules. Without it an image_url input is refused
as unavailable.
Parameters
url
string
context
Returns
Promise<{ bytes: Uint8Array; mimeType?: string; }>
maxBytes?
optionalmaxBytes:number
Defined in: packages/agentos/src/safety/guardrails/builtin/ImageGuardrail.ts:93
The most bytes one image may hold. A larger image is refused with IMAGE_LIMIT and no check runs on it: base64 is
measured before it is decoded, loadImage bytes as they come back. Default 20 MiB (20971520).
maxImages?
optionalmaxImages:number
Defined in: packages/agentos/src/safety/guardrails/builtin/ImageGuardrail.ts:88
The most images one input may carry; more are refused with IMAGE_LIMIT before any check runs. Default 4.
requireMatch?
optionalrequireMatch:boolean
Defined in: packages/agentos/src/safety/guardrails/builtin/ImageGuardrail.ts:81
create() throws unless a match check is listed. For a surface that takes people's uploads. Default false.
sequential?
optionalsequential:boolean
Defined in: packages/agentos/src/safety/guardrails/builtin/ImageGuardrail.ts:101
Sets config.sequential: the image checks finish before any phase 2 guard sees the input's text. Default false.
timeoutMs?
optionaltimeoutMs:number
Defined in: packages/agentos/src/safety/guardrails/builtin/ImageGuardrail.ts:99
The deadline for one evaluation, every check of every image included. Default 15000 ms. Past it no further capture
or check starts, an image whose checks had not all run, or whose last check was still running, is refused as
unavailable unless a check blocked or held it, and the deadlineSignal every check received is aborted.