Skip to content

BedrockGuardrailConfig

Defined in: src/models/bedrock.ts:127

Configuration for Bedrock guardrails.

For production use with sensitive content, consider SessionManager with saveLatestOn: 'message' to persist redactions immediately.

https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html

guardrailIdentifier: string;

Defined in: src/models/bedrock.ts:129

Guardrail identifier


guardrailVersion: string;

Defined in: src/models/bedrock.ts:132

Guardrail version (e.g., “1”, “DRAFT”)


optional trace: "enabled" | "disabled" | "enabled_full";

Defined in: src/models/bedrock.ts:135

Trace mode for evaluation.

'enabled'

optional streamProcessingMode: "sync" | "async";

Defined in: src/models/bedrock.ts:138

Stream processing mode


optional redaction: BedrockGuardrailRedactionConfig;

Defined in: src/models/bedrock.ts:141

Redaction behavior when content is blocked


optional guardLatestUserMessage: boolean;

Defined in: src/models/bedrock.ts:155

Only evaluate the latest user message with guardrails. When true, wraps the latest user message’s text/image content in guardContent blocks. This can improve performance and reduce costs in multi-turn conversations.

The implementation finds the last user message containing text or image content (not just the last message), ensuring correct behavior during tool execution cycles where toolResult messages may follow the user’s actual input.

false