claude-code - 💡(How to fix) Fix [BUG] "400 Guardrail was enabled" error when using Claude Opus 4.8 with AWS Bedrock

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

❯ What is the 5th prime number? ⎿  API Error: 400 Guardrail was enabled but input is in incorrect format.

Code Example

What is the 5th prime number?
  ⎿  API Error: 400 Guardrail was enabled but
     input is in incorrect format.

---
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

I tried to switch from Opus 4.7 to the new Opus 4.8 in Claude Code, which I've been using with AWS Bedrock. Every query emits a response like this:

❯ What is the 5th prime number?
  ⎿  API Error: 400 Guardrail was enabled but
     input is in incorrect format.

What Should Happen?

The new model is supported in both Claude Code and in Bedrock, so I'd expect it to work with Claude Code using Bedrock.

Error Messages/Logs

Steps to Reproduce

  1. In ~/.claude/settings.json, use Bedrock and set "model": "global.anthropic.claude-opus-4-8"
  2. Start a session
  3. Submit any prompt

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.154 (Claude Code)

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

Other

Additional Information

There was a bug that prevented Opus 4.7 from working in Bedrock when it launched: https://github.com/anthropics/claude-code/issues/49238

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING