Skip to content

[BUG] gpt-oss models don't work with Bedrock Guardrails #713

@aryan835-datainflexion

Description

@aryan835-datainflexion

Checks

  • I have updated to the lastest minor and patch version of Strands
  • I have checked the documentation and this is not expected behavior
  • I have searched ./issues and there are no duplicates of my issue

Strands Version

1.5.0

Python Version

3.13.3

Operating System

macOS 15.5

Installation Method

pip

Steps to Reproduce

  1. Code snippet (minimal reproducible example)
from strands import Agent
from strands.models import BedrockModel

# Create a Bedrock model with guardrail configuration
bedrock_model = BedrockModel(
    model_id="openai.gpt-oss-20b-1:0", # or openai.gpt-oss-120b-1:0",
    region_name="us-west-2",
    guardrail_id="your-guardrail-id",         # Your Bedrock guardrail ID
    guardrail_version="1",                    # Guardrail version
    guardrail_trace="enabled",                # Enable trace info for debugging
)

# Create agent with the guardrail-protected model
agent = Agent(
    model=bedrock_model,
)

# Use the protected agent for conversations
response = agent("Tell me about financial planning.")
  1. Run Python code and get error "An error occurred (ValidationException) when calling the ConverseStream operation: The model returned the following errors: The guardrail identifier or version provided in the request does not exist."

Expected Behavior

gpt-oss models should work with Bedrock guardrails.

Actual Behavior

Got error "An error occurred (ValidationException) when calling the ConverseStream operation: The model returned the following errors: The guardrail identifier or version provided in the request does not exist."

Additional Context

No response

Possible Solution

No response

Related Issues

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions