As we speak, we’re asserting a brand new API with Amazon Bedrock Guardrails. With this API, you possibly can apply particular person safeguards, additionally known as security checks, at any level in your agentic AI purposes with out creating guardrail sources. The brand new InvokeGuardrailChecks API offers you the flexibleness to invoke supported safeguards at any flip within the agentic loop and take the required motion in your software logic. The API operates in detect-only mode and returns numeric scores for every safeguard. You possibly can outline customized thresholds and actions in your purposes to dam, bypass, retry, or log outcomes for auditing functions primarily based in your particular necessities.
Amazon Bedrock Guardrails gives configurable safeguards that will help you construct protected generative AI purposes. With complete security controls throughout basis fashions, Amazon Bedrock Guardrails helps you detect and filter undesirable content material and shield delicate data in each person inputs and mannequin responses.
The brand new InvokeGuardrailChecks API extends these capabilities for agentic AI purposes with multi-turn workflows. AI brokers plan duties, invoke instruments, course of outputs, and iterate by way of loops, usually with out direct person interplay. Every step on this loop carries a special threat profile and requires completely different safeguards. With the InvokeGuardrailChecks API, you possibly can apply the checks you want, the place you want them, with out the operational overhead of provisioning separate guardrail sources for every stage. The API returns a numeric rating that helps you outline your personal threshold and motion to your software. On this submit, we stroll by way of how the InvokeGuardrailChecks API works and learn how to use it to construct protected, multi-turn agentic AI purposes.
Why agentic AI wants focused security controls
Generative AI purposes usually comply with a well-recognized sample: a person sends a immediate, the mannequin responds, and a guardrail evaluates each. You create one guardrail useful resource, configure your insurance policies, and apply it uniformly.
AI brokers work in another way. They function in loops, receiving enter, producing a response, and repeating a number of turns in a dialog. A single person session would possibly contain 10, 20, or extra turns. Every flip has two phases the place security checks matter: earlier than the content material goes to the mannequin (enter), and earlier than the mannequin response goes again to the person (output).
Think about a multi-turn buyer assist agent that handles diverse requests throughout a dialog:
- Person sends preliminary query (threat: immediate injection points).
- Mannequin generates a plan or response asking for particulars (threat: mannequin output would possibly include dangerous content material influencing the mannequin’s reasoning).
- Person sends follow-up with account particulars (threat: enter would possibly include delicate data, that’s, personally identifiable data (PII)).
- Mannequin generates ultimate response (threat: dangerous or inappropriate content material within the reply).
Every step has a definite threat profile. Creating and making use of separate guardrail sources for every step creates operational overhead that scales poorly as you deploy lots of of brokers.
The InvokeGuardrailChecks API offers you granular, per-request management over which safeguards to run at every step of the agent loop. It returns numeric scores so you possibly can outline the suitable thresholds and actions in your software logic, reminiscent of retry, block, or bypass, primarily based on what fits your use case.
The way it works
The InvokeGuardrailChecks API makes use of a structured messages schema, the place every content material block has a required position reminiscent of system, person, or assistant. That is how agent interactions function in loops. These roles present the context the safeguard wants to judge the content material exactly. This facet is vital for multi-turn agentic workflows.
The InvokeGuardrailChecks API gives the next capabilities:
Resourceless: You don’t must create guardrail sources upfront. There’s no CreateGuardrail step, no guardrail IDs to trace, and no variations to handle. You specify which safeguards to run immediately in every API request. This makes it easy so as to add, take away, or modify checks as your workflows evolve.
Think about the next state of affairs. And not using a resourceless API, making use of a safeguard at an ephemeral step in an agentic loop requires a number of lifecycle calls. For instance, suppose you wish to validate a software’s output earlier than passing it to the following iteration. You first create a guardrail useful resource, invoke it, after which delete it after the invocation to keep away from useful resource sprawl. When a single agentic person question triggers dozens of loop iterations, every with completely different security necessities, this create-invoke-delete lifecycle turns into untenable. The InvokeGuardrailChecks API avoids this. You name the API with the safeguard you want.
Detect-only: The API doesn’t block, masks, or rewrite content material. It returns findings with numeric scores for every safeguard, and also you resolve what motion your software ought to take. Along with your customized threshold, you could have full management to implement context-aware logic. For instance, you possibly can block high-confidence threats, route ambiguous findings to human evaluation, or log low-confidence outcomes for audits.
Symmetric request-response: The safeguards you configure in your request are the identical keys returned within the response. In the event you request contentFilter and sensitiveInformation, solely these two seem in outcomes. This makes it easy to map findings again to the safeguards that produced them.
Unbiased immediate assault detection: In contrast to the ApplyGuardrail API, the place immediate assault detection is bundled inside content material filters, the InvokeGuardrailChecks API separates immediate assault detection as its personal standalone examine. You possibly can invoke immediate assault detection independently with out working content material filters. Moreover, you possibly can specify particular person classes reminiscent of jailbreak, immediate injection, or immediate leakage to get fine-grained management.
The InvokeGuardrailChecks API helps the next safeguards:
| Safeguard | What it detects | Rating sort |
| Content material filters | Dangerous content material throughout classes: HATE, VIOLENCE, SEXUAL, INSULTS, MISCONDUCT | Severity rating (0–1) with discrete scores |
| Immediate assault detection | Jailbreaks, immediate injection, and immediate leakage makes an attempt | Severity rating (0–1) with discrete scores |
| Delicate data filters | PII entities together with e-mail, telephone, SSN, bank card numbers (31 entity varieties) | Confidence rating (0–1) with discrete scores |
The API returns two sorts of scores relying on the examine:
- Severity rating (content material filters and immediate assault): A discrete worth within the set {0, 0.2, 0.4, 0.6, 0.8, 1.0} that represents how strongly the content material matches the safeguard standards. A rating of 1.0 signifies the strongest match. A rating of 0 signifies benign content material. This rating measures the severity of the content material itself, not the understanding of the underlying mannequin.
- Confidence rating (delicate data): A discrete worth within the set {0, 0.2, 0.4, 0.6, 0.8, 1.0} that represents how sure the mannequin is in regards to the presence of a selected PII entity. Every discovering additionally contains
messageIndex,contentIndex, and character offsets (beginOffset,endOffset) for exact location inside the content material.
Getting began with the InvokeGuardrailChecks API
On this part, we stroll by way of learn how to use the InvokeGuardrailChecks API in your software.
Conditions
- An AWS account with Amazon Bedrock entry.
- An AWS Id and Entry Administration (IAM) position with
bedrock:InvokeGuardrailCheckspermission. - AWS Command Line Interface (AWS CLI) or AWS SDK (Boto3 for Python) put in.
- Fundamental familiarity with agentic AI ideas.
Step 1: Arrange IAM permission
As a result of the InvokeGuardrailChecks API is resourceless, there’s no guardrail ARN to scope. Connect the next identity-based coverage to your IAM position or person:
Why use Useful resource: "*"? The InvokeGuardrailChecks API is resourceless by design. There’s no guardrail ARN related to any name. The wildcard is the one legitimate worth for this discipline. This doesn’t grant entry to different Amazon Bedrock sources. It applies solely to the bedrock:InvokeGuardrailChecks motion.
To additional limit entry, mix with situation keys reminiscent of the next:
aws:SourceIporaws:SourceVpcto restrict calls to particular networks.aws:PrincipalTagto limit to particular groups or roles (for instance,"aws:PrincipalTag/group": "agent-safety").aws:RequestedRegionto constrain to particular AWS Areas (as proven within the previous coverage).
Step 2: Apply content material filters to person’s enter
When your agent receives a person’s message, examine for dangerous content material earlier than sending it to a mannequin. The next instance evaluates content material for violence and misconduct:
The next is the instance output:
The excessive severity scores point out that the content material strongly matches dangerous classes. Your software decides the motion, reminiscent of block, log, or escalate.
Step 3: Detect immediate assaults on system and person pairs
AI brokers usually have system directions that dangerous actors would possibly attempt to override. You possibly can consider a system-user message pair for jailbreaks and immediate leakage makes an attempt:
The next is the instance output:
Step 4: Run a number of checks on software output
When a software returns outcomes from an internet search or database question, you possibly can apply a number of checks in a single name. The API executes checks in parallel:
The next is the instance output:
The delicate data outcomes embody character offsets, supplying you with exact location information for client-side masking or redaction.
Step 5: Construct adaptive response logic with scores
The InvokeGuardrailChecks API makes use of scores to drive context-aware choices. The next sample reveals adaptive response logic:
With this sample, you possibly can implement thresholds that match your small business context. A monetary providers software would possibly block at 0.4, though a artistic writing software would possibly solely block at 0.8.
Step 6: Combine with an agent framework
The InvokeGuardrailChecks API integrates naturally with agent frameworks that expose lifecycle hooks. The next instance makes use of Strands Brokers, which gives hooks at key phases of the agent loop:
InvokeGuardrailChecks in comparison with ApplyGuardrail: When to make use of every
You need to use both the InvokeGuardrailChecks or ApplyGuardrail API provided by Amazon Bedrock Guardrails, relying in your use case and software. The next desk gives particulars and tips about when to make use of which API.
| InvokeGuardrailChecks | ApplyGuardrail | |
| Use case | Focused checks at particular factors or turns in workflows | Uniform enforcement throughout your software |
| Useful resource mannequin | Resourceless. Checks specified inline per request utilizing your personal management aircraft | Create, model, and handle guardrails sources upfront |
| Resolution logic | Detect solely. Returns numeric scores so that you resolve the motion to your software logic | Automated block, masks, or bypass primarily based on pre-configured thresholds |
| Focused towards | Agentic AI workflows requiring per-step security necessities | Conventional request-response AI purposes |
Clear up
The InvokeGuardrailChecks API is resourceless, so no persistent sources are created. To scrub up after testing, full the next steps:
- Take away any IAM insurance policies or roles.
- Delete any Amazon CloudWatch log teams when you configured logging throughout improvement.
Conclusion
The InvokeGuardrailChecks API enhances present Amazon Bedrock Guardrails capabilities with composable security constructing blocks for agentic AI. Listed below are some further takeaways:
- Granular management – Apply solely the safeguards that you just want at every stage of your agent loop with out creating particular person guardrail sources for every stage. This reduces operational overhead as you scale to lots of of brokers.
- Utility-driven choices – Numeric severity and confidence scores change opaque pass-or-fail outcomes. They assist adaptive logic that matches your small business context and provide you with management primarily based in your use case.
- Minimal overhead – No guardrail sources to create, model, or handle. Specify checks inline and evolve your security posture as workflows change.
To get began, see the InvokeGuardrailChecks API reference and apply particular person security checks throughout your agentic AI purposes.
In regards to the authors

