AWS Security ChangesHomeSearch

AWS bedrock medium security documentation change

Service: bedrock · 2025-04-11 · Security-related medium

File: bedrock/latest/userguide/agents-test.md

Summary

Added documentation about streaming responses with guardrail interval controls, testing requirements for post-March 2025 agents, and updated testing steps with streaming preferences

Security assessment

Added guardrail interval configuration details that control security filtering frequency (ApplyGuardrail calls) and required IAM permission bedrock:InvokeModelWithResponseStream for secure access

Diff

diff --git a/bedrock/latest/userguide/agents-test.md b/bedrock/latest/userguide/agents-test.md
index 804e9ab60..cfe91fa73 100644
--- a//bedrock/latest/userguide/agents-test.md
+++ b//bedrock/latest/userguide/agents-test.md
@@ -4,0 +5,2 @@
+Streaming responseTracing agent behaviorTest your agent
+
@@ -7 +9 @@
-After you create an agent, you will have a _working draft_. The working draft is a version of the agent that you can use to iteratively build the agent. Each time you make changes to your agent, the working draft is updated. When you're satisfied with your agent's configurations, you can create a _version_ , which is a snapshot of your agent, and an _alias_ , which points to the version. You can then deploy your agent to your applications by calling the alias. For more information, see [Deploy and integrate an Amazon Bedrock agent into your application](./agents-deploy.html).
+After you create an agent, you will have a _working draft_. The working draft is a version of the agent that you can use to iteratively build the agent. Each time you make changes to your agent, the working draft is updated. When you're satisfied with your agent's configurations, you can create a _version_ , which is a snapshot of your agent, and an _alias_ , which points to the version. You can then deploy your agent to your applications by calling the alias. For more information, see [Deploy and use an Amazon Bedrock agent in your application](./agents-deploy.html).
@@ -17,0 +20,20 @@ The following list describes how you test your agent:
+## Streaming response
+
+The response from `InvokeAgent` call comes in one chunk. You can optionally enable streaming of the response. If streaming is enabled, the response contains multiple events with chunks for each part of the response in order. If your agent is configured with a guardrail, you can also control how often an `ApplyGuardrail` call is made on outgoing response characters by specifying the character interval at which the guardrail will be applied when generating text response. 
+
+By default, the guardrail interval is set to 50 characters. If a larger interval is specified, the response will be generated in larger chunks with fewer `ApplyGuardrail` calls. The following examples show the response generated for _Hello, I am an agent_ input string.
+
+**Example response in chunks: Interval set to 3 characters**
+    
+    
+    'Hel', 'lo, ','I am', ' an', ' Age', 'nt'
+
+Each chunk has at least 3 characters except for the last chunk.
+
+**Example response in chunks: Interval set to 20 or more characters**
+    
+    
+    Hello, I am an Agent
+
+## Tracing agent behavior
+
@@ -19,0 +42,11 @@ To help troubleshoot your agent's behavior, Amazon Bedrock Agents provides the a
+## Test your agent
+
+For agents that are created `after` March 31, 2025: 
+
+  * If you've created your agent in the console, streaming is enabled by default. You can disable streaming anytime.
+
+  * Ensure the Agent execution role includes the `bedrock:InvokeModelWithResponseStream` permission for the configured agent model.
+
+
+
+
@@ -53 +86,3 @@ Every time you update the working draft, you must prepare the agent to package t
-  8. (Optional) To use a prompt from Prompt management, select the options icon ( ![Vertical ellipsis icon representing a menu or more options.](/images/bedrock/latest/userguide/images/icons/vertical-ellipsis.png) ) in the message box and choose **Import prompt**. Select the prompt and version. Enter values for the prompt variables in the **Test variable values** section. For more information about prompts in Prompt management, see [Construct and store reusable prompts with Prompt management in Amazon Bedrock](./prompt-management.html).
+  8. (Optional) To enable or disable streaming, choose **Streaming preferences** , enable or disable **Stream responses** and choose **Confirm**. If you've enabled streaming and if the agent is configured with guardrail, you can optionally specify character interval. 
+
+  9. (Optional) To use a prompt from Prompt management, select the options icon ( ![Vertical ellipsis icon representing a menu or more options.](/images/bedrock/latest/userguide/images/icons/vertical-ellipsis.png) ) in the message box and choose **Import prompt**. Select the prompt and version. Enter values for the prompt variables in the **Test variable values** section. For more information about prompts in Prompt management, see [Construct and store reusable prompts with Prompt management in Amazon Bedrock](./prompt-management.html).
@@ -55 +90 @@ Every time you update the working draft, you must prepare the agent to package t
-  9. To test the agent, enter a message and choose **Run**. While you wait for the response to generate or after it is generated, you have the following options:
+  10. To test the agent, enter a message and choose **Run**. While you wait for the response to generate or after it is generated, you have the following options:
@@ -135,0 +171,3 @@ sessionState | Includes context that influences the agent's behavior or the beha
+streamingConfigurations | Includes configurations for streaming response. To enable streaming, set `streamFinalResponse` to `TRUE`.  
+  
+
@@ -137,0 +176 @@ sessionState | Includes context that influences the agent's behavior or the beha
+The response is returned in an event stream. Each event contains a `chunk`, which contains part of the response in the `bytes` field, which must be decoded. The following objects may also be returned:
@@ -138,0 +178 @@ sessionState | Includes context that influences the agent's behavior or the beha
+  * If the agent queried a knowledge base, the `chunk` also includes `citations`.
@@ -140 +180 @@ sessionState | Includes context that influences the agent's behavior or the beha
-The response is returned in an event stream. Each event contains a `chunk`, which contains part of the response in the `bytes` field, which must be decoded. If the agent queried a knowledge base, the `chunk` also includes `citations`. The following objects may also be returned:
+  * If streaming is enabled and guardrail is configured for the agent, the response is generated in the character intervals specified for the guardrail interval. By default, the interval is set to 50 characters.