AWS Security ChangesHomeSearch

AWS cli documentation change

Service: cli · 2026-06-19 · Documentation low

File: cli/latest/reference/bedrock-agent-runtime/retrieve-and-generate.md

Summary

Added documentation for user-context parameter, managed knowledge base filters, query transformation configurations, and expanded retrieval configuration options including metadata filtering and reranking capabilities.

Security assessment

The change adds a 'user-context' parameter for access control filtering, which enables security through authorization controls. However, there is no evidence of a specific security vulnerability being addressed. The metadata filtering capabilities also support security by enabling data access controls.

Diff

diff --git a/cli/latest/reference/bedrock-agent-runtime/retrieve-and-generate.md b/cli/latest/reference/bedrock-agent-runtime/retrieve-and-generate.md
index 720219aa7..1f328dd36 100644
--- a//cli/latest/reference/bedrock-agent-runtime/retrieve-and-generate.md
+++ b//cli/latest/reference/bedrock-agent-runtime/retrieve-and-generate.md
@@ -15 +15 @@
-  * [AWS CLI 2.35.5 Command Reference](../../index.html) »
+  * [AWS CLI 2.35.8 Command Reference](../../index.html) »
@@ -60,0 +61,4 @@ Queries a knowledge base and generates responses based on the retrieved results
+### Note
+
+This API cannot be used with managed knowledge bases. Use [AgenticRetrieveStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_AgenticRetrieveStream.html) or [Retrieve](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html) with managed knowledge bases.
+
@@ -72,0 +77 @@ See also: [AWS API Documentation](https://docs.aws.amazon.com/goto/WebAPI/bedroc
+    [--user-context <value>]
@@ -653,4 +658,1056 @@ JSON Syntax:
->>>>> Constraints:
->>>>> 
->>>>>   * min: `1`
->>>>>   * max: `4000`
+>>>>> Constraints:
+>>>>> 
+>>>>>   * min: `1`
+>>>>>   * max: `4000`
+>>>>> 
+
+>>> 
+>>> queryTransformationConfiguration -> (structure)
+>>>
+>>>> To split up the prompt and retrieve multiple sources, set the transformation type to `QUERY_DECOMPOSITION` .
+>>>> 
+>>>> type -> (string) [required]
+>>>>
+>>>>> The type of transformation to apply to the prompt.
+>>>>> 
+>>>>> Possible values:
+>>>>> 
+>>>>>   * `QUERY_DECOMPOSITION`
+>>>>> 
+
+>> 
+>> retrievalConfiguration -> (structure)
+>>
+>>> Contains configurations for how to retrieve and return the knowledge base query.
+>>> 
+>>> managedSearchConfiguration -> (structure)
+>>>
+>>>> Contains configurations for managed search. For more information, see [Query configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html) .
+>>>> 
+>>>> filter -> (tagged union structure)
+>>>>
+>>>>> Specifies the filters to use on the metadata attributes in the knowledge base data sources before returning results. For more information, see [Query configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html) . See the examples below to see how to use these filters.
+>>>>> 
+>>>>> This data type is used in the following API operations:
+>>>>> 
+>>>>>   * [Retrieve request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) – in the `filter` field
+>>>>>   * [RetrieveAndGenerate request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) – in the `filter` field
+>>>>> 
+
+>>>>> 
+>>>>> ### Note
+>>>>> 
+>>>>> This is a Tagged Union structure. Only one of the following top level keys can be set: `andAll`, `equals`, `greaterThan`, `greaterThanOrEquals`, `in`, `lessThan`, `lessThanOrEquals`, `listContains`, `notEquals`, `notIn`, `orAll`, `startsWith`, `stringContains`.
+>>>>> 
+>>>>> andAll -> (list)
+>>>>>
+>>>>>> Knowledge base data sources are returned if their metadata attributes fulfill all the filter conditions inside this list.
+>>>>>> 
+>>>>>> Constraints:
+>>>>>> 
+>>>>>>   * min: `2`
+>>>>>> 
+
+>>>>>> 
+>>>>>> (tagged union structure)
+>>>>>>
+>>>>>>> Specifies the filters to use on the metadata attributes in the knowledge base data sources before returning results. For more information, see [Query configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html) . See the examples below to see how to use these filters.
+>>>>>>> 
+>>>>>>> This data type is used in the following API operations:
+>>>>>>> 
+>>>>>>>   * [Retrieve request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) – in the `filter` field
+>>>>>>>   * [RetrieveAndGenerate request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) – in the `filter` field
+>>>>>>> 
+
+>>>>>>> 
+>>>>>>> ### Note
+>>>>>>> 
+>>>>>>> This is a Tagged Union structure. Only one of the following top level keys can be set: `andAll`, `equals`, `greaterThan`, `greaterThanOrEquals`, `in`, `lessThan`, `lessThanOrEquals`, `listContains`, `notEquals`, `notIn`, `orAll`, `startsWith`, `stringContains`.
+>>>>>>> 
+>>>>>>> andAll -> (list)
+>>>>>>>
+>>>>>>>> Knowledge base data sources are returned if their metadata attributes fulfill all the filter conditions inside this list.
+>>>>>>>> 
+>>>>>>>> Constraints:
+>>>>>>>> 
+>>>>>>>>   * min: `2`
+>>>>>>>> 
+
+>>>>>>>> 
+>>>>>>>> ( … recursive … )
+>>>>>>> 
+>>>>>>> equals -> (structure)
+>>>>>>>
+>>>>>>>> Knowledge base data sources are returned if they contain a metadata attribute whose name matches the `key` and whose value matches the `value` in this object.
+>>>>>>>> 
+>>>>>>>> The following example would return data sources with an `animal` attribute whose value is `cat` :
+>>>>>>>>
+>>>>>>>>> `"equals": { "key": "animal", "value": "cat" }`
+>>>>>>>> 
+>>>>>>>> key -> (string) [required]
+>>>>>>>>
+>>>>>>>>> The name that the metadata attribute must match.
+>>>>>>>>> 
+>>>>>>>>> Constraints:
+>>>>>>>>> 
+>>>>>>>>>   * min: `1`
+>>>>>>>>>   * max: `100`
+>>>>>>>>> 
+
+>>>>>>>> 
+>>>>>>>> value -> (document) [required]
+>>>>>>>>
+>>>>>>>>> The value to which to compare the value of the metadata attribute.
+>>>>>>> 
+>>>>>>> greaterThan -> (structure)
+>>>>>>>
+>>>>>>>> Knowledge base data sources are returned if they contain a metadata attribute whose name matches the `key` and whose value is greater than the `value` in this object.
+>>>>>>>> 
+>>>>>>>> The following example would return data sources with an `year` attribute whose value is greater than `1989` :
+>>>>>>>>
+>>>>>>>>> `"greaterThan": { "key": "year", "value": 1989 }`
+>>>>>>>> 
+>>>>>>>> key -> (string) [required]
+>>>>>>>>
+>>>>>>>>> The name that the metadata attribute must match.
+>>>>>>>>> 
+>>>>>>>>> Constraints:
+>>>>>>>>> 
+>>>>>>>>>   * min: `1`
+>>>>>>>>>   * max: `100`
+>>>>>>>>> 
+
+>>>>>>>> 
+>>>>>>>> value -> (document) [required]
+>>>>>>>>
+>>>>>>>>> The value to which to compare the value of the metadata attribute.
+>>>>>>> 
+>>>>>>> greaterThanOrEquals -> (structure)
+>>>>>>>
+>>>>>>>> Knowledge base data sources are returned if they contain a metadata attribute whose name matches the `key` and whose value is greater than or equal to the `value` in this object.
+>>>>>>>> 
+>>>>>>>> The following example would return data sources with an `year` attribute whose value is greater than or equal to `1989` :
+>>>>>>>>
+>>>>>>>>> `"greaterThanOrEquals": { "key": "year", "value": 1989 }`
+>>>>>>>> 
+>>>>>>>> key -> (string) [required]
+>>>>>>>>
+>>>>>>>>> The name that the metadata attribute must match.
+>>>>>>>>> 
+>>>>>>>>> Constraints:
+>>>>>>>>> 
+>>>>>>>>>   * min: `1`
+>>>>>>>>>   * max: `100`
+>>>>>>>>> 
+
+>>>>>>>> 
+>>>>>>>> value -> (document) [required]
+>>>>>>>>
+>>>>>>>>> The value to which to compare the value of the metadata attribute.
+>>>>>>> 
+>>>>>>> in -> (structure)
+>>>>>>>
+>>>>>>>> Knowledge base data sources are returned if they contain a metadata attribute whose name matches the `key` and whose value is in the list specified in the `value` in this object.
+>>>>>>>> 
+>>>>>>>> The following example would return data sources with an `animal` attribute that is either `cat` or `dog` :
+>>>>>>>>
+>>>>>>>>> `"in": { "key": "animal", "value": ["cat", "dog"] }`
+>>>>>>>> 
+>>>>>>>> key -> (string) [required]
+>>>>>>>>
+>>>>>>>>> The name that the metadata attribute must match.
+>>>>>>>>> 
+>>>>>>>>> Constraints:
+>>>>>>>>> 
+>>>>>>>>>   * min: `1`
+>>>>>>>>>   * max: `100`
+>>>>>>>>> 
+
+>>>>>>>> 
+>>>>>>>> value -> (document) [required]
+>>>>>>>>
+>>>>>>>>> The value to which to compare the value of the metadata attribute.
+>>>>>>> 
+>>>>>>> lessThan -> (structure)
+>>>>>>>
+>>>>>>>> Knowledge base data sources are returned if they contain a metadata attribute whose name matches the `key` and whose value is less than the `value` in this object.
+>>>>>>>> 
+>>>>>>>> The following example would return data sources with an `year` attribute whose value is less than to `1989` .
+>>>>>>>>
+>>>>>>>>> `"lessThan": { "key": "year", "value": 1989 }`
+>>>>>>>>