DEV Community

Damien Gallagher
Damien Gallagher

Posted on

Bedrock Guardrails Stateful Checks: Gated Preview, Tool-Call Gating, What's Missing

TL;DR

  • Bedrock Guardrails now has stateful guardrails: checks that see your system prompt and session history, not just the latest message.
  • For multi-turn chat assistants and agents. Two checks on the InvokeGuardrailChecks API: Stateful Prompt attack and a security threat check.
  • Status: gated preview, allowlisted customers only, US East (N. Virginia) and US West (Oregon).
  • Pricing not stated in the sources I read.
  • Watch: the public API reference I found doesn't show these two checks yet.
  • My view: the tool-call gate is the interesting part. Worth requesting access if you run agents.

Contents


What changed

Most guardrail checks look at one message at a time. That is a weak fit for agents. An attack can be spread over several turns, or hidden in a tool result the model reads later.

On 29 November AWS announced stateful guardrails in gated preview. Going by the launch post, each request is evaluated with the application's system prompt and the relevant session history. Your application sends the system prompt and the earlier turns. Bedrock Guardrails then picks the context that matters for each turn.

So you don't have to work out which earlier turns to include. That part is on the service.


The facts

Item What AWS says Source
Feature Stateful guardrails for multi-turn chat assistants and AI agents What's New
API InvokeGuardrailChecks What's New
Checks Stateful Prompt attack; security threat check What's New
Status Gated preview, allowlisted customers What's New
Regions US East (N. Virginia), US West (Oregon) What's New
Access Contact your AWS account team, or use the request link on the post What's New
Pricing Not stated Bedrock pricing

The two checks

Stateful Prompt attack. The post says it reduces false positives on normal instructions that look like attacks. Their example is a coding agent told to ignore generated files. "Ignore" is a classic trigger word, so I can see why a per-message filter would trip on it. It also aims to catch attacks spread across turns, or hidden in tool results.

Security threat check. This one reviews user prompts and agent tool calls. Per the post, it flags:

  • connections to domains and IP addresses that AWS threat intelligence marks as malicious
  • commands that expose credentials or escalate privileges
  • tool calls that break a security principle, given the session so far

The last item is the one I care about. It is a judgement against context, not a pattern match.

AWS also describes where to call it. If you call the check before a tool runs, your application can stop the call, ask the user to confirm it, or log it. The decision stays in your code.


What AWS hasn't said

I read the announcement, the public InvokeGuardrailChecks API reference and the Bedrock pricing page. Gaps:

  • Pricing. Not stated. The pricing page I fetched lists prices for the existing InvokeGuardrailChecks checks (content filters, sensitive information), but has no mention of stateful guardrails.
  • Who is allowlisted. Not stated beyond "allowlisted customers".
  • Request shape for the new checks. The API reference I found describes inline checks for content filter, prompt attack and sensitive information. It doesn't show the system prompt, session history, Stateful Prompt attack or security threat check. Preview access may come with different docs.
  • Latency, limits, supported models. Not stated.
  • Preview terms. Not stated. Gated previews can change shape before GA.

What this means for you

Who should care. Anyone running an agent that calls tools with real side effects: shell, HTTP, cloud APIs. Also chat assistants where an attacker has several turns to work on the model.

Simpler or more complex. Simpler in one way: you don't hand-pick context for the check. More complex in another: you have another network call in the tool path. Each call adds latency, and probably cost once pricing appears.

Pattern I would try. Put the check between the model's tool-call decision and the tool execution:

  1. The model proposes a tool call.
  2. Your code sends the session so far, plus the proposed call, to the security threat check.
  3. Clean result: run it. Flagged result on a low-risk tool: log it. Flagged result on anything destructive or credential-related: ask a human.

That matches the stop, confirm or log options in the post. I'd map those to tool risk tiers up front, not decide them per incident.

Pairing. This sits well beside AgentCore or any Bedrock agent loop, since the hook is in your own orchestration code. It doesn't replace least-privilege IAM. A check can be wrong. A scoped role cannot be talked out of its permissions.

Cost. Unknown. Don't put it on every tool call in a busy loop until you have a price.

Code. I'm not posting a sample. The documented request shape doesn't cover the new checks, and I won't guess field names. Start from the API reference and the access you get.

Next steps:

  • Ask your account team for access if you run agents in us-east-1 or us-west-2.
  • List your agent's tools and mark which ones should never run unconfirmed.
  • Ask AWS how it prices stateful checks, and how long session history can be.

Open question: how well does the check judge "breaks a security principle" when the principle lives only in your system prompt? I'd want to see that tested on your own agent before trusting it.


Related posts


Sources

Drafted with AI assistance. I review and edit every post.

Top comments (0)