At present, we’re saying a brand new API with Amazon Bedrock Guardrails. With this API, you may 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 pliability 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 may 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 supplies configurable safeguards that can assist 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 defend delicate data in each consumer 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 means of loops, typically with out direct consumer interplay. Every step on this loop carries a special danger profile and requires completely different safeguards. With the InvokeGuardrailChecks API, you may 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 individual threshold and motion on your software. On this submit, we stroll by means of how the InvokeGuardrailChecks API works and how one can use it to construct protected, multi-turn agentic AI purposes.
Why agentic AI wants focused security controls
Generative AI purposes sometimes comply with a well-known sample: a consumer 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 consumer 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 consumer (output).
Think about a multi-turn buyer help agent that handles various requests throughout a dialog:
- Consumer sends preliminary query (danger: immediate injection points).
- Mannequin generates a plan or response asking for particulars (danger: mannequin output would possibly comprise dangerous content material influencing the mannequin’s reasoning).
- Consumer sends follow-up with account particulars (danger: enter would possibly comprise delicate data, that’s, personally identifiable data (PII)).
- Mannequin generates remaining response (danger: dangerous or inappropriate content material within the reply).
Every step has a definite danger 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 may outline the suitable thresholds and actions in your software logic, equivalent to 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 equivalent to system, consumer, or assistant. That is how agent interactions function in loops. These roles present the context the safeguard wants to guage the content material exactly. This facet is vital for multi-turn agentic workflows.
The InvokeGuardrailChecks API gives the next capabilities:
Resourceless: You don’t have to 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 straight in every API request. This makes it easy so as to add, take away, or regulate 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 instrument’s output earlier than passing it to the subsequent 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 consumer 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 may 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 test. You may invoke immediate assault detection independently with out operating content material filters. Moreover, you may specify particular person classes equivalent to 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 electronic mail, telephone, SSN, bank card numbers (31 entity sorts) | Confidence rating (0–1) with discrete scores |
The API returns two sorts of scores relying on the test:
- 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 consists of
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 means of how one can use the InvokeGuardrailChecks API in your software.
Stipulations
- An AWS account with Amazon Bedrock entry.
- An AWS Identification 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 consumer:
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 subject. This doesn’t grant entry to different Amazon Bedrock sources. It applies solely to the bedrock:InvokeGuardrailChecks motion.
To additional prohibit entry, mix with situation keys equivalent to the next:
aws:SourceIporaws:SourceVpcto restrict calls to particular networks.aws:PrincipalTagto limit to particular groups or roles (for instance,"aws:PrincipalTag/workforce": "agent-safety").aws:RequestedRegionto constrain to particular AWS Areas (as proven within the previous coverage).
Step 2: Apply content material filters to consumer’s enter
When your agent receives a consumer’s message, test 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, equivalent to block, log, or escalate.
Step 3: Detect immediate assaults on system and consumer pairs
AI brokers typically have system directions that unhealthy actors would possibly attempt to override. You may 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 instrument output
When a instrument returns outcomes from an online search or database question, you may 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 embrace character offsets, supplying you with exact location knowledge 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 selections. The next sample reveals adaptive response logic:
With this sample, you may implement thresholds that match your enterprise context. A monetary companies software would possibly block at 0.4, though a artistic writing instrument 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 supplies hooks at key phases of the agent loop:
InvokeGuardrailChecks in comparison with ApplyGuardrail: When to make use of every
You should utilize both the InvokeGuardrailChecks or ApplyGuardrail API supplied by Amazon Bedrock Guardrails, relying in your use case and software. The next desk supplies particulars and tips on 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 individual management airplane | Create, model, and handle guardrails sources upfront |
| Resolution logic | Detect solely. Returns numeric scores so that you resolve the motion on your software logic | Computerized 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 wash up after testing, full the next steps:
- Take away any IAM insurance policies or roles.
- Delete any Amazon CloudWatch log teams in case you configured logging throughout improvement.
Conclusion
The InvokeGuardrailChecks API enhances present Amazon Bedrock Guardrails capabilities with composable security constructing blocks for agentic AI. Listed here are some extra 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 selections – Numeric severity and confidence scores change opaque pass-or-fail outcomes. They help adaptive logic that matches your enterprise context and offer you 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
