← Blog

Control Bedrock Guardrail Content Qualifiers at the Request Boundary

Parminder Singh
Parminder Singh··5 min read
Summarize with AI

Amazon Bedrock accepts qualifier values on guardrail text blocks to identify guarded content, a grounding source, or a query. Those labels influence which text a configured check evaluates. This guide defines a server-owned qualifier policy, separates the guardContent wrapper from the guard_content qualifier, and provides request validation, evidence, and release tests for authenticated Bedrock routes.

AI Security Solutionsaws-bedrockbedrock-guardrailsai-securitypolicy-enforcementidentity-and-authorizationaudit
Control Bedrock Guardrail Content Qualifiers at the Request Boundary

Amazon Bedrock's GuardrailTextBlock accepts an optional qualifiers array. AWS currently documents three values: grounding_source, query, and guard_content. A qualifier is a routing instruction for guardrail evaluation, so the application should assign it from trusted route state. Letting a browser label its own text creates a policy-selection input at the least trustworthy point in the request path.

I would reject any design that copies caller-supplied qualifiers into Bedrock.

TL;DR

  • Assign Bedrock content qualifiers on the trusted server after authentication and route resolution.
  • Keep the guardContent wrapper separate from the guard_content qualifier because AWS gives them different jobs.
  • Allow only grounding_source, query, and guard_content, then validate the permitted combinations for each route.
  • Record the original content role and resolved qualifier. Add the guardrail ID and version, then preserve the source direction plus result for every evaluated request.

Qualifiers classify a text block for guardrail evaluation

The GuardrailTextBlock API reference defines a required text string and an optional array of qualifiers. The published enum contains grounding_source, query, and guard_content. These values belong to the Bedrock request contract. They are not enterprise data classifications and should not be reused as labels such as public, confidential, or regulated.

AWS uses grounding_source and query to identify the source material and question needed for contextual grounding checks. The guard_content value identifies text intended for guardrail evaluation in API structures that accept the qualifier. Your route policy should map application roles to these provider values explicitly.

Keep one local vocabulary for content provenance. Useful roles include current user input, retrieved context, system instruction, conversation history, and candidate model output. A separate adapter maps an approved role into a Bedrock qualifier. This preserves meaning when another provider uses a different schema.

The broader Bedrock Guardrails architecture guide explains where AWS evaluation sits. This guide owns the narrower question of who assigns each qualifier before the request reaches that service.

The wrapper and qualifier are separate controls

AWS's Converse guardrail guide documents guardContent as a content-block wrapper. Within its text object, qualifiers can identify grounding material or the query. The spelling makes confusion likely: guardContent is a structured wrapper, while guard_content is one allowed qualifier string.

The wrapper determines a guardrail assessment boundary for parts of a Converse message. Qualifier values give configured checks additional roles for the wrapped text. AWS also warns that content outside a guardContent block can still be evaluated depending on the filtering policies enabled in the guardrail. A word filter can therefore inspect text outside the two blocks selected for contextual grounding.

Write these as separate fields in the route specification:

  • Provider content container: ordinary message text or guardContent
  • Content role: user query, grounding source, system instruction, history, or model output
  • Bedrock qualifier: one value from the published enum, or absent
  • Applicable guardrail checks: the checks expected to evaluate that block
  • Failure disposition: reject, hold, or use an approved fallback

That separation prevents a developer from treating guardContent as a universal exemption mechanism.

Qualifier assignment belongs after authentication

Resolve qualifiers after the application authenticates the user or agent and selects an approved operation. The client can submit business data, such as a question and a document selection. Trusted server code should decide which bytes are the question, which retrieved passages qualify as grounding material, and which guardrail version applies.

A route for an employee handbook assistant might accept a user question plus document identifiers. The retrieval service returns approved passages. The gateway labels the question as query and the passages as grounding_source. A user-supplied field called grounding_source should have no effect on that mapping.

Put the route map under version control. Each entry should name the application operation, allowed caller roles, model destination, guardrail identifier and version, expected content roles, qualifier mapping, maximum block count and size, and failure behavior. The per-route AI policies guide provides the larger policy pattern for binding identity and destination to one request decision.

At the HTTP boundary, reject unknown qualifier strings, duplicate roles that the route forbids, a query with no approved grounding source when the operation requires grounding, and any attempt to label conversation history as current user input. Preserve the rejection reason without copying raw sensitive text into ordinary logs.

ApplyGuardrail needs an explicit source direction

The standalone ApplyGuardrail API accepts an array of content blocks and a required source value of INPUT or OUTPUT. That direction is another policy field. Input text and model output should enter distinct routes because their owners, retry behavior, and release consequences differ.

For an input assessment, stop the model call until the guardrail result and local route policy permit forwarding. For an output assessment, hold the model response until the decision permits delivery. A successful HTTP status only confirms that Bedrock returned a response. The application still has to parse the action, assessments, coverage, and any configured policy details it relies on.

Record the source direction beside each resolved qualifier. Without that field, an investigator can see guard_content and still miss whether the text was headed toward the model or toward the authenticated caller.

The AI audit log schema supplies common identity, destination, policy, and correlation fields. Add Bedrock-specific fields without flattening the provider response into a generic safe flag.

Release tests prove the qualifier map

Build fixtures around route semantics. One fixture should send a normal query with an approved grounding passage. A second should swap the two qualifiers. A third should add unwrapped message text that triggers a configured word filter. Include an unknown qualifier, a caller-supplied override, missing grounding material, an extra history block, and an output submitted with source: INPUT.

The physical review artifact can be a single request card pinned beside the test console. Use blue for the application role, orange for the Bedrock qualifier, and black for the final guardrail version. A reviewer should trace every block across the card without opening the application source code.

For each fixture, assert the request accepted by the adapter, the exact blocks sent to Bedrock, the expected check coverage, the local permit or hold decision, and the audit record. Run authenticated tests against the production-shaped route in an approved AWS environment. Retain provider request identifiers where available and store content digests when raw text retention is prohibited.

DeepInspect

DeepInspect can enforce the qualifier map on authenticated HTTP traffic deliberately routed between a user or agent and a Bedrock endpoint. It can bind trusted caller context to an approved route, reject caller-controlled qualifier overrides, and record the resolved content roles, qualifier values, guardrail version, and local disposition.

Bedrock remains responsible for the guardrail assessment it returns. The application owns retrieval quality, source approval, prompt assembly, and any downstream action outside the routed model exchange. Direct Bedrock calls, local inference, STDIO traffic, and HTTP paths that bypass the proxy remain outside DeepInspect's enforcement boundary.

Book a demo today.

Frequently asked questions

What Bedrock guardrail content qualifiers are valid?

The current GuardrailTextBlock API reference lists grounding_source, query, and guard_content. Treat that enum as an allowlist and recheck the live AWS reference when SDK or service versions change.

Is guardContent the same as guard_content?

AWS assigns them different roles. guardContent is a structured block used by APIs such as Converse to mark content for guardrail handling. guard_content is a qualifier string accepted inside a guardrail text block. Keep them in separate configuration fields and test their behavior against the checks enabled on the guardrail.

Should the browser choose grounding_source and query?

The browser should never choose them. The trusted application route should classify the current question and the retrieved source material. Browser input can influence the business request, but it should not directly set the provider qualifier that controls evaluation.

Does content outside guardContent bypass every check?

AWS says evaluation depends on the configured filtering policies. Its Converse example notes that contextual grounding uses the qualified blocks while a word filter can still evaluate other text. Test every enabled check instead of inferring a universal bypass rule from the wrapper.