Skip to content

docs: add guardLatestUserMessage to TypeScript Bedrock guardrails#646

Open
Unshure wants to merge 3 commits intomainfrom
agent-tasks/643
Open

docs: add guardLatestUserMessage to TypeScript Bedrock guardrails#646
Unshure wants to merge 3 commits intomainfrom
agent-tasks/643

Conversation

@Unshure
Copy link
Member

@Unshure Unshure commented Mar 11, 2026

Summary

This PR adds documentation for the guardLatestUserMessage feature in the TypeScript SDK's BedrockModel guardrail configuration, achieving feature parity with the existing Python SDK documentation.

Changes

Files Modified

  1. src/content/docs/user-guide/concepts/model-providers/amazon-bedrock.ts

    • Added guardLatestUserMessage: true option to the guardrails code example
  2. src/content/docs/user-guide/concepts/model-providers/amazon-bedrock.mdx

    • Added explanatory note in the TypeScript tab explaining the feature's purpose and benefits

What This Feature Does

The guardLatestUserMessage option allows guardrails to evaluate only the most recent user message instead of the entire conversation history. This provides:

  • Performance optimization in multi-turn conversations
  • Cost reduction by evaluating fewer tokens per request
  • Avoiding redundant validation of previously validated messages

Verification

  • TypeScript compiles successfully
  • Site builds successfully (npm run build)
  • Feature parity between Python and TypeScript documentation sections

Resolves #643

Add documentation for the guardLatestUserMessage feature in the
TypeScript SDK's BedrockModel guardrail configuration:

- Add guardLatestUserMessage: true to TypeScript guardrails code example
- Add explanatory note explaining the feature's purpose and benefits
- Achieve feature parity with existing Python SDK documentation

This feature allows guardrails to evaluate only the most recent user
message instead of the entire conversation history, improving
performance and reducing costs in multi-turn conversations.

Resolves #643
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: Request Changes

The documentation changes achieve feature parity between Python and TypeScript for the guardLatestUserMessage option and are well-written. However, the PR includes a build artifact that must be removed before merging.

Review Details
  • Critical: build_output.log (141KB build artifact) was accidentally committed and must be removed
  • Documentation: Changes to amazon-bedrock.mdx and amazon-bedrock.ts are correct and follow existing patterns

Please remove the build_output.log file and this PR will be ready to merge. 👍

@github-actions
Copy link
Contributor

Documentation Preview Ready

Your documentation preview has been successfully deployed!

Preview URL: https://d3ehv1nix5p99z.cloudfront.net/pr-cms-646/docs/user-guide/quickstart/overview/

Updated at: 2026-03-11T21:42:38.229Z

@Unshure Unshure marked this pull request as ready for review March 12, 2026 13:36
@github-actions
Copy link
Contributor

Documentation Preview Failed

The documentation deployment encountered an error. Please check the deployment logs for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[NEW CONTENT] GuardLatestMessage Guardrail Docs

2 participants