Enum Class BedrockGuardContentPlacement
- All Implemented Interfaces:
Serializable, Comparable<BedrockGuardContentPlacement>, Constable
By default, a guardrail configured via BedrockGuardrailConfiguration evaluates the text of all user and
AI messages in the request. When a placement is set, the selected user messages are wrapped in Bedrock Converse
guardContent blocks, and the guardrail evaluates only those blocks as input:
other user messages and AI messages are not evaluated. The model response is still evaluated.
This reduces cost and latency, but content outside the selected messages is not checked.
For example, with LAST_USER_MESSAGE and chat memory, a user message that the guardrail blocked
is sent to the model without evaluation on later turns.
Bedrock never evaluates tool results, tool definitions, tool calls or a system prompt, with or without a placement.
Only text and PNG/JPEG images can be wrapped. If a selected message contains other content (for example, a PDF or a GIF image), the placement is ignored for that request, the guardrail evaluates all user and AI messages as by default, and a warning is logged. The same default applies when the request contains no user message.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe guardrail evaluates only the user messages, all of them.The guardrail evaluates only the last user message. -
Method Summary
Modifier and TypeMethodDescriptionstatic BedrockGuardContentPlacementReturns the enum constant of this class with the specified name.static BedrockGuardContentPlacement[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LAST_USER_MESSAGE
The guardrail evaluates only the last user message. -
ALL_USER_MESSAGES
The guardrail evaluates only the user messages, all of them.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-