2025/08/05 - Amazon Bedrock - 24 new3 updated api methods
Changes This release introduces Automated Reasoning checks for Amazon Bedrock Guardrails. The feature adds new APIs for policy building, refinement, version management, and testing. Guardrail APIs now support Automated Reasoning policy configuration and validation output.
Initiates a test workflow to validate Automated Reasoning policy tests. The workflow executes the specified tests against the policy and generates validation results.
See also: AWS API Documentation
Request Syntax
client.start_automated_reasoning_policy_test_workflow( policyArn='string', buildWorkflowId='string', testCaseIds=[ 'string', ], clientRequestToken='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy to test.
string
[REQUIRED]
The build workflow identifier. The build workflow must show a COMPLETED status before running tests.
list
The list of test identifiers to run. If not provided, all tests for the policy are run.
(string) --
string
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request but doesn't return an error.
This field is autopopulated if not provided.
dict
Response Syntax
{ 'policyArn': 'string' }
Response Structure
(dict) --
policyArn (string) --
The Amazon Resource Name (ARN) of the policy for which the test workflow was started.
Lists test results for an Automated Reasoning policy, showing how the policy performed against various test scenarios and validation checks.
See also: AWS API Documentation
Request Syntax
client.list_automated_reasoning_policy_test_results( policyArn='string', buildWorkflowId='string', nextToken='string', maxResults=123 )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy whose test results you want to list.
string
[REQUIRED]
The unique identifier of the build workflow whose test results you want to list.
string
A pagination token from a previous request to continue listing test results from where the previous request left off.
integer
The maximum number of test results to return in a single response. Valid range is 1-100.
dict
Response Syntax
{ 'testResults': [ { 'testCase': { 'testCaseId': 'string', 'guardContent': 'string', 'queryContent': 'string', 'expectedAggregatedFindingsResult': 'VALID'|'INVALID'|'SATISFIABLE'|'IMPOSSIBLE'|'TRANSLATION_AMBIGUOUS'|'TOO_COMPLEX'|'NO_TRANSLATION', 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1), 'confidenceThreshold': 123.0 }, 'policyArn': 'string', 'testRunStatus': 'NOT_STARTED'|'SCHEDULED'|'IN_PROGRESS'|'COMPLETED'|'FAILED', 'testFindings': [ { 'valid': { 'translation': { 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'untranslatedPremises': [ { 'text': 'string' }, ], 'untranslatedClaims': [ { 'text': 'string' }, ], 'confidence': 123.0 }, 'claimsTrueScenario': { 'statements': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ] }, 'supportingRules': [ { 'id': 'string', 'policyVersionArn': 'string' }, ], 'logicWarning': { 'type': 'ALWAYS_TRUE'|'ALWAYS_FALSE', 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ] } }, 'invalid': { 'translation': { 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'untranslatedPremises': [ { 'text': 'string' }, ], 'untranslatedClaims': [ { 'text': 'string' }, ], 'confidence': 123.0 }, 'contradictingRules': [ { 'id': 'string', 'policyVersionArn': 'string' }, ], 'logicWarning': { 'type': 'ALWAYS_TRUE'|'ALWAYS_FALSE', 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ] } }, 'satisfiable': { 'translation': { 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'untranslatedPremises': [ { 'text': 'string' }, ], 'untranslatedClaims': [ { 'text': 'string' }, ], 'confidence': 123.0 }, 'claimsTrueScenario': { 'statements': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ] }, 'claimsFalseScenario': { 'statements': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ] }, 'logicWarning': { 'type': 'ALWAYS_TRUE'|'ALWAYS_FALSE', 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ] } }, 'impossible': { 'translation': { 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'untranslatedPremises': [ { 'text': 'string' }, ], 'untranslatedClaims': [ { 'text': 'string' }, ], 'confidence': 123.0 }, 'contradictingRules': [ { 'id': 'string', 'policyVersionArn': 'string' }, ], 'logicWarning': { 'type': 'ALWAYS_TRUE'|'ALWAYS_FALSE', 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ] } }, 'translationAmbiguous': { 'options': [ { 'translations': [ { 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'untranslatedPremises': [ { 'text': 'string' }, ], 'untranslatedClaims': [ { 'text': 'string' }, ], 'confidence': 123.0 }, ] }, ], 'differenceScenarios': [ { 'statements': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ] }, ] }, 'tooComplex': {}, 'noTranslations': {} }, ], 'testRunResult': 'PASSED'|'FAILED', 'aggregatedTestFindingsResult': 'VALID'|'INVALID'|'SATISFIABLE'|'IMPOSSIBLE'|'TRANSLATION_AMBIGUOUS'|'TOO_COMPLEX'|'NO_TRANSLATION', 'updatedAt': datetime(2015, 1, 1) }, ], 'nextToken': 'string' }
Response Structure
(dict) --
testResults (list) --
A list of test results, each containing information about how the policy performed on specific test scenarios.
(dict) --
Contains the results of testing an Automated Reasoning policy against various scenarios and validation checks.
testCase (dict) --
Represents a test for validating an Automated Reasoning policy. tests contain sample inputs and expected outcomes to verify policy behavior.
testCaseId (string) --
The unique identifier of the test.
guardContent (string) --
The output content to be validated by the policy, typically representing a foundation model response.
queryContent (string) --
The input query or prompt that generated the content. This provides context for the validation.
expectedAggregatedFindingsResult (string) --
The expected result of the Automated Reasoning check for this test.
createdAt (datetime) --
The timestamp when the test was created.
updatedAt (datetime) --
The timestamp when the test was last updated.
confidenceThreshold (float) --
The minimum confidence level for logic validation. Content meeting this threshold is considered high-confidence and can be validated.
policyArn (string) --
The Amazon Resource Name (ARN) of the Automated Reasoning policy that was tested.
testRunStatus (string) --
The overall status of the test run (e.g., COMPLETED, FAILED, IN_PROGRESS).
testFindings (list) --
Detailed findings from the test run, including any issues, violations, or unexpected behaviors discovered.
(dict) --
Represents the result of an Automated Reasoning validation check, indicating whether the content is logically valid, invalid, or falls into other categories based on the policy rules.
valid (dict) --
Indicates that the claims are true. The claims are implied by the premises and the Automated Reasoning policy. Given the Automated Reasoning policy and premises, it is not possible for these claims to be false.
translation (dict) --
The logical translation of the input that this finding validates.
premises (list) --
The logical statements that serve as the foundation or assumptions for the claims.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are being validated against the premises and policy rules.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
untranslatedPremises (list) --
References to portions of the original input text that correspond to the premises but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
untranslatedClaims (list) --
References to portions of the original input text that correspond to the claims but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
confidence (float) --
A confidence score between 0 and 1 indicating how certain the system is about the logical translation.
claimsTrueScenario (dict) --
An example scenario demonstrating how the claims are logically true.
statements (list) --
List of logical assignments and statements that define this scenario.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
supportingRules (list) --
The automated reasoning policy rules that support why this result is considered valid.
(dict) --
References a specific automated reasoning policy rule that was applied during evaluation.
id (string) --
The unique identifier of the automated reasoning rule.
policyVersionArn (string) --
The ARN of the automated reasoning policy version that contains this rule.
logicWarning (dict) --
Indication of a logic issue with the translation without needing to consider the automated reasoning policy rules.
type (string) --
The category of the detected logical issue, such as statements that are always true or always false.
premises (list) --
The logical statements that serve as premises under which the claims are validated.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are validated while assuming the policy and premises.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
invalid (dict) --
Indicates that the claims are false. The claims are not implied by the premises and Automated Reasoning policy. Furthermore, there exist different claims that are consistent with the premises and Automated Reasoning policy.
translation (dict) --
The logical translation of the input that this finding invalidates.
premises (list) --
The logical statements that serve as the foundation or assumptions for the claims.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are being validated against the premises and policy rules.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
untranslatedPremises (list) --
References to portions of the original input text that correspond to the premises but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
untranslatedClaims (list) --
References to portions of the original input text that correspond to the claims but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
confidence (float) --
A confidence score between 0 and 1 indicating how certain the system is about the logical translation.
contradictingRules (list) --
The automated reasoning policy rules that contradict the claims in the input.
(dict) --
References a specific automated reasoning policy rule that was applied during evaluation.
id (string) --
The unique identifier of the automated reasoning rule.
policyVersionArn (string) --
The ARN of the automated reasoning policy version that contains this rule.
logicWarning (dict) --
Indication of a logic issue with the translation without needing to consider the automated reasoning policy rules.
type (string) --
The category of the detected logical issue, such as statements that are always true or always false.
premises (list) --
The logical statements that serve as premises under which the claims are validated.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are validated while assuming the policy and premises.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
satisfiable (dict) --
Indicates that the claims can be true or false. It depends on what assumptions are made for the claim to be implied from the premises and Automated Reasoning policy rules. In this situation, different assumptions can make input claims false and alternative claims true.
translation (dict) --
The logical translation of the input that this finding evaluates.
premises (list) --
The logical statements that serve as the foundation or assumptions for the claims.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are being validated against the premises and policy rules.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
untranslatedPremises (list) --
References to portions of the original input text that correspond to the premises but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
untranslatedClaims (list) --
References to portions of the original input text that correspond to the claims but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
confidence (float) --
A confidence score between 0 and 1 indicating how certain the system is about the logical translation.
claimsTrueScenario (dict) --
An example scenario demonstrating how the claims could be logically true.
statements (list) --
List of logical assignments and statements that define this scenario.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claimsFalseScenario (dict) --
An example scenario demonstrating how the claims could be logically false.
statements (list) --
List of logical assignments and statements that define this scenario.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
logicWarning (dict) --
Indication of a logic issue with the translation without needing to consider the automated reasoning policy rules.
type (string) --
The category of the detected logical issue, such as statements that are always true or always false.
premises (list) --
The logical statements that serve as premises under which the claims are validated.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are validated while assuming the policy and premises.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
impossible (dict) --
Indicates that Automated Reasoning cannot make a statement about the claims. This can happen if the premises are logically incorrect, or if there is a conflict within the Automated Reasoning policy itself.
translation (dict) --
The logical translation of the input that this finding evaluates.
premises (list) --
The logical statements that serve as the foundation or assumptions for the claims.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are being validated against the premises and policy rules.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
untranslatedPremises (list) --
References to portions of the original input text that correspond to the premises but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
untranslatedClaims (list) --
References to portions of the original input text that correspond to the claims but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
confidence (float) --
A confidence score between 0 and 1 indicating how certain the system is about the logical translation.
contradictingRules (list) --
The automated reasoning policy rules that contradict the claims and/or premises in the input.
(dict) --
References a specific automated reasoning policy rule that was applied during evaluation.
id (string) --
The unique identifier of the automated reasoning rule.
policyVersionArn (string) --
The ARN of the automated reasoning policy version that contains this rule.
logicWarning (dict) --
Indication of a logic issue with the translation without needing to consider the automated reasoning policy rules.
type (string) --
The category of the detected logical issue, such as statements that are always true or always false.
premises (list) --
The logical statements that serve as premises under which the claims are validated.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are validated while assuming the policy and premises.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
translationAmbiguous (dict) --
Indicates that an ambiguity was detected in the translation, making it unsound to continue with validity checking. Additional context or follow-up questions might be needed to get translation to succeed.
options (list) --
Different logical interpretations that were detected during translation of the input.
(dict) --
Represents one possible logical interpretation of ambiguous input content.
translations (list) --
Different logical interpretations that were detected during translation of the input.
(dict) --
Contains the logical translation of natural language input into formal logical statements, including premises, claims, and confidence scores.
premises (list) --
The logical statements that serve as the foundation or assumptions for the claims.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are being validated against the premises and policy rules.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
untranslatedPremises (list) --
References to portions of the original input text that correspond to the premises but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
untranslatedClaims (list) --
References to portions of the original input text that correspond to the claims but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
confidence (float) --
A confidence score between 0 and 1 indicating how certain the system is about the logical translation.
differenceScenarios (list) --
Scenarios showing how the different translation options differ in meaning.
(dict) --
Represents a logical scenario where claims can be evaluated as true or false, containing specific logical assignments.
statements (list) --
List of logical assignments and statements that define this scenario.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
tooComplex (dict) --
Indicates that the input contains too much information for Automated Reasoning to process within its latency limits.
noTranslations (dict) --
Identifies that some or all of the input prompt wasn't translated into logic. This can happen if the input isn't relevant to the Automated Reasoning policy, or if the policy doesn't have variables to model relevant input.
testRunResult (string) --
The overall result of the test run, indicating whether the policy passed or failed validation.
aggregatedTestFindingsResult (string) --
A summary of all test findings, aggregated to provide an overall assessment of policy quality and correctness.
updatedAt (datetime) --
The timestamp when the test results were last updated.
nextToken (string) --
A pagination token to use in subsequent requests to retrieve additional test results.
Retrieves the test result for a specific Automated Reasoning policy test. Returns detailed validation findings and execution status.
See also: AWS API Documentation
Request Syntax
client.get_automated_reasoning_policy_test_result( policyArn='string', buildWorkflowId='string', testCaseId='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy.
string
[REQUIRED]
The build workflow identifier. The build workflow must display a COMPLETED status to get results.
string
[REQUIRED]
The unique identifier of the test for which to retrieve results.
dict
Response Syntax
{ 'testResult': { 'testCase': { 'testCaseId': 'string', 'guardContent': 'string', 'queryContent': 'string', 'expectedAggregatedFindingsResult': 'VALID'|'INVALID'|'SATISFIABLE'|'IMPOSSIBLE'|'TRANSLATION_AMBIGUOUS'|'TOO_COMPLEX'|'NO_TRANSLATION', 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1), 'confidenceThreshold': 123.0 }, 'policyArn': 'string', 'testRunStatus': 'NOT_STARTED'|'SCHEDULED'|'IN_PROGRESS'|'COMPLETED'|'FAILED', 'testFindings': [ { 'valid': { 'translation': { 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'untranslatedPremises': [ { 'text': 'string' }, ], 'untranslatedClaims': [ { 'text': 'string' }, ], 'confidence': 123.0 }, 'claimsTrueScenario': { 'statements': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ] }, 'supportingRules': [ { 'id': 'string', 'policyVersionArn': 'string' }, ], 'logicWarning': { 'type': 'ALWAYS_TRUE'|'ALWAYS_FALSE', 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ] } }, 'invalid': { 'translation': { 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'untranslatedPremises': [ { 'text': 'string' }, ], 'untranslatedClaims': [ { 'text': 'string' }, ], 'confidence': 123.0 }, 'contradictingRules': [ { 'id': 'string', 'policyVersionArn': 'string' }, ], 'logicWarning': { 'type': 'ALWAYS_TRUE'|'ALWAYS_FALSE', 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ] } }, 'satisfiable': { 'translation': { 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'untranslatedPremises': [ { 'text': 'string' }, ], 'untranslatedClaims': [ { 'text': 'string' }, ], 'confidence': 123.0 }, 'claimsTrueScenario': { 'statements': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ] }, 'claimsFalseScenario': { 'statements': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ] }, 'logicWarning': { 'type': 'ALWAYS_TRUE'|'ALWAYS_FALSE', 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ] } }, 'impossible': { 'translation': { 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'untranslatedPremises': [ { 'text': 'string' }, ], 'untranslatedClaims': [ { 'text': 'string' }, ], 'confidence': 123.0 }, 'contradictingRules': [ { 'id': 'string', 'policyVersionArn': 'string' }, ], 'logicWarning': { 'type': 'ALWAYS_TRUE'|'ALWAYS_FALSE', 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ] } }, 'translationAmbiguous': { 'options': [ { 'translations': [ { 'premises': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'claims': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ], 'untranslatedPremises': [ { 'text': 'string' }, ], 'untranslatedClaims': [ { 'text': 'string' }, ], 'confidence': 123.0 }, ] }, ], 'differenceScenarios': [ { 'statements': [ { 'logic': 'string', 'naturalLanguage': 'string' }, ] }, ] }, 'tooComplex': {}, 'noTranslations': {} }, ], 'testRunResult': 'PASSED'|'FAILED', 'aggregatedTestFindingsResult': 'VALID'|'INVALID'|'SATISFIABLE'|'IMPOSSIBLE'|'TRANSLATION_AMBIGUOUS'|'TOO_COMPLEX'|'NO_TRANSLATION', 'updatedAt': datetime(2015, 1, 1) } }
Response Structure
(dict) --
testResult (dict) --
The test result containing validation findings, execution status, and detailed analysis.
testCase (dict) --
Represents a test for validating an Automated Reasoning policy. tests contain sample inputs and expected outcomes to verify policy behavior.
testCaseId (string) --
The unique identifier of the test.
guardContent (string) --
The output content to be validated by the policy, typically representing a foundation model response.
queryContent (string) --
The input query or prompt that generated the content. This provides context for the validation.
expectedAggregatedFindingsResult (string) --
The expected result of the Automated Reasoning check for this test.
createdAt (datetime) --
The timestamp when the test was created.
updatedAt (datetime) --
The timestamp when the test was last updated.
confidenceThreshold (float) --
The minimum confidence level for logic validation. Content meeting this threshold is considered high-confidence and can be validated.
policyArn (string) --
The Amazon Resource Name (ARN) of the Automated Reasoning policy that was tested.
testRunStatus (string) --
The overall status of the test run (e.g., COMPLETED, FAILED, IN_PROGRESS).
testFindings (list) --
Detailed findings from the test run, including any issues, violations, or unexpected behaviors discovered.
(dict) --
Represents the result of an Automated Reasoning validation check, indicating whether the content is logically valid, invalid, or falls into other categories based on the policy rules.
valid (dict) --
Indicates that the claims are true. The claims are implied by the premises and the Automated Reasoning policy. Given the Automated Reasoning policy and premises, it is not possible for these claims to be false.
translation (dict) --
The logical translation of the input that this finding validates.
premises (list) --
The logical statements that serve as the foundation or assumptions for the claims.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are being validated against the premises and policy rules.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
untranslatedPremises (list) --
References to portions of the original input text that correspond to the premises but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
untranslatedClaims (list) --
References to portions of the original input text that correspond to the claims but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
confidence (float) --
A confidence score between 0 and 1 indicating how certain the system is about the logical translation.
claimsTrueScenario (dict) --
An example scenario demonstrating how the claims are logically true.
statements (list) --
List of logical assignments and statements that define this scenario.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
supportingRules (list) --
The automated reasoning policy rules that support why this result is considered valid.
(dict) --
References a specific automated reasoning policy rule that was applied during evaluation.
id (string) --
The unique identifier of the automated reasoning rule.
policyVersionArn (string) --
The ARN of the automated reasoning policy version that contains this rule.
logicWarning (dict) --
Indication of a logic issue with the translation without needing to consider the automated reasoning policy rules.
type (string) --
The category of the detected logical issue, such as statements that are always true or always false.
premises (list) --
The logical statements that serve as premises under which the claims are validated.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are validated while assuming the policy and premises.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
invalid (dict) --
Indicates that the claims are false. The claims are not implied by the premises and Automated Reasoning policy. Furthermore, there exist different claims that are consistent with the premises and Automated Reasoning policy.
translation (dict) --
The logical translation of the input that this finding invalidates.
premises (list) --
The logical statements that serve as the foundation or assumptions for the claims.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are being validated against the premises and policy rules.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
untranslatedPremises (list) --
References to portions of the original input text that correspond to the premises but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
untranslatedClaims (list) --
References to portions of the original input text that correspond to the claims but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
confidence (float) --
A confidence score between 0 and 1 indicating how certain the system is about the logical translation.
contradictingRules (list) --
The automated reasoning policy rules that contradict the claims in the input.
(dict) --
References a specific automated reasoning policy rule that was applied during evaluation.
id (string) --
The unique identifier of the automated reasoning rule.
policyVersionArn (string) --
The ARN of the automated reasoning policy version that contains this rule.
logicWarning (dict) --
Indication of a logic issue with the translation without needing to consider the automated reasoning policy rules.
type (string) --
The category of the detected logical issue, such as statements that are always true or always false.
premises (list) --
The logical statements that serve as premises under which the claims are validated.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are validated while assuming the policy and premises.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
satisfiable (dict) --
Indicates that the claims can be true or false. It depends on what assumptions are made for the claim to be implied from the premises and Automated Reasoning policy rules. In this situation, different assumptions can make input claims false and alternative claims true.
translation (dict) --
The logical translation of the input that this finding evaluates.
premises (list) --
The logical statements that serve as the foundation or assumptions for the claims.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are being validated against the premises and policy rules.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
untranslatedPremises (list) --
References to portions of the original input text that correspond to the premises but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
untranslatedClaims (list) --
References to portions of the original input text that correspond to the claims but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
confidence (float) --
A confidence score between 0 and 1 indicating how certain the system is about the logical translation.
claimsTrueScenario (dict) --
An example scenario demonstrating how the claims could be logically true.
statements (list) --
List of logical assignments and statements that define this scenario.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claimsFalseScenario (dict) --
An example scenario demonstrating how the claims could be logically false.
statements (list) --
List of logical assignments and statements that define this scenario.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
logicWarning (dict) --
Indication of a logic issue with the translation without needing to consider the automated reasoning policy rules.
type (string) --
The category of the detected logical issue, such as statements that are always true or always false.
premises (list) --
The logical statements that serve as premises under which the claims are validated.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are validated while assuming the policy and premises.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
impossible (dict) --
Indicates that Automated Reasoning cannot make a statement about the claims. This can happen if the premises are logically incorrect, or if there is a conflict within the Automated Reasoning policy itself.
translation (dict) --
The logical translation of the input that this finding evaluates.
premises (list) --
The logical statements that serve as the foundation or assumptions for the claims.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are being validated against the premises and policy rules.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
untranslatedPremises (list) --
References to portions of the original input text that correspond to the premises but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
untranslatedClaims (list) --
References to portions of the original input text that correspond to the claims but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
confidence (float) --
A confidence score between 0 and 1 indicating how certain the system is about the logical translation.
contradictingRules (list) --
The automated reasoning policy rules that contradict the claims and/or premises in the input.
(dict) --
References a specific automated reasoning policy rule that was applied during evaluation.
id (string) --
The unique identifier of the automated reasoning rule.
policyVersionArn (string) --
The ARN of the automated reasoning policy version that contains this rule.
logicWarning (dict) --
Indication of a logic issue with the translation without needing to consider the automated reasoning policy rules.
type (string) --
The category of the detected logical issue, such as statements that are always true or always false.
premises (list) --
The logical statements that serve as premises under which the claims are validated.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are validated while assuming the policy and premises.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
translationAmbiguous (dict) --
Indicates that an ambiguity was detected in the translation, making it unsound to continue with validity checking. Additional context or follow-up questions might be needed to get translation to succeed.
options (list) --
Different logical interpretations that were detected during translation of the input.
(dict) --
Represents one possible logical interpretation of ambiguous input content.
translations (list) --
Different logical interpretations that were detected during translation of the input.
(dict) --
Contains the logical translation of natural language input into formal logical statements, including premises, claims, and confidence scores.
premises (list) --
The logical statements that serve as the foundation or assumptions for the claims.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
claims (list) --
The logical statements that are being validated against the premises and policy rules.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
untranslatedPremises (list) --
References to portions of the original input text that correspond to the premises but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
untranslatedClaims (list) --
References to portions of the original input text that correspond to the claims but could not be fully translated.
(dict) --
References a portion of the original input text that corresponds to logical elements.
text (string) --
The specific text from the original input that this reference points to.
confidence (float) --
A confidence score between 0 and 1 indicating how certain the system is about the logical translation.
differenceScenarios (list) --
Scenarios showing how the different translation options differ in meaning.
(dict) --
Represents a logical scenario where claims can be evaluated as true or false, containing specific logical assignments.
statements (list) --
List of logical assignments and statements that define this scenario.
(dict) --
Represents a logical statement that can be expressed both in formal logic notation and natural language, providing dual representations for better understanding and validation.
logic (string) --
The formal logic representation of the statement using mathematical notation and logical operators.
naturalLanguage (string) --
The natural language representation of the logical statement, providing a human-readable interpretation of the formal logic.
tooComplex (dict) --
Indicates that the input contains too much information for Automated Reasoning to process within its latency limits.
noTranslations (dict) --
Identifies that some or all of the input prompt wasn't translated into logic. This can happen if the input isn't relevant to the Automated Reasoning policy, or if the policy doesn't have variables to model relevant input.
testRunResult (string) --
The overall result of the test run, indicating whether the policy passed or failed validation.
aggregatedTestFindingsResult (string) --
A summary of all test findings, aggregated to provide an overall assessment of policy quality and correctness.
updatedAt (datetime) --
The timestamp when the test results were last updated.
Lists tests for an Automated Reasoning policy. We recommend using pagination to ensure that the operation returns quickly and successfully.
See also: AWS API Documentation
Request Syntax
client.list_automated_reasoning_policy_test_cases( policyArn='string', nextToken='string', maxResults=123 )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy for which to list tests.
string
The pagination token from a previous request to retrieve the next page of results.
integer
The maximum number of tests to return in a single call.
dict
Response Syntax
{ 'testCases': [ { 'testCaseId': 'string', 'guardContent': 'string', 'queryContent': 'string', 'expectedAggregatedFindingsResult': 'VALID'|'INVALID'|'SATISFIABLE'|'IMPOSSIBLE'|'TRANSLATION_AMBIGUOUS'|'TOO_COMPLEX'|'NO_TRANSLATION', 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1), 'confidenceThreshold': 123.0 }, ], 'nextToken': 'string' }
Response Structure
(dict) --
testCases (list) --
A list of tests for the specified policy.
(dict) --
Represents a test for validating an Automated Reasoning policy. tests contain sample inputs and expected outcomes to verify policy behavior.
testCaseId (string) --
The unique identifier of the test.
guardContent (string) --
The output content to be validated by the policy, typically representing a foundation model response.
queryContent (string) --
The input query or prompt that generated the content. This provides context for the validation.
expectedAggregatedFindingsResult (string) --
The expected result of the Automated Reasoning check for this test.
createdAt (datetime) --
The timestamp when the test was created.
updatedAt (datetime) --
The timestamp when the test was last updated.
confidenceThreshold (float) --
The minimum confidence level for logic validation. Content meeting this threshold is considered high-confidence and can be validated.
nextToken (string) --
The pagination token to use in a subsequent request to retrieve the next page of results.
Retrieves details about a specific Automated Reasoning policy test.
See also: AWS API Documentation
Request Syntax
client.get_automated_reasoning_policy_test_case( policyArn='string', testCaseId='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy that contains the test.
string
[REQUIRED]
The unique identifier of the test to retrieve.
dict
Response Syntax
{ 'policyArn': 'string', 'testCase': { 'testCaseId': 'string', 'guardContent': 'string', 'queryContent': 'string', 'expectedAggregatedFindingsResult': 'VALID'|'INVALID'|'SATISFIABLE'|'IMPOSSIBLE'|'TRANSLATION_AMBIGUOUS'|'TOO_COMPLEX'|'NO_TRANSLATION', 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1), 'confidenceThreshold': 123.0 } }
Response Structure
(dict) --
policyArn (string) --
The Amazon Resource Name (ARN) of the policy that contains the test.
testCase (dict) --
The test details including the content, query, expected result, and metadata.
testCaseId (string) --
The unique identifier of the test.
guardContent (string) --
The output content to be validated by the policy, typically representing a foundation model response.
queryContent (string) --
The input query or prompt that generated the content. This provides context for the validation.
expectedAggregatedFindingsResult (string) --
The expected result of the Automated Reasoning check for this test.
createdAt (datetime) --
The timestamp when the test was created.
updatedAt (datetime) --
The timestamp when the test was last updated.
confidenceThreshold (float) --
The minimum confidence level for logic validation. Content meeting this threshold is considered high-confidence and can be validated.
Retrieves detailed information about an Automated Reasoning policy build workflow, including its status, configuration, and metadata.
See also: AWS API Documentation
Request Syntax
client.get_automated_reasoning_policy_build_workflow( policyArn='string', buildWorkflowId='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy whose build workflow you want to retrieve.
string
[REQUIRED]
The unique identifier of the build workflow to retrieve.
dict
Response Syntax
{ 'policyArn': 'string', 'buildWorkflowId': 'string', 'status': 'SCHEDULED'|'CANCEL_REQUESTED'|'PREPROCESSING'|'BUILDING'|'TESTING'|'COMPLETED'|'FAILED'|'CANCELLED', 'buildWorkflowType': 'INGEST_CONTENT'|'REFINE_POLICY'|'IMPORT_POLICY', 'documentName': 'string', 'documentContentType': 'pdf'|'txt', 'documentDescription': 'string', 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1) }
Response Structure
(dict) --
policyArn (string) --
The Amazon Resource Name (ARN) of the Automated Reasoning policy.
buildWorkflowId (string) --
The unique identifier of the build workflow.
status (string) --
The current status of the build workflow (e.g., RUNNING, COMPLETED, FAILED, CANCELLED).
buildWorkflowType (string) --
The type of build workflow being executed (e.g., DOCUMENT_INGESTION, POLICY_REPAIR).
documentName (string) --
The name of the source document used in the build workflow.
documentContentType (string) --
The content type of the source document (e.g., text/plain, application/pdf).
documentDescription (string) --
A detailed description of the document's content and how it should be used in the policy generation process.
createdAt (datetime) --
The timestamp when the build workflow was created.
updatedAt (datetime) --
The timestamp when the build workflow was last updated.
Deletes an Automated Reasoning policy or policy version. This operation is idempotent. If you delete a policy more than once, each call succeeds. Deleting a policy removes it permanently and cannot be undone.
See also: AWS API Documentation
Request Syntax
client.delete_automated_reasoning_policy( policyArn='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy to delete.
dict
Response Syntax
{}
Response Structure
(dict) --
Starts a new build workflow for an Automated Reasoning policy. This initiates the process of analyzing source documents and generating policy rules, variables, and types.
See also: AWS API Documentation
Request Syntax
client.start_automated_reasoning_policy_build_workflow( policyArn='string', buildWorkflowType='INGEST_CONTENT'|'REFINE_POLICY'|'IMPORT_POLICY', clientRequestToken='string', sourceContent={ 'policyDefinition': { 'version': 'string', 'types': [ { 'name': 'string', 'description': 'string', 'values': [ { 'value': 'string', 'description': 'string' }, ] }, ], 'rules': [ { 'id': 'string', 'expression': 'string', 'alternateExpression': 'string' }, ], 'variables': [ { 'name': 'string', 'type': 'string', 'description': 'string' }, ] }, 'workflowContent': { 'documents': [ { 'document': b'bytes', 'documentContentType': 'pdf'|'txt', 'documentName': 'string', 'documentDescription': 'string' }, ], 'policyRepairAssets': { 'annotations': [ { 'addType': { 'name': 'string', 'description': 'string', 'values': [ { 'value': 'string', 'description': 'string' }, ] }, 'updateType': { 'name': 'string', 'newName': 'string', 'description': 'string', 'values': [ { 'addTypeValue': { 'value': 'string', 'description': 'string' }, 'updateTypeValue': { 'value': 'string', 'newValue': 'string', 'description': 'string' }, 'deleteTypeValue': { 'value': 'string' } }, ] }, 'deleteType': { 'name': 'string' }, 'addVariable': { 'name': 'string', 'type': 'string', 'description': 'string' }, 'updateVariable': { 'name': 'string', 'newName': 'string', 'description': 'string' }, 'deleteVariable': { 'name': 'string' }, 'addRule': { 'expression': 'string' }, 'updateRule': { 'ruleId': 'string', 'expression': 'string' }, 'deleteRule': { 'ruleId': 'string' }, 'addRuleFromNaturalLanguage': { 'naturalLanguage': 'string' }, 'updateFromRulesFeedback': { 'ruleIds': [ 'string', ], 'feedback': 'string' }, 'updateFromScenarioFeedback': { 'ruleIds': [ 'string', ], 'scenarioExpression': 'string', 'feedback': 'string' }, 'ingestContent': { 'content': 'string' } }, ] } } } )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy for which to start the build workflow.
string
[REQUIRED]
The type of build workflow to start (e.g., DOCUMENT_INGESTION for processing new documents, POLICY_REPAIR for fixing existing policies).
string
A unique, case-sensitive identifier to ensure that the operation completes no more than once. If this token matches a previous request, Amazon Bedrock ignores the request but doesn't return an error.
This field is autopopulated if not provided.
dict
[REQUIRED]
The source content for the build workflow, such as documents to analyze or repair instructions for existing policies.
policyDefinition (dict) --
Contains the formal logic rules, variables, and custom variable types that define an Automated Reasoning policy. The policy definition specifies the constraints used to validate foundation model responses for accuracy and logical consistency.
version (string) --
The version of the policy definition format.
types (list) --
The custom user-defined vairable types used in the policy. Types are enum-based variable types that provide additional context beyond the predefined variable types.
(dict) --
Represents a custom user-defined viarble type in an Automated Reasoning policy. Types are enum-based and provide additional context beyond predefined variable types.
name (string) -- [REQUIRED]
The name of the custom type.
description (string) --
The description of what the custom type represents.
values (list) -- [REQUIRED]
The possible values for this enum-based type, each with its own description.
(dict) --
Represents a single value within a custom type definition, including its identifier and description.
value (string) -- [REQUIRED]
The actual value or identifier for this type value.
description (string) --
A human-readable description explaining what this type value represents and when it should be used.
rules (list) --
The formal logic rules extracted from the source document. Rules define the logical constraints that determine whether model responses are valid, invalid, or satisfiable.
(dict) --
Represents a formal logic rule in an Automated Reasoning policy. For example, rules can be expressed as if-then statements that define logical constraints.
id (string) -- [REQUIRED]
The unique identifier of the rule within the policy.
expression (string) -- [REQUIRED]
The formal logic expression of the rule.
alternateExpression (string) --
The human-readable form of the rule expression, often in natural language or simplified notation.
variables (list) --
The variables that represent concepts in the policy. Variables can have values assigned when translating natural language into formal logic. Their descriptions are crucial for accurate translation.
(dict) --
Represents a variable in an Automated Reasoning policy. Variables represent concepts that can have values assigned during natural language translation.
name (string) -- [REQUIRED]
The name of the variable. Use descriptive names that clearly indicate the concept being represented.
type (string) -- [REQUIRED]
The data type of the variable. Valid types include bool, int, real, enum, and custom types that you can provide.
description (string) -- [REQUIRED]
The description of the variable that explains what it represents and how users might refer to it. Clear and comprehensive descriptions are essential for accurate natural language translation.
workflowContent (dict) --
The actual content to be processed in the build workflow, such as documents to analyze or repair instructions to apply.
documents (list) --
The list of documents to be processed in a document ingestion workflow.
(dict) --
Represents a source document used in the policy build workflow, containing the content and metadata needed for policy generation.
document (bytes) -- [REQUIRED]
The actual content of the source document that will be analyzed to extract policy rules and concepts.
documentContentType (string) -- [REQUIRED]
The MIME type of the document content (e.g., text/plain, application/pdf, text/markdown).
documentName (string) -- [REQUIRED]
A descriptive name for the document that helps identify its purpose and content.
documentDescription (string) --
A detailed description of the document's content and how it should be used in the policy generation process.
policyRepairAssets (dict) --
The assets and instructions needed for a policy repair workflow, including repair annotations and guidance.
annotations (list) -- [REQUIRED]
Specific annotations or modifications to apply during the policy repair process, such as rule corrections or variable updates.
(dict) --
Contains the various operations that can be performed on an Automated Reasoning policy, including adding, updating, and deleting rules, variables, and types.
addType (dict) --
An operation to add a new custom type to the policy, defining a set of possible values for policy variables.
name (string) -- [REQUIRED]
The name of the new custom type. This name will be used to reference the type in variable definitions and rules.
description (string) -- [REQUIRED]
A description of what the custom type represents and how it should be used in the policy.
values (list) -- [REQUIRED]
The list of possible values that variables of this type can take, each with its own description and identifier.
(dict) --
Represents a single value within a custom type definition, including its identifier and description.
value (string) -- [REQUIRED]
The actual value or identifier for this type value.
description (string) --
A human-readable description explaining what this type value represents and when it should be used.
updateType (dict) --
An operation to modify an existing custom type in the policy, such as changing its name, description, or allowed values.
name (string) -- [REQUIRED]
The current name of the custom type to update.
newName (string) --
The new name for the custom type, if you want to rename it. If not provided, the name remains unchanged.
description (string) --
The new description for the custom type, replacing the previous description.
values (list) -- [REQUIRED]
The updated list of values for the custom type, which can include additions, modifications, or removals.
(dict) --
An annotation for managing values within custom types, including adding, updating, or removing specific type values.
addTypeValue (dict) --
An operation to add a new value to an existing custom type.
value (string) -- [REQUIRED]
The identifier or name of the new value to add to the type.
description (string) --
A description of what this new type value represents and when it should be used.
updateTypeValue (dict) --
An operation to modify an existing value within a custom type.
value (string) -- [REQUIRED]
The current identifier or name of the type value to update.
newValue (string) --
The new identifier or name for the type value, if you want to rename it.
description (string) --
The new description for the type value, replacing the previous description.
deleteTypeValue (dict) --
An operation to remove a value from an existing custom type.
value (string) -- [REQUIRED]
The identifier or name of the value to remove from the type.
deleteType (dict) --
An operation to remove a custom type from the policy. The type must not be referenced by any variables or rules.
name (string) -- [REQUIRED]
The name of the custom type to delete from the policy. The type must not be referenced by any variables or rules.
addVariable (dict) --
An operation to add a new variable to the policy, which can be used in rule expressions to represent dynamic values.
name (string) -- [REQUIRED]
The name of the new variable. This name will be used to reference the variable in rule expressions.
type (string) -- [REQUIRED]
The type of the variable, which can be a built-in type (like string or number) or a custom type defined in the policy.
description (string) -- [REQUIRED]
A description of what the variable represents and how it should be used in rules.
updateVariable (dict) --
An operation to modify an existing variable in the policy, such as changing its name, type, or description.
name (string) -- [REQUIRED]
The current name of the variable to update.
newName (string) --
The new name for the variable, if you want to rename it. If not provided, the name remains unchanged.
description (string) --
The new description for the variable, replacing the previous description.
deleteVariable (dict) --
An operation to remove a variable from the policy. The variable must not be referenced by any rules.
name (string) -- [REQUIRED]
The name of the variable to delete from the policy. The variable must not be referenced by any rules.
addRule (dict) --
An operation to add a new logical rule to the policy using formal mathematical expressions.
expression (string) -- [REQUIRED]
The formal logical expression that defines the rule, using mathematical notation and referencing policy variables and types.
updateRule (dict) --
An operation to modify an existing rule in the policy, such as changing its logical expression or conditions.
ruleId (string) -- [REQUIRED]
The unique identifier of the rule to update.
expression (string) -- [REQUIRED]
The new formal logical expression for the rule, replacing the previous expression.
deleteRule (dict) --
An operation to remove a rule from the policy.
ruleId (string) -- [REQUIRED]
The unique identifier of the rule to delete from the policy.
addRuleFromNaturalLanguage (dict) --
An operation to add a new rule by converting natural language descriptions into formal logical expressions.
naturalLanguage (string) -- [REQUIRED]
The natural language description of the rule that should be converted into a formal logical expression.
updateFromRulesFeedback (dict) --
An operation to update the policy based on feedback about how specific rules performed during testing or validation.
ruleIds (list) --
The list of rule identifiers that the feedback applies to.
(string) --
feedback (string) -- [REQUIRED]
The feedback information about rule performance, including suggestions for improvements or corrections.
updateFromScenarioFeedback (dict) --
An operation to update the policy based on feedback about how it performed on specific test scenarios.
ruleIds (list) --
The list of rule identifiers that were involved in the scenario being evaluated.
(string) --
scenarioExpression (string) -- [REQUIRED]
The logical expression that defines the test scenario that generated this feedback.
feedback (string) --
The feedback information about scenario performance, including any issues or improvements identified.
ingestContent (dict) --
An operation to process and incorporate new content into the policy, extracting additional rules and concepts.
content (string) -- [REQUIRED]
The new content to be analyzed and incorporated into the policy, such as additional documents or rule descriptions.
dict
Response Syntax
{ 'policyArn': 'string', 'buildWorkflowId': 'string' }
Response Structure
(dict) --
policyArn (string) --
The Amazon Resource Name (ARN) of the Automated Reasoning policy.
buildWorkflowId (string) --
The unique identifier of the newly started build workflow. Use this ID to track the workflow's progress and retrieve its results.
Updates an existing Automated Reasoning policy with new rules, variables, or configuration. This creates a new version of the policy while preserving the previous version.
See also: AWS API Documentation
Request Syntax
client.update_automated_reasoning_policy( policyArn='string', policyDefinition={ 'version': 'string', 'types': [ { 'name': 'string', 'description': 'string', 'values': [ { 'value': 'string', 'description': 'string' }, ] }, ], 'rules': [ { 'id': 'string', 'expression': 'string', 'alternateExpression': 'string' }, ], 'variables': [ { 'name': 'string', 'type': 'string', 'description': 'string' }, ] }, name='string', description='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy to update. This must be the ARN of a draft policy.
dict
[REQUIRED]
The updated policy definition containing the formal logic rules, variables, and types.
version (string) --
The version of the policy definition format.
types (list) --
The custom user-defined vairable types used in the policy. Types are enum-based variable types that provide additional context beyond the predefined variable types.
(dict) --
Represents a custom user-defined viarble type in an Automated Reasoning policy. Types are enum-based and provide additional context beyond predefined variable types.
name (string) -- [REQUIRED]
The name of the custom type.
description (string) --
The description of what the custom type represents.
values (list) -- [REQUIRED]
The possible values for this enum-based type, each with its own description.
(dict) --
Represents a single value within a custom type definition, including its identifier and description.
value (string) -- [REQUIRED]
The actual value or identifier for this type value.
description (string) --
A human-readable description explaining what this type value represents and when it should be used.
rules (list) --
The formal logic rules extracted from the source document. Rules define the logical constraints that determine whether model responses are valid, invalid, or satisfiable.
(dict) --
Represents a formal logic rule in an Automated Reasoning policy. For example, rules can be expressed as if-then statements that define logical constraints.
id (string) -- [REQUIRED]
The unique identifier of the rule within the policy.
expression (string) -- [REQUIRED]
The formal logic expression of the rule.
alternateExpression (string) --
The human-readable form of the rule expression, often in natural language or simplified notation.
variables (list) --
The variables that represent concepts in the policy. Variables can have values assigned when translating natural language into formal logic. Their descriptions are crucial for accurate translation.
(dict) --
Represents a variable in an Automated Reasoning policy. Variables represent concepts that can have values assigned during natural language translation.
name (string) -- [REQUIRED]
The name of the variable. Use descriptive names that clearly indicate the concept being represented.
type (string) -- [REQUIRED]
The data type of the variable. Valid types include bool, int, real, enum, and custom types that you can provide.
description (string) -- [REQUIRED]
The description of the variable that explains what it represents and how users might refer to it. Clear and comprehensive descriptions are essential for accurate natural language translation.
string
The updated name for the Automated Reasoning policy.
string
The updated description for the Automated Reasoning policy.
dict
Response Syntax
{ 'policyArn': 'string', 'name': 'string', 'definitionHash': 'string', 'updatedAt': datetime(2015, 1, 1) }
Response Structure
(dict) --
policyArn (string) --
The Amazon Resource Name (ARN) of the updated policy.
name (string) --
The updated name of the policy.
definitionHash (string) --
The hash of the updated policy definition.
updatedAt (datetime) --
The timestamp when the policy was last updated.
Deletes an Automated Reasoning policy test. This operation is idempotent; if you delete a test more than once, each call succeeds.
See also: AWS API Documentation
Request Syntax
client.delete_automated_reasoning_policy_test_case( policyArn='string', testCaseId='string', lastUpdatedAt=datetime(2015, 1, 1) )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy that contains the test.
string
[REQUIRED]
The unique identifier of the test to delete.
datetime
[REQUIRED]
The timestamp when the test was last updated. This is used as a concurrency token to prevent conflicting modifications.
dict
Response Syntax
{}
Response Structure
(dict) --
Retrieves the current annotations for an Automated Reasoning policy build workflow. Annotations contain corrections to the rules, variables and types to be applied to the policy.
See also: AWS API Documentation
Request Syntax
client.get_automated_reasoning_policy_annotations( policyArn='string', buildWorkflowId='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy whose annotations you want to retrieve.
string
[REQUIRED]
The unique identifier of the build workflow whose annotations you want to retrieve.
dict
Response Syntax
{ 'policyArn': 'string', 'name': 'string', 'buildWorkflowId': 'string', 'annotations': [ { 'addType': { 'name': 'string', 'description': 'string', 'values': [ { 'value': 'string', 'description': 'string' }, ] }, 'updateType': { 'name': 'string', 'newName': 'string', 'description': 'string', 'values': [ { 'addTypeValue': { 'value': 'string', 'description': 'string' }, 'updateTypeValue': { 'value': 'string', 'newValue': 'string', 'description': 'string' }, 'deleteTypeValue': { 'value': 'string' } }, ] }, 'deleteType': { 'name': 'string' }, 'addVariable': { 'name': 'string', 'type': 'string', 'description': 'string' }, 'updateVariable': { 'name': 'string', 'newName': 'string', 'description': 'string' }, 'deleteVariable': { 'name': 'string' }, 'addRule': { 'expression': 'string' }, 'updateRule': { 'ruleId': 'string', 'expression': 'string' }, 'deleteRule': { 'ruleId': 'string' }, 'addRuleFromNaturalLanguage': { 'naturalLanguage': 'string' }, 'updateFromRulesFeedback': { 'ruleIds': [ 'string', ], 'feedback': 'string' }, 'updateFromScenarioFeedback': { 'ruleIds': [ 'string', ], 'scenarioExpression': 'string', 'feedback': 'string' }, 'ingestContent': { 'content': 'string' } }, ], 'annotationSetHash': 'string', 'updatedAt': datetime(2015, 1, 1) }
Response Structure
(dict) --
policyArn (string) --
The Amazon Resource Name (ARN) of the Automated Reasoning policy.
name (string) --
The name of the Automated Reasoning policy.
buildWorkflowId (string) --
The unique identifier of the build workflow.
annotations (list) --
The current set of annotations containing rules, variables, and types extracted from the source documents. These can be modified before finalizing the policy.
(dict) --
Contains the various operations that can be performed on an Automated Reasoning policy, including adding, updating, and deleting rules, variables, and types.
addType (dict) --
An operation to add a new custom type to the policy, defining a set of possible values for policy variables.
name (string) --
The name of the new custom type. This name will be used to reference the type in variable definitions and rules.
description (string) --
A description of what the custom type represents and how it should be used in the policy.
values (list) --
The list of possible values that variables of this type can take, each with its own description and identifier.
(dict) --
Represents a single value within a custom type definition, including its identifier and description.
value (string) --
The actual value or identifier for this type value.
description (string) --
A human-readable description explaining what this type value represents and when it should be used.
updateType (dict) --
An operation to modify an existing custom type in the policy, such as changing its name, description, or allowed values.
name (string) --
The current name of the custom type to update.
newName (string) --
The new name for the custom type, if you want to rename it. If not provided, the name remains unchanged.
description (string) --
The new description for the custom type, replacing the previous description.
values (list) --
The updated list of values for the custom type, which can include additions, modifications, or removals.
(dict) --
An annotation for managing values within custom types, including adding, updating, or removing specific type values.
addTypeValue (dict) --
An operation to add a new value to an existing custom type.
value (string) --
The identifier or name of the new value to add to the type.
description (string) --
A description of what this new type value represents and when it should be used.
updateTypeValue (dict) --
An operation to modify an existing value within a custom type.
value (string) --
The current identifier or name of the type value to update.
newValue (string) --
The new identifier or name for the type value, if you want to rename it.
description (string) --
The new description for the type value, replacing the previous description.
deleteTypeValue (dict) --
An operation to remove a value from an existing custom type.
value (string) --
The identifier or name of the value to remove from the type.
deleteType (dict) --
An operation to remove a custom type from the policy. The type must not be referenced by any variables or rules.
name (string) --
The name of the custom type to delete from the policy. The type must not be referenced by any variables or rules.
addVariable (dict) --
An operation to add a new variable to the policy, which can be used in rule expressions to represent dynamic values.
name (string) --
The name of the new variable. This name will be used to reference the variable in rule expressions.
type (string) --
The type of the variable, which can be a built-in type (like string or number) or a custom type defined in the policy.
description (string) --
A description of what the variable represents and how it should be used in rules.
updateVariable (dict) --
An operation to modify an existing variable in the policy, such as changing its name, type, or description.
name (string) --
The current name of the variable to update.
newName (string) --
The new name for the variable, if you want to rename it. If not provided, the name remains unchanged.
description (string) --
The new description for the variable, replacing the previous description.
deleteVariable (dict) --
An operation to remove a variable from the policy. The variable must not be referenced by any rules.
name (string) --
The name of the variable to delete from the policy. The variable must not be referenced by any rules.
addRule (dict) --
An operation to add a new logical rule to the policy using formal mathematical expressions.
expression (string) --
The formal logical expression that defines the rule, using mathematical notation and referencing policy variables and types.
updateRule (dict) --
An operation to modify an existing rule in the policy, such as changing its logical expression or conditions.
ruleId (string) --
The unique identifier of the rule to update.
expression (string) --
The new formal logical expression for the rule, replacing the previous expression.
deleteRule (dict) --
An operation to remove a rule from the policy.
ruleId (string) --
The unique identifier of the rule to delete from the policy.
addRuleFromNaturalLanguage (dict) --
An operation to add a new rule by converting natural language descriptions into formal logical expressions.
naturalLanguage (string) --
The natural language description of the rule that should be converted into a formal logical expression.
updateFromRulesFeedback (dict) --
An operation to update the policy based on feedback about how specific rules performed during testing or validation.
ruleIds (list) --
The list of rule identifiers that the feedback applies to.
(string) --
feedback (string) --
The feedback information about rule performance, including suggestions for improvements or corrections.
updateFromScenarioFeedback (dict) --
An operation to update the policy based on feedback about how it performed on specific test scenarios.
ruleIds (list) --
The list of rule identifiers that were involved in the scenario being evaluated.
(string) --
scenarioExpression (string) --
The logical expression that defines the test scenario that generated this feedback.
feedback (string) --
The feedback information about scenario performance, including any issues or improvements identified.
ingestContent (dict) --
An operation to process and incorporate new content into the policy, extracting additional rules and concepts.
content (string) --
The new content to be analyzed and incorporated into the policy, such as additional documents or rule descriptions.
annotationSetHash (string) --
A hash value representing the current state of the annotations. This is used for optimistic concurrency control when updating annotations.
updatedAt (datetime) --
The timestamp when the annotations were last updated.
Updates the annotations for an Automated Reasoning policy build workflow. This allows you to modify extracted rules, variables, and types before finalizing the policy.
See also: AWS API Documentation
Request Syntax
client.update_automated_reasoning_policy_annotations( policyArn='string', buildWorkflowId='string', annotations=[ { 'addType': { 'name': 'string', 'description': 'string', 'values': [ { 'value': 'string', 'description': 'string' }, ] }, 'updateType': { 'name': 'string', 'newName': 'string', 'description': 'string', 'values': [ { 'addTypeValue': { 'value': 'string', 'description': 'string' }, 'updateTypeValue': { 'value': 'string', 'newValue': 'string', 'description': 'string' }, 'deleteTypeValue': { 'value': 'string' } }, ] }, 'deleteType': { 'name': 'string' }, 'addVariable': { 'name': 'string', 'type': 'string', 'description': 'string' }, 'updateVariable': { 'name': 'string', 'newName': 'string', 'description': 'string' }, 'deleteVariable': { 'name': 'string' }, 'addRule': { 'expression': 'string' }, 'updateRule': { 'ruleId': 'string', 'expression': 'string' }, 'deleteRule': { 'ruleId': 'string' }, 'addRuleFromNaturalLanguage': { 'naturalLanguage': 'string' }, 'updateFromRulesFeedback': { 'ruleIds': [ 'string', ], 'feedback': 'string' }, 'updateFromScenarioFeedback': { 'ruleIds': [ 'string', ], 'scenarioExpression': 'string', 'feedback': 'string' }, 'ingestContent': { 'content': 'string' } }, ], lastUpdatedAnnotationSetHash='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy whose annotations you want to update.
string
[REQUIRED]
The unique identifier of the build workflow whose annotations you want to update.
list
[REQUIRED]
The updated annotations containing modified rules, variables, and types for the policy.
(dict) --
Contains the various operations that can be performed on an Automated Reasoning policy, including adding, updating, and deleting rules, variables, and types.
addType (dict) --
An operation to add a new custom type to the policy, defining a set of possible values for policy variables.
name (string) -- [REQUIRED]
The name of the new custom type. This name will be used to reference the type in variable definitions and rules.
description (string) -- [REQUIRED]
A description of what the custom type represents and how it should be used in the policy.
values (list) -- [REQUIRED]
The list of possible values that variables of this type can take, each with its own description and identifier.
(dict) --
Represents a single value within a custom type definition, including its identifier and description.
value (string) -- [REQUIRED]
The actual value or identifier for this type value.
description (string) --
A human-readable description explaining what this type value represents and when it should be used.
updateType (dict) --
An operation to modify an existing custom type in the policy, such as changing its name, description, or allowed values.
name (string) -- [REQUIRED]
The current name of the custom type to update.
newName (string) --
The new name for the custom type, if you want to rename it. If not provided, the name remains unchanged.
description (string) --
The new description for the custom type, replacing the previous description.
values (list) -- [REQUIRED]
The updated list of values for the custom type, which can include additions, modifications, or removals.
(dict) --
An annotation for managing values within custom types, including adding, updating, or removing specific type values.
addTypeValue (dict) --
An operation to add a new value to an existing custom type.
value (string) -- [REQUIRED]
The identifier or name of the new value to add to the type.
description (string) --
A description of what this new type value represents and when it should be used.
updateTypeValue (dict) --
An operation to modify an existing value within a custom type.
value (string) -- [REQUIRED]
The current identifier or name of the type value to update.
newValue (string) --
The new identifier or name for the type value, if you want to rename it.
description (string) --
The new description for the type value, replacing the previous description.
deleteTypeValue (dict) --
An operation to remove a value from an existing custom type.
value (string) -- [REQUIRED]
The identifier or name of the value to remove from the type.
deleteType (dict) --
An operation to remove a custom type from the policy. The type must not be referenced by any variables or rules.
name (string) -- [REQUIRED]
The name of the custom type to delete from the policy. The type must not be referenced by any variables or rules.
addVariable (dict) --
An operation to add a new variable to the policy, which can be used in rule expressions to represent dynamic values.
name (string) -- [REQUIRED]
The name of the new variable. This name will be used to reference the variable in rule expressions.
type (string) -- [REQUIRED]
The type of the variable, which can be a built-in type (like string or number) or a custom type defined in the policy.
description (string) -- [REQUIRED]
A description of what the variable represents and how it should be used in rules.
updateVariable (dict) --
An operation to modify an existing variable in the policy, such as changing its name, type, or description.
name (string) -- [REQUIRED]
The current name of the variable to update.
newName (string) --
The new name for the variable, if you want to rename it. If not provided, the name remains unchanged.
description (string) --
The new description for the variable, replacing the previous description.
deleteVariable (dict) --
An operation to remove a variable from the policy. The variable must not be referenced by any rules.
name (string) -- [REQUIRED]
The name of the variable to delete from the policy. The variable must not be referenced by any rules.
addRule (dict) --
An operation to add a new logical rule to the policy using formal mathematical expressions.
expression (string) -- [REQUIRED]
The formal logical expression that defines the rule, using mathematical notation and referencing policy variables and types.
updateRule (dict) --
An operation to modify an existing rule in the policy, such as changing its logical expression or conditions.
ruleId (string) -- [REQUIRED]
The unique identifier of the rule to update.
expression (string) -- [REQUIRED]
The new formal logical expression for the rule, replacing the previous expression.
deleteRule (dict) --
An operation to remove a rule from the policy.
ruleId (string) -- [REQUIRED]
The unique identifier of the rule to delete from the policy.
addRuleFromNaturalLanguage (dict) --
An operation to add a new rule by converting natural language descriptions into formal logical expressions.
naturalLanguage (string) -- [REQUIRED]
The natural language description of the rule that should be converted into a formal logical expression.
updateFromRulesFeedback (dict) --
An operation to update the policy based on feedback about how specific rules performed during testing or validation.
ruleIds (list) --
The list of rule identifiers that the feedback applies to.
(string) --
feedback (string) -- [REQUIRED]
The feedback information about rule performance, including suggestions for improvements or corrections.
updateFromScenarioFeedback (dict) --
An operation to update the policy based on feedback about how it performed on specific test scenarios.
ruleIds (list) --
The list of rule identifiers that were involved in the scenario being evaluated.
(string) --
scenarioExpression (string) -- [REQUIRED]
The logical expression that defines the test scenario that generated this feedback.
feedback (string) --
The feedback information about scenario performance, including any issues or improvements identified.
ingestContent (dict) --
An operation to process and incorporate new content into the policy, extracting additional rules and concepts.
content (string) -- [REQUIRED]
The new content to be analyzed and incorporated into the policy, such as additional documents or rule descriptions.
string
[REQUIRED]
The hash value of the annotation set that you're updating. This is used for optimistic concurrency control to prevent conflicting updates.
dict
Response Syntax
{ 'policyArn': 'string', 'buildWorkflowId': 'string', 'annotationSetHash': 'string', 'updatedAt': datetime(2015, 1, 1) }
Response Structure
(dict) --
policyArn (string) --
The Amazon Resource Name (ARN) of the Automated Reasoning policy.
buildWorkflowId (string) --
The unique identifier of the build workflow.
annotationSetHash (string) --
The new hash value representing the updated state of the annotations.
updatedAt (datetime) --
The timestamp when the annotations were updated.
Exports the policy definition for an Automated Reasoning policy version. Returns the complete policy definition including rules, variables, and custom variable types in a structured format.
See also: AWS API Documentation
Request Syntax
client.export_automated_reasoning_policy_version( policyArn='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy to export. Can be either the unversioned ARN for the draft policy or a versioned ARN for a specific policy version.
dict
Response Syntax
{ 'policyDefinition': { 'version': 'string', 'types': [ { 'name': 'string', 'description': 'string', 'values': [ { 'value': 'string', 'description': 'string' }, ] }, ], 'rules': [ { 'id': 'string', 'expression': 'string', 'alternateExpression': 'string' }, ], 'variables': [ { 'name': 'string', 'type': 'string', 'description': 'string' }, ] } }
Response Structure
(dict) --
policyDefinition (dict) --
The exported policy definition containing the formal logic rules, variables, and custom variable types.
version (string) --
The version of the policy definition format.
types (list) --
The custom user-defined vairable types used in the policy. Types are enum-based variable types that provide additional context beyond the predefined variable types.
(dict) --
Represents a custom user-defined viarble type in an Automated Reasoning policy. Types are enum-based and provide additional context beyond predefined variable types.
name (string) --
The name of the custom type.
description (string) --
The description of what the custom type represents.
values (list) --
The possible values for this enum-based type, each with its own description.
(dict) --
Represents a single value within a custom type definition, including its identifier and description.
value (string) --
The actual value or identifier for this type value.
description (string) --
A human-readable description explaining what this type value represents and when it should be used.
rules (list) --
The formal logic rules extracted from the source document. Rules define the logical constraints that determine whether model responses are valid, invalid, or satisfiable.
(dict) --
Represents a formal logic rule in an Automated Reasoning policy. For example, rules can be expressed as if-then statements that define logical constraints.
id (string) --
The unique identifier of the rule within the policy.
expression (string) --
The formal logic expression of the rule.
alternateExpression (string) --
The human-readable form of the rule expression, often in natural language or simplified notation.
variables (list) --
The variables that represent concepts in the policy. Variables can have values assigned when translating natural language into formal logic. Their descriptions are crucial for accurate translation.
(dict) --
Represents a variable in an Automated Reasoning policy. Variables represent concepts that can have values assigned during natural language translation.
name (string) --
The name of the variable. Use descriptive names that clearly indicate the concept being represented.
type (string) --
The data type of the variable. Valid types include bool, int, real, enum, and custom types that you can provide.
description (string) --
The description of the variable that explains what it represents and how users might refer to it. Clear and comprehensive descriptions are essential for accurate natural language translation.
Creates an Automated Reasoning policy for Amazon Bedrock Guardrails. Automated Reasoning policies use mathematical techniques to detect hallucinations, suggest corrections, and highlight unstated assumptions in the responses of your GenAI application.
To create a policy, you upload a source document that describes the rules that you're encoding. Automated Reasoning extracts important concepts from the source document that will become variables in the policy and infers policy rules.
See also: AWS API Documentation
Request Syntax
client.create_automated_reasoning_policy( name='string', description='string', clientRequestToken='string', policyDefinition={ 'version': 'string', 'types': [ { 'name': 'string', 'description': 'string', 'values': [ { 'value': 'string', 'description': 'string' }, ] }, ], 'rules': [ { 'id': 'string', 'expression': 'string', 'alternateExpression': 'string' }, ], 'variables': [ { 'name': 'string', 'type': 'string', 'description': 'string' }, ] }, tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
A unique name for the Automated Reasoning policy. The name must be between 1 and 63 characters and can contain letters, numbers, hyphens, and underscores.
string
A description of the Automated Reasoning policy. Use this to provide context about the policy's purpose and the types of validations it performs.
string
A unique, case-sensitive identifier to ensure that the operation completes no more than once. If this token matches a previous request, Amazon Bedrock ignores the request but doesn't return an error.
This field is autopopulated if not provided.
dict
The policy definition that contains the formal logic rules, variables, and custom variable types used to validate foundation model responses in your application.
version (string) --
The version of the policy definition format.
types (list) --
The custom user-defined vairable types used in the policy. Types are enum-based variable types that provide additional context beyond the predefined variable types.
(dict) --
Represents a custom user-defined viarble type in an Automated Reasoning policy. Types are enum-based and provide additional context beyond predefined variable types.
name (string) -- [REQUIRED]
The name of the custom type.
description (string) --
The description of what the custom type represents.
values (list) -- [REQUIRED]
The possible values for this enum-based type, each with its own description.
(dict) --
Represents a single value within a custom type definition, including its identifier and description.
value (string) -- [REQUIRED]
The actual value or identifier for this type value.
description (string) --
A human-readable description explaining what this type value represents and when it should be used.
rules (list) --
The formal logic rules extracted from the source document. Rules define the logical constraints that determine whether model responses are valid, invalid, or satisfiable.
(dict) --
Represents a formal logic rule in an Automated Reasoning policy. For example, rules can be expressed as if-then statements that define logical constraints.
id (string) -- [REQUIRED]
The unique identifier of the rule within the policy.
expression (string) -- [REQUIRED]
The formal logic expression of the rule.
alternateExpression (string) --
The human-readable form of the rule expression, often in natural language or simplified notation.
variables (list) --
The variables that represent concepts in the policy. Variables can have values assigned when translating natural language into formal logic. Their descriptions are crucial for accurate translation.
(dict) --
Represents a variable in an Automated Reasoning policy. Variables represent concepts that can have values assigned during natural language translation.
name (string) -- [REQUIRED]
The name of the variable. Use descriptive names that clearly indicate the concept being represented.
type (string) -- [REQUIRED]
The data type of the variable. Valid types include bool, int, real, enum, and custom types that you can provide.
description (string) -- [REQUIRED]
The description of the variable that explains what it represents and how users might refer to it. Clear and comprehensive descriptions are essential for accurate natural language translation.
list
A list of tags to associate with the Automated Reasoning policy. Tags help you organize and manage your policies.
(dict) --
Definition of the key/value pair for a tag.
key (string) -- [REQUIRED]
Key for the tag.
value (string) -- [REQUIRED]
Value for the tag.
dict
Response Syntax
{ 'policyArn': 'string', 'version': 'string', 'name': 'string', 'description': 'string', 'definitionHash': 'string', 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1) }
Response Structure
(dict) --
policyArn (string) --
The Amazon Resource Name (ARN) of the Automated Reasoning policy that you created.
version (string) --
The version number of the newly created Automated Reasoning policy. The initial version is always DRAFT.
name (string) --
The name of the Automated Reasoning policy.
description (string) --
The description of the Automated Reasoning policy.
definitionHash (string) --
The hash of the policy definition. This is used as a concurrency token for creating policy versions that you can use in your application.
createdAt (datetime) --
The timestamp when the policy was created.
updatedAt (datetime) --
The timestamp when the policy was last updated.
Creates a test for an Automated Reasoning policy. Tests validate that your policy works as expected by providing sample inputs and expected outcomes. Use tests to verify policy behavior before deploying to production.
See also: AWS API Documentation
Request Syntax
client.create_automated_reasoning_policy_test_case( policyArn='string', guardContent='string', queryContent='string', expectedAggregatedFindingsResult='VALID'|'INVALID'|'SATISFIABLE'|'IMPOSSIBLE'|'TRANSLATION_AMBIGUOUS'|'TOO_COMPLEX'|'NO_TRANSLATION', clientRequestToken='string', confidenceThreshold=123.0 )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy for which to create the test.
string
[REQUIRED]
The output content that's validated by the Automated Reasoning policy. This represents the foundation model response that will be checked for accuracy.
string
The input query or prompt that generated the content. This provides context for the validation.
string
[REQUIRED]
The expected result of the Automated Reasoning check. Valid values include: , TOO_COMPLEX, and NO_TRANSLATIONS.
VALID - The claims are true. The claims are implied by the premises and the Automated Reasoning policy. Given the Automated Reasoning policy and premises, it is not possible for these claims to be false. In other words, there are no alternative answers that are true that contradict the claims.
INVALID - The claims are false. The claims are not implied by the premises and Automated Reasoning policy. Furthermore, there exists different claims that are consistent with the premises and Automated Reasoning policy.
SATISFIABLE - The claims can be true or false. It depends on what assumptions are made for the claim to be implied from the premises and Automated Reasoning policy rules. In this situation, different assumptions can make input claims false and alternative claims true.
IMPOSSIBLE - Automated Reasoning can’t make a statement about the claims. This can happen if the premises are logically incorrect, or if there is a conflict within the Automated Reasoning policy itself.
TRANSLATION_AMBIGUOUS - Detected an ambiguity in the translation meant it would be unsound to continue with validity checking. Additional context or follow-up questions might be needed to get translation to succeed.
TOO_COMPLEX - The input contains too much information for Automated Reasoning to process within its latency limits.
NO_TRANSLATIONS - Identifies that some or all of the input prompt wasn't translated into logic. This can happen if the input isn't relevant to the Automated Reasoning policy, or if the policy doesn't have variables to model relevant input. If Automated Reasoning can't translate anything, you get a single NO_TRANSLATIONS finding. You might also see a NO_TRANSLATIONS (along with other findings) if some part of the validation isn't translated.
string
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error.
This field is autopopulated if not provided.
float
The minimum confidence level for logic validation. Content that meets the threshold is considered a high-confidence finding that can be validated.
dict
Response Syntax
{ 'policyArn': 'string', 'testCaseId': 'string' }
Response Structure
(dict) --
policyArn (string) --
The Amazon Resource Name (ARN) of the policy for which the test was created.
testCaseId (string) --
The unique identifier of the created test.
Cancels a running Automated Reasoning policy build workflow. This stops the policy generation process and prevents further processing of the source documents.
See also: AWS API Documentation
Request Syntax
client.cancel_automated_reasoning_policy_build_workflow( policyArn='string', buildWorkflowId='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy whose build workflow you want to cancel.
string
[REQUIRED]
The unique identifier of the build workflow to cancel. You can get this ID from the StartAutomatedReasoningPolicyBuildWorkflow response or by listing build workflows.
dict
Response Syntax
{}
Response Structure
(dict) --
Deletes an Automated Reasoning policy build workflow and its associated artifacts. This permanently removes the workflow history and any generated assets.
See also: AWS API Documentation
Request Syntax
client.delete_automated_reasoning_policy_build_workflow( policyArn='string', buildWorkflowId='string', lastUpdatedAt=datetime(2015, 1, 1) )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy whose build workflow you want to delete.
string
[REQUIRED]
The unique identifier of the build workflow to delete.
datetime
[REQUIRED]
The timestamp when the build workflow was last updated. This is used for optimistic concurrency control to prevent accidental deletion of workflows that have been modified.
dict
Response Syntax
{}
Response Structure
(dict) --
Lists all Automated Reasoning policies in your account, with optional filtering by policy ARN. This helps you manage and discover existing policies.
See also: AWS API Documentation
Request Syntax
client.list_automated_reasoning_policies( policyArn='string', nextToken='string', maxResults=123 )
string
Optional filter to list only the policy versions with the specified Amazon Resource Name (ARN). If not provided, the DRAFT versions for all policies are listed.
string
The pagination token from a previous request to retrieve the next page of results.
integer
The maximum number of policies to return in a single call.
dict
Response Syntax
{ 'automatedReasoningPolicySummaries': [ { 'policyArn': 'string', 'name': 'string', 'description': 'string', 'version': 'string', 'policyId': 'string', 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1) }, ], 'nextToken': 'string' }
Response Structure
(dict) --
automatedReasoningPolicySummaries (list) --
A list of Automated Reasoning policy summaries.
(dict) --
Contains summary information about an Automated Reasoning policy, including metadata and timestamps.
policyArn (string) --
The Amazon Resource Name (ARN) of the policy.
name (string) --
The name of the policy.
description (string) --
The description of the policy.
version (string) --
The version of the policy.
policyId (string) --
The unique identifier of the policy.
createdAt (datetime) --
The timestamp when the policy was created.
updatedAt (datetime) --
The timestamp when the policy was last updated.
nextToken (string) --
The pagination token to use in a subsequent request to retrieve the next page of results.
Lists all build workflows for an Automated Reasoning policy, showing the history of policy creation and modification attempts.
See also: AWS API Documentation
Request Syntax
client.list_automated_reasoning_policy_build_workflows( policyArn='string', nextToken='string', maxResults=123 )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy whose build workflows you want to list.
string
A pagination token from a previous request to continue listing build workflows from where the previous request left off.
integer
The maximum number of build workflows to return in a single response. Valid range is 1-100.
dict
Response Syntax
{ 'automatedReasoningPolicyBuildWorkflowSummaries': [ { 'policyArn': 'string', 'buildWorkflowId': 'string', 'status': 'SCHEDULED'|'CANCEL_REQUESTED'|'PREPROCESSING'|'BUILDING'|'TESTING'|'COMPLETED'|'FAILED'|'CANCELLED', 'buildWorkflowType': 'INGEST_CONTENT'|'REFINE_POLICY'|'IMPORT_POLICY', 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1) }, ], 'nextToken': 'string' }
Response Structure
(dict) --
automatedReasoningPolicyBuildWorkflowSummaries (list) --
A list of build workflow summaries, each containing key information about a build workflow including its status and timestamps.
(dict) --
Provides a summary of a policy build workflow, including its current status, timing information, and key identifiers.
policyArn (string) --
The Amazon Resource Name (ARN) of the Automated Reasoning policy associated with this build workflow.
buildWorkflowId (string) --
The unique identifier of the build workflow.
status (string) --
The current status of the build workflow (e.g., RUNNING, COMPLETED, FAILED, CANCELLED).
buildWorkflowType (string) --
The type of build workflow (e.g., DOCUMENT_INGESTION, POLICY_REPAIR).
createdAt (datetime) --
The timestamp when the build workflow was created.
updatedAt (datetime) --
The timestamp when the build workflow was last updated.
nextToken (string) --
A pagination token to use in subsequent requests to retrieve additional build workflows.
Retrieves the next test scenario for validating an Automated Reasoning policy. This is used during the interactive policy refinement process to test policy behavior.
See also: AWS API Documentation
Request Syntax
client.get_automated_reasoning_policy_next_scenario( policyArn='string', buildWorkflowId='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy for which you want to get the next test scenario.
string
[REQUIRED]
The unique identifier of the build workflow associated with the test scenarios.
dict
Response Syntax
{ 'policyArn': 'string', 'scenario': { 'expression': 'string', 'alternateExpression': 'string', 'ruleIds': [ 'string', ], 'expectedResult': 'VALID'|'INVALID'|'SATISFIABLE'|'IMPOSSIBLE'|'TRANSLATION_AMBIGUOUS'|'TOO_COMPLEX'|'NO_TRANSLATION' } }
Response Structure
(dict) --
policyArn (string) --
The Amazon Resource Name (ARN) of the Automated Reasoning policy.
scenario (dict) --
The next test scenario to validate, including the test expression and expected results.
expression (string) --
The logical expression or condition that defines this test scenario.
alternateExpression (string) --
An alternative way to express the same test scenario, used for validation and comparison purposes.
ruleIds (list) --
The list of rule identifiers that are expected to be triggered or evaluated by this test scenario.
(string) --
expectedResult (string) --
The expected outcome when this scenario is evaluated against the policy (e.g., PASS, FAIL, VIOLATION).
Retrieves the resulting assets from a completed Automated Reasoning policy build workflow, including build logs, quality reports, and generated policy artifacts.
See also: AWS API Documentation
Request Syntax
client.get_automated_reasoning_policy_build_workflow_result_assets( policyArn='string', buildWorkflowId='string', assetType='BUILD_LOG'|'QUALITY_REPORT'|'POLICY_DEFINITION' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy whose build workflow assets you want to retrieve.
string
[REQUIRED]
The unique identifier of the build workflow whose result assets you want to retrieve.
string
[REQUIRED]
The type of asset to retrieve (e.g., BUILD_LOG, QUALITY_REPORT, POLICY_DEFINITION).
dict
Response Syntax
{ 'policyArn': 'string', 'buildWorkflowId': 'string', 'buildWorkflowAssets': { 'policyDefinition': { 'version': 'string', 'types': [ { 'name': 'string', 'description': 'string', 'values': [ { 'value': 'string', 'description': 'string' }, ] }, ], 'rules': [ { 'id': 'string', 'expression': 'string', 'alternateExpression': 'string' }, ], 'variables': [ { 'name': 'string', 'type': 'string', 'description': 'string' }, ] }, 'qualityReport': { 'typeCount': 123, 'variableCount': 123, 'ruleCount': 123, 'unusedTypes': [ 'string', ], 'unusedTypeValues': [ { 'typeName': 'string', 'valueName': 'string' }, ], 'unusedVariables': [ 'string', ], 'conflictingRules': [ 'string', ], 'disjointRuleSets': [ { 'variables': [ 'string', ], 'rules': [ 'string', ] }, ] }, 'buildLog': { 'entries': [ { 'annotation': { 'addType': { 'name': 'string', 'description': 'string', 'values': [ { 'value': 'string', 'description': 'string' }, ] }, 'updateType': { 'name': 'string', 'newName': 'string', 'description': 'string', 'values': [ { 'addTypeValue': { 'value': 'string', 'description': 'string' }, 'updateTypeValue': { 'value': 'string', 'newValue': 'string', 'description': 'string' }, 'deleteTypeValue': { 'value': 'string' } }, ] }, 'deleteType': { 'name': 'string' }, 'addVariable': { 'name': 'string', 'type': 'string', 'description': 'string' }, 'updateVariable': { 'name': 'string', 'newName': 'string', 'description': 'string' }, 'deleteVariable': { 'name': 'string' }, 'addRule': { 'expression': 'string' }, 'updateRule': { 'ruleId': 'string', 'expression': 'string' }, 'deleteRule': { 'ruleId': 'string' }, 'addRuleFromNaturalLanguage': { 'naturalLanguage': 'string' }, 'updateFromRulesFeedback': { 'ruleIds': [ 'string', ], 'feedback': 'string' }, 'updateFromScenarioFeedback': { 'ruleIds': [ 'string', ], 'scenarioExpression': 'string', 'feedback': 'string' }, 'ingestContent': { 'content': 'string' } }, 'status': 'APPLIED'|'FAILED', 'buildSteps': [ { 'context': { 'planning': {}, 'mutation': { 'addType': { 'type': { 'name': 'string', 'description': 'string', 'values': [ { 'value': 'string', 'description': 'string' }, ] } }, 'updateType': { 'type': { 'name': 'string', 'description': 'string', 'values': [ { 'value': 'string', 'description': 'string' }, ] } }, 'deleteType': { 'name': 'string' }, 'addVariable': { 'variable': { 'name': 'string', 'type': 'string', 'description': 'string' } }, 'updateVariable': { 'variable': { 'name': 'string', 'type': 'string', 'description': 'string' } }, 'deleteVariable': { 'name': 'string' }, 'addRule': { 'rule': { 'id': 'string', 'expression': 'string', 'alternateExpression': 'string' } }, 'updateRule': { 'rule': { 'id': 'string', 'expression': 'string', 'alternateExpression': 'string' } }, 'deleteRule': { 'id': 'string' } } }, 'priorElement': { 'policyDefinitionVariable': { 'name': 'string', 'type': 'string', 'description': 'string' }, 'policyDefinitionType': { 'name': 'string', 'description': 'string', 'values': [ { 'value': 'string', 'description': 'string' }, ] }, 'policyDefinitionRule': { 'id': 'string', 'expression': 'string', 'alternateExpression': 'string' } }, 'messages': [ { 'message': 'string', 'messageType': 'INFO'|'WARNING'|'ERROR' }, ] }, ] }, ] } } }
Response Structure
(dict) --
policyArn (string) --
The Amazon Resource Name (ARN) of the Automated Reasoning policy.
buildWorkflowId (string) --
The unique identifier of the build workflow.
buildWorkflowAssets (dict) --
The requested build workflow asset. This is a union type that returns only one of the available asset types (logs, reports, or generated artifacts) based on the specific asset type requested in the API call.
policyDefinition (dict) --
Contains the formal logic rules, variables, and custom variable types that define an Automated Reasoning policy. The policy definition specifies the constraints used to validate foundation model responses for accuracy and logical consistency.
version (string) --
The version of the policy definition format.
types (list) --
The custom user-defined vairable types used in the policy. Types are enum-based variable types that provide additional context beyond the predefined variable types.
(dict) --
Represents a custom user-defined viarble type in an Automated Reasoning policy. Types are enum-based and provide additional context beyond predefined variable types.
name (string) --
The name of the custom type.
description (string) --
The description of what the custom type represents.
values (list) --
The possible values for this enum-based type, each with its own description.
(dict) --
Represents a single value within a custom type definition, including its identifier and description.
value (string) --
The actual value or identifier for this type value.
description (string) --
A human-readable description explaining what this type value represents and when it should be used.
rules (list) --
The formal logic rules extracted from the source document. Rules define the logical constraints that determine whether model responses are valid, invalid, or satisfiable.
(dict) --
Represents a formal logic rule in an Automated Reasoning policy. For example, rules can be expressed as if-then statements that define logical constraints.
id (string) --
The unique identifier of the rule within the policy.
expression (string) --
The formal logic expression of the rule.
alternateExpression (string) --
The human-readable form of the rule expression, often in natural language or simplified notation.
variables (list) --
The variables that represent concepts in the policy. Variables can have values assigned when translating natural language into formal logic. Their descriptions are crucial for accurate translation.
(dict) --
Represents a variable in an Automated Reasoning policy. Variables represent concepts that can have values assigned during natural language translation.
name (string) --
The name of the variable. Use descriptive names that clearly indicate the concept being represented.
type (string) --
The data type of the variable. Valid types include bool, int, real, enum, and custom types that you can provide.
description (string) --
The description of the variable that explains what it represents and how users might refer to it. Clear and comprehensive descriptions are essential for accurate natural language translation.
qualityReport (dict) --
A comprehensive report analyzing the quality of the generated policy, including metrics about rule coverage, potential conflicts, and unused elements.
typeCount (integer) --
The total number of custom types defined in the policy.
variableCount (integer) --
The total number of variables defined in the policy.
ruleCount (integer) --
The total number of rules defined in the policy.
unusedTypes (list) --
A list of custom types that are defined but not referenced by any variables or rules, suggesting they may be unnecessary.
(string) --
unusedTypeValues (list) --
A list of type values that are defined but never used in any rules, indicating potential cleanup opportunities.
(dict) --
Associates a type name with a specific value name, used for referencing type values in rules and other policy elements.
typeName (string) --
The name of the custom type that contains the referenced value.
valueName (string) --
The name of the specific value within the type.
unusedVariables (list) --
A list of variables that are defined but not referenced by any rules, suggesting they may be unnecessary.
(string) --
conflictingRules (list) --
A list of rules that may conflict with each other, potentially leading to inconsistent policy behavior.
(string) --
disjointRuleSets (list) --
Groups of rules that operate on completely separate sets of variables, indicating the policy may be addressing multiple unrelated concerns.
(dict) --
Represents a set of rules that operate on completely separate variables, indicating they address different concerns or domains within the policy.
variables (list) --
The set of variables that are used by the rules in this disjoint set.
(string) --
rules (list) --
The list of rules that form this disjoint set, all operating on the same set of variables.
(string) --
buildLog (dict) --
The complete build log containing detailed information about each step in the policy generation process.
entries (list) --
A list of log entries documenting each step in the policy build process, including timestamps, status, and detailed messages.
(dict) --
Represents a single entry in the policy build log, containing information about a specific step or event in the build process.
annotation (dict) --
The annotation or operation that was being processed when this log entry was created.
addType (dict) --
An operation to add a new custom type to the policy, defining a set of possible values for policy variables.
name (string) --
The name of the new custom type. This name will be used to reference the type in variable definitions and rules.
description (string) --
A description of what the custom type represents and how it should be used in the policy.
values (list) --
The list of possible values that variables of this type can take, each with its own description and identifier.
(dict) --
Represents a single value within a custom type definition, including its identifier and description.
value (string) --
The actual value or identifier for this type value.
description (string) --
A human-readable description explaining what this type value represents and when it should be used.
updateType (dict) --
An operation to modify an existing custom type in the policy, such as changing its name, description, or allowed values.
name (string) --
The current name of the custom type to update.
newName (string) --
The new name for the custom type, if you want to rename it. If not provided, the name remains unchanged.
description (string) --
The new description for the custom type, replacing the previous description.
values (list) --
The updated list of values for the custom type, which can include additions, modifications, or removals.
(dict) --
An annotation for managing values within custom types, including adding, updating, or removing specific type values.
addTypeValue (dict) --
An operation to add a new value to an existing custom type.
value (string) --
The identifier or name of the new value to add to the type.
description (string) --
A description of what this new type value represents and when it should be used.
updateTypeValue (dict) --
An operation to modify an existing value within a custom type.
value (string) --
The current identifier or name of the type value to update.
newValue (string) --
The new identifier or name for the type value, if you want to rename it.
description (string) --
The new description for the type value, replacing the previous description.
deleteTypeValue (dict) --
An operation to remove a value from an existing custom type.
value (string) --
The identifier or name of the value to remove from the type.
deleteType (dict) --
An operation to remove a custom type from the policy. The type must not be referenced by any variables or rules.
name (string) --
The name of the custom type to delete from the policy. The type must not be referenced by any variables or rules.
addVariable (dict) --
An operation to add a new variable to the policy, which can be used in rule expressions to represent dynamic values.
name (string) --
The name of the new variable. This name will be used to reference the variable in rule expressions.
type (string) --
The type of the variable, which can be a built-in type (like string or number) or a custom type defined in the policy.
description (string) --
A description of what the variable represents and how it should be used in rules.
updateVariable (dict) --
An operation to modify an existing variable in the policy, such as changing its name, type, or description.
name (string) --
The current name of the variable to update.
newName (string) --
The new name for the variable, if you want to rename it. If not provided, the name remains unchanged.
description (string) --
The new description for the variable, replacing the previous description.
deleteVariable (dict) --
An operation to remove a variable from the policy. The variable must not be referenced by any rules.
name (string) --
The name of the variable to delete from the policy. The variable must not be referenced by any rules.
addRule (dict) --
An operation to add a new logical rule to the policy using formal mathematical expressions.
expression (string) --
The formal logical expression that defines the rule, using mathematical notation and referencing policy variables and types.
updateRule (dict) --
An operation to modify an existing rule in the policy, such as changing its logical expression or conditions.
ruleId (string) --
The unique identifier of the rule to update.
expression (string) --
The new formal logical expression for the rule, replacing the previous expression.
deleteRule (dict) --
An operation to remove a rule from the policy.
ruleId (string) --
The unique identifier of the rule to delete from the policy.
addRuleFromNaturalLanguage (dict) --
An operation to add a new rule by converting natural language descriptions into formal logical expressions.
naturalLanguage (string) --
The natural language description of the rule that should be converted into a formal logical expression.
updateFromRulesFeedback (dict) --
An operation to update the policy based on feedback about how specific rules performed during testing or validation.
ruleIds (list) --
The list of rule identifiers that the feedback applies to.
(string) --
feedback (string) --
The feedback information about rule performance, including suggestions for improvements or corrections.
updateFromScenarioFeedback (dict) --
An operation to update the policy based on feedback about how it performed on specific test scenarios.
ruleIds (list) --
The list of rule identifiers that were involved in the scenario being evaluated.
(string) --
scenarioExpression (string) --
The logical expression that defines the test scenario that generated this feedback.
feedback (string) --
The feedback information about scenario performance, including any issues or improvements identified.
ingestContent (dict) --
An operation to process and incorporate new content into the policy, extracting additional rules and concepts.
content (string) --
The new content to be analyzed and incorporated into the policy, such as additional documents or rule descriptions.
status (string) --
The status of the build step (e.g., SUCCESS, FAILED, IN_PROGRESS).
buildSteps (list) --
Detailed information about the specific build steps that were executed, including any sub-operations or transformations.
(dict) --
Represents a single step in the policy build process, containing context about what was being processed and any messages or results.
context (dict) --
Contextual information about what was being processed during this build step, such as the type of operation or the source material being analyzed.
planning (dict) --
Indicates that this build step was part of the planning phase, where the system determines what operations to perform.
mutation (dict) --
Indicates that this build step involved modifying the policy structure, such as adding or updating rules, variables, or types.
addType (dict) --
A mutation to add a new custom type to the policy.
type (dict) --
Represents a custom user-defined viarble type in an Automated Reasoning policy. Types are enum-based and provide additional context beyond predefined variable types.
name (string) --
The name of the custom type.
description (string) --
The description of what the custom type represents.
values (list) --
The possible values for this enum-based type, each with its own description.
(dict) --
Represents a single value within a custom type definition, including its identifier and description.
value (string) --
The actual value or identifier for this type value.
description (string) --
A human-readable description explaining what this type value represents and when it should be used.
updateType (dict) --
A mutation to modify an existing custom type in the policy.
type (dict) --
Represents a custom user-defined viarble type in an Automated Reasoning policy. Types are enum-based and provide additional context beyond predefined variable types.
name (string) --
The name of the custom type.
description (string) --
The description of what the custom type represents.
values (list) --
The possible values for this enum-based type, each with its own description.
(dict) --
Represents a single value within a custom type definition, including its identifier and description.
value (string) --
The actual value or identifier for this type value.
description (string) --
A human-readable description explaining what this type value represents and when it should be used.
deleteType (dict) --
A mutation to remove a custom type from the policy.
name (string) --
The name of the custom type to delete.
addVariable (dict) --
A mutation to add a new variable to the policy.
variable (dict) --
Represents a variable in an Automated Reasoning policy. Variables represent concepts that can have values assigned during natural language translation.
name (string) --
The name of the variable. Use descriptive names that clearly indicate the concept being represented.
type (string) --
The data type of the variable. Valid types include bool, int, real, enum, and custom types that you can provide.
description (string) --
The description of the variable that explains what it represents and how users might refer to it. Clear and comprehensive descriptions are essential for accurate natural language translation.
updateVariable (dict) --
A mutation to modify an existing variable in the policy.
variable (dict) --
Represents a variable in an Automated Reasoning policy. Variables represent concepts that can have values assigned during natural language translation.
name (string) --
The name of the variable. Use descriptive names that clearly indicate the concept being represented.
type (string) --
The data type of the variable. Valid types include bool, int, real, enum, and custom types that you can provide.
description (string) --
The description of the variable that explains what it represents and how users might refer to it. Clear and comprehensive descriptions are essential for accurate natural language translation.
deleteVariable (dict) --
A mutation to remove a variable from the policy.
name (string) --
The name of the variable to delete.
addRule (dict) --
A mutation to add a new rule to the policy.
rule (dict) --
Represents a formal logic rule in an Automated Reasoning policy. For example, rules can be expressed as if-then statements that define logical constraints.
id (string) --
The unique identifier of the rule within the policy.
expression (string) --
The formal logic expression of the rule.
alternateExpression (string) --
The human-readable form of the rule expression, often in natural language or simplified notation.
updateRule (dict) --
A mutation to modify an existing rule in the policy.
rule (dict) --
Represents a formal logic rule in an Automated Reasoning policy. For example, rules can be expressed as if-then statements that define logical constraints.
id (string) --
The unique identifier of the rule within the policy.
expression (string) --
The formal logic expression of the rule.
alternateExpression (string) --
The human-readable form of the rule expression, often in natural language or simplified notation.
deleteRule (dict) --
A mutation to remove a rule from the policy.
id (string) --
The unique identifier of the rule to delete.
priorElement (dict) --
Reference to the previous element or step in the build process, helping to trace the sequence of operations.
policyDefinitionVariable (dict) --
Represents a variable in an Automated Reasoning policy. Variables represent concepts that can have values assigned during natural language translation.
name (string) --
The name of the variable. Use descriptive names that clearly indicate the concept being represented.
type (string) --
The data type of the variable. Valid types include bool, int, real, enum, and custom types that you can provide.
description (string) --
The description of the variable that explains what it represents and how users might refer to it. Clear and comprehensive descriptions are essential for accurate natural language translation.
policyDefinitionType (dict) --
Represents a custom user-defined viarble type in an Automated Reasoning policy. Types are enum-based and provide additional context beyond predefined variable types.
name (string) --
The name of the custom type.
description (string) --
The description of what the custom type represents.
values (list) --
The possible values for this enum-based type, each with its own description.
(dict) --
Represents a single value within a custom type definition, including its identifier and description.
value (string) --
The actual value or identifier for this type value.
description (string) --
A human-readable description explaining what this type value represents and when it should be used.
policyDefinitionRule (dict) --
Represents a formal logic rule in an Automated Reasoning policy. For example, rules can be expressed as if-then statements that define logical constraints.
id (string) --
The unique identifier of the rule within the policy.
expression (string) --
The formal logic expression of the rule.
alternateExpression (string) --
The human-readable form of the rule expression, often in natural language or simplified notation.
messages (list) --
A list of messages generated during this build step, including informational messages, warnings, and error details.
(dict) --
Represents a message generated during a build step, providing information about what happened or any issues encountered.
message (string) --
The content of the message, describing what occurred during the build step.
messageType (string) --
The type of message (e.g., INFO, WARNING, ERROR) indicating its severity and purpose.
Retrieves details about an Automated Reasoning policy or policy version. Returns information including the policy definition, metadata, and timestamps.
See also: AWS API Documentation
Request Syntax
client.get_automated_reasoning_policy( policyArn='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy to retrieve. Can be either the unversioned ARN for the draft policy or an ARN for a specific policy version.
dict
Response Syntax
{ 'policyArn': 'string', 'name': 'string', 'version': 'string', 'policyId': 'string', 'description': 'string', 'definitionHash': 'string', 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1) }
Response Structure
(dict) --
policyArn (string) --
The Amazon Resource Name (ARN) of the policy.
name (string) --
The name of the policy.
version (string) --
The version of the policy.
policyId (string) --
The unique identifier of the policy.
description (string) --
The description of the policy.
definitionHash (string) --
The hash of the policy definition used as a concurrency token.
createdAt (datetime) --
The timestamp when the policy was created.
updatedAt (datetime) --
The timestamp when the policy was last updated.
Updates an existing Automated Reasoning policy test. You can modify the content, query, expected result, and confidence threshold.
See also: AWS API Documentation
Request Syntax
client.update_automated_reasoning_policy_test_case( policyArn='string', testCaseId='string', guardContent='string', queryContent='string', lastUpdatedAt=datetime(2015, 1, 1), expectedAggregatedFindingsResult='VALID'|'INVALID'|'SATISFIABLE'|'IMPOSSIBLE'|'TRANSLATION_AMBIGUOUS'|'TOO_COMPLEX'|'NO_TRANSLATION', confidenceThreshold=123.0, kmsKeyArn='string', clientRequestToken='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy that contains the test.
string
[REQUIRED]
The unique identifier of the test to update.
string
[REQUIRED]
The updated content to be validated by the Automated Reasoning policy.
string
The updated input query or prompt that generated the content.
datetime
[REQUIRED]
The timestamp when the test was last updated. This is used as a concurrency token to prevent conflicting modifications.
string
[REQUIRED]
The updated expected result of the Automated Reasoning check.
float
The updated minimum confidence level for logic validation. If null is provided, the threshold will be removed.
string
The KMS key ARN for encrypting the test at rest. If not provided, the key will not be updated. Use DISCARD to remove the key.
string
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error.
This field is autopopulated if not provided.
dict
Response Syntax
{ 'policyArn': 'string', 'testCaseId': 'string' }
Response Structure
(dict) --
policyArn (string) --
The Amazon Resource Name (ARN) of the policy that contains the updated test.
testCaseId (string) --
The unique identifier of the updated test.
Creates a new version of an existing Automated Reasoning policy. This allows you to iterate on your policy rules while maintaining previous versions for rollback or comparison purposes.
See also: AWS API Documentation
Request Syntax
client.create_automated_reasoning_policy_version( policyArn='string', clientRequestToken='string', lastUpdatedDefinitionHash='string', tags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy for which to create a version.
string
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error.
This field is autopopulated if not provided.
string
[REQUIRED]
The hash of the current policy definition used as a concurrency token to ensure the policy hasn't been modified since you last retrieved it.
list
A list of tags to associate with the policy version.
(dict) --
Definition of the key/value pair for a tag.
key (string) -- [REQUIRED]
Key for the tag.
value (string) -- [REQUIRED]
Value for the tag.
dict
Response Syntax
{ 'policyArn': 'string', 'version': 'string', 'name': 'string', 'description': 'string', 'definitionHash': 'string', 'createdAt': datetime(2015, 1, 1) }
Response Structure
(dict) --
policyArn (string) --
The versioned Amazon Resource Name (ARN) of the policy version.
version (string) --
The version number of the policy version.
name (string) --
The name of the policy version.
description (string) --
The description of the policy version.
definitionHash (string) --
The hash of the policy definition for this version.
createdAt (datetime) --
The timestamp when the policy version was created.
{'automatedReasoningPolicyConfig': {'confidenceThreshold': 'double', 'policies': ['string']}}
Creates a guardrail to block topics and to implement safeguards for your generative AI applications.
You can configure the following policies in a guardrail to avoid undesirable and harmful content, filter out denied topics and words, and remove sensitive information for privacy protection.
Content filters - Adjust filter strengths to block input prompts or model responses containing harmful content.
Denied topics - Define a set of topics that are undesirable in the context of your application. These topics will be blocked if detected in user queries or model responses.
Word filters - Configure filters to block undesirable words, phrases, and profanity. Such words can include offensive terms, competitor names etc.
Sensitive information filters - Block or mask sensitive information such as personally identifiable information (PII) or custom regex in user inputs and model responses.
In addition to the above policies, you can also configure the messages to be returned to the user if a user input or model response is in violation of the policies defined in the guardrail.
For more information, see Amazon Bedrock Guardrails in the Amazon Bedrock User Guide.
See also: AWS API Documentation
Request Syntax
client.create_guardrail( name='string', description='string', topicPolicyConfig={ 'topicsConfig': [ { 'name': 'string', 'definition': 'string', 'examples': [ 'string', ], 'type': 'DENY', 'inputAction': 'BLOCK'|'NONE', 'outputAction': 'BLOCK'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ], 'tierConfig': { 'tierName': 'CLASSIC'|'STANDARD' } }, contentPolicyConfig={ 'filtersConfig': [ { 'type': 'SEXUAL'|'VIOLENCE'|'HATE'|'INSULTS'|'MISCONDUCT'|'PROMPT_ATTACK', 'inputStrength': 'NONE'|'LOW'|'MEDIUM'|'HIGH', 'outputStrength': 'NONE'|'LOW'|'MEDIUM'|'HIGH', 'inputModalities': [ 'TEXT'|'IMAGE', ], 'outputModalities': [ 'TEXT'|'IMAGE', ], 'inputAction': 'BLOCK'|'NONE', 'outputAction': 'BLOCK'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ], 'tierConfig': { 'tierName': 'CLASSIC'|'STANDARD' } }, wordPolicyConfig={ 'wordsConfig': [ { 'text': 'string', 'inputAction': 'BLOCK'|'NONE', 'outputAction': 'BLOCK'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ], 'managedWordListsConfig': [ { 'type': 'PROFANITY', 'inputAction': 'BLOCK'|'NONE', 'outputAction': 'BLOCK'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ] }, sensitiveInformationPolicyConfig={ 'piiEntitiesConfig': [ { 'type': 'ADDRESS'|'AGE'|'AWS_ACCESS_KEY'|'AWS_SECRET_KEY'|'CA_HEALTH_NUMBER'|'CA_SOCIAL_INSURANCE_NUMBER'|'CREDIT_DEBIT_CARD_CVV'|'CREDIT_DEBIT_CARD_EXPIRY'|'CREDIT_DEBIT_CARD_NUMBER'|'DRIVER_ID'|'EMAIL'|'INTERNATIONAL_BANK_ACCOUNT_NUMBER'|'IP_ADDRESS'|'LICENSE_PLATE'|'MAC_ADDRESS'|'NAME'|'PASSWORD'|'PHONE'|'PIN'|'SWIFT_CODE'|'UK_NATIONAL_HEALTH_SERVICE_NUMBER'|'UK_NATIONAL_INSURANCE_NUMBER'|'UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER'|'URL'|'USERNAME'|'US_BANK_ACCOUNT_NUMBER'|'US_BANK_ROUTING_NUMBER'|'US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER'|'US_PASSPORT_NUMBER'|'US_SOCIAL_SECURITY_NUMBER'|'VEHICLE_IDENTIFICATION_NUMBER', 'action': 'BLOCK'|'ANONYMIZE'|'NONE', 'inputAction': 'BLOCK'|'ANONYMIZE'|'NONE', 'outputAction': 'BLOCK'|'ANONYMIZE'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ], 'regexesConfig': [ { 'name': 'string', 'description': 'string', 'pattern': 'string', 'action': 'BLOCK'|'ANONYMIZE'|'NONE', 'inputAction': 'BLOCK'|'ANONYMIZE'|'NONE', 'outputAction': 'BLOCK'|'ANONYMIZE'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ] }, contextualGroundingPolicyConfig={ 'filtersConfig': [ { 'type': 'GROUNDING'|'RELEVANCE', 'threshold': 123.0, 'action': 'BLOCK'|'NONE', 'enabled': True|False }, ] }, automatedReasoningPolicyConfig={ 'policies': [ 'string', ], 'confidenceThreshold': 123.0 }, crossRegionConfig={ 'guardrailProfileIdentifier': 'string' }, blockedInputMessaging='string', blockedOutputsMessaging='string', kmsKeyId='string', tags=[ { 'key': 'string', 'value': 'string' }, ], clientRequestToken='string' )
string
[REQUIRED]
The name to give the guardrail.
string
A description of the guardrail.
dict
The topic policies to configure for the guardrail.
topicsConfig (list) -- [REQUIRED]
A list of policies related to topics that the guardrail should deny.
(dict) --
Details about topics for the guardrail to identify and deny.
name (string) -- [REQUIRED]
The name of the topic to deny.
definition (string) -- [REQUIRED]
A definition of the topic to deny.
examples (list) --
A list of prompts, each of which is an example of a prompt that can be categorized as belonging to the topic.
(string) --
type (string) -- [REQUIRED]
Specifies to deny the topic.
inputAction (string) --
Specifies the action to take when harmful content is detected in the input. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
Specifies the action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
tierConfig (dict) --
The tier that your guardrail uses for denied topic filters.
tierName (string) -- [REQUIRED]
The tier that your guardrail uses for denied topic filters. Valid values include:
CLASSIC tier – Provides established guardrails functionality supporting English, French, and Spanish languages.
STANDARD tier – Provides a more robust solution than the CLASSIC tier and has more comprehensive language support. This tier requires that your guardrail use cross-Region inference.
dict
The content filter policies to configure for the guardrail.
filtersConfig (list) -- [REQUIRED]
Contains the type of the content filter and how strongly it should apply to prompts and model responses.
(dict) --
Contains filter strengths for harmful content. Guardrails support the following content filters to detect and filter harmful user inputs and FM-generated outputs.
Hate – Describes language or a statement that discriminates, criticizes, insults, denounces, or dehumanizes a person or group on the basis of an identity (such as race, ethnicity, gender, religion, sexual orientation, ability, and national origin).
Insults – Describes language or a statement that includes demeaning, humiliating, mocking, insulting, or belittling language. This type of language is also labeled as bullying.
Sexual – Describes language or a statement that indicates sexual interest, activity, or arousal using direct or indirect references to body parts, physical traits, or sex.
Violence – Describes language or a statement that includes glorification of or threats to inflict physical pain, hurt, or injury toward a person, group or thing.
Content filtering depends on the confidence classification of user inputs and FM responses across each of the four harmful categories. All input and output statements are classified into one of four confidence levels (NONE, LOW, MEDIUM, HIGH) for each harmful category. For example, if a statement is classified as Hate with HIGH confidence, the likelihood of the statement representing hateful content is high. A single statement can be classified across multiple categories with varying confidence levels. For example, a single statement can be classified as Hate with HIGH confidence, Insults with LOW confidence, Sexual with NONE confidence, and Violence with MEDIUM confidence.
For more information, see Guardrails content filters.
type (string) -- [REQUIRED]
The harmful category that the content filter is applied to.
inputStrength (string) -- [REQUIRED]
The strength of the content filter to apply to prompts. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.
outputStrength (string) -- [REQUIRED]
The strength of the content filter to apply to model responses. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.
inputModalities (list) --
The input modalities selected for the guardrail content filter configuration.
(string) --
outputModalities (list) --
The output modalities selected for the guardrail content filter configuration.
(string) --
inputAction (string) --
Specifies the action to take when harmful content is detected. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
Specifies the action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
tierConfig (dict) --
The tier that your guardrail uses for content filters.
tierName (string) -- [REQUIRED]
The tier that your guardrail uses for content filters. Valid values include:
CLASSIC tier – Provides established guardrails functionality supporting English, French, and Spanish languages.
STANDARD tier – Provides a more robust solution than the CLASSIC tier and has more comprehensive language support. This tier requires that your guardrail use cross-Region inference.
dict
The word policy you configure for the guardrail.
wordsConfig (list) --
A list of words to configure for the guardrail.
(dict) --
A word to configure for the guardrail.
text (string) -- [REQUIRED]
Text of the word configured for the guardrail to block.
inputAction (string) --
Specifies the action to take when harmful content is detected in the input. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
Specifies the action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the intput. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
managedWordListsConfig (list) --
A list of managed words to configure for the guardrail.
(dict) --
The managed word list to configure for the guardrail.
type (string) -- [REQUIRED]
The managed word type to configure for the guardrail.
inputAction (string) --
Specifies the action to take when harmful content is detected in the input. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
Specifies the action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
dict
The sensitive information policy to configure for the guardrail.
piiEntitiesConfig (list) --
A list of PII entities to configure to the guardrail.
(dict) --
The PII entity to configure for the guardrail.
type (string) -- [REQUIRED]
Configure guardrail type when the PII entity is detected.
The following PIIs are used to block or mask sensitive information:
General
ADDRESS A physical address, such as "100 Main Street, Anytown, USA" or "Suite #12, Building 123". An address can include information such as the street, building, location, city, state, country, county, zip code, precinct, and neighborhood.
AGE An individual's age, including the quantity and unit of time. For example, in the phrase "I am 40 years old," Guardrails recognizes "40 years" as an age.
NAME An individual's name. This entity type does not include titles, such as Dr., Mr., Mrs., or Miss. guardrails doesn't apply this entity type to names that are part of organizations or addresses. For example, guardrails recognizes the "John Doe Organization" as an organization, and it recognizes "Jane Doe Street" as an address.
EMAIL An email address, such as marymajor@email.com.
PHONE A phone number. This entity type also includes fax and pager numbers.
USERNAME A user name that identifies an account, such as a login name, screen name, nick name, or handle.
PASSWORD An alphanumeric string that is used as a password, such as "very20special#pass".
DRIVER_ID The number assigned to a driver's license, which is an official document permitting an individual to operate one or more motorized vehicles on a public road. A driver's license number consists of alphanumeric characters.
LICENSE_PLATE A license plate for a vehicle is issued by the state or country where the vehicle is registered. The format for passenger vehicles is typically five to eight digits, consisting of upper-case letters and numbers. The format varies depending on the location of the issuing state or country.
VEHICLE_IDENTIFICATION_NUMBER A Vehicle Identification Number (VIN) uniquely identifies a vehicle. VIN content and format are defined in the ISO 3779 specification. Each country has specific codes and formats for VINs.
Finance
CREDIT_DEBIT_CARD_CVV A three-digit card verification code (CVV) that is present on VISA, MasterCard, and Discover credit and debit cards. For American Express credit or debit cards, the CVV is a four-digit numeric code.
CREDIT_DEBIT_CARD_EXPIRY The expiration date for a credit or debit card. This number is usually four digits long and is often formatted as month/year or MM/YY. Guardrails recognizes expiration dates such as 01/21, 01/2021, and Jan 2021.
CREDIT_DEBIT_CARD_NUMBER The number for a credit or debit card. These numbers can vary from 13 to 16 digits in length. However, Amazon Comprehend also recognizes credit or debit card numbers when only the last four digits are present.
PIN A four-digit personal identification number (PIN) with which you can access your bank account.
INTERNATIONAL_BANK_ACCOUNT_NUMBER An International Bank Account Number has specific formats in each country. For more information, see www.iban.com/structure.
SWIFT_CODE A SWIFT code is a standard format of Bank Identifier Code (BIC) used to specify a particular bank or branch. Banks use these codes for money transfers such as international wire transfers. SWIFT codes consist of eight or 11 characters. The 11-digit codes refer to specific branches, while eight-digit codes (or 11-digit codes ending in 'XXX') refer to the head or primary office.
IT
IP_ADDRESS An IPv4 address, such as 198.51.100.0.
MAC_ADDRESS A media access control (MAC) address is a unique identifier assigned to a network interface controller (NIC).
URL A web address, such as www.example.com.
AWS_ACCESS_KEY A unique identifier that's associated with a secret access key; you use the access key ID and secret access key to sign programmatic Amazon Web Services requests cryptographically.
AWS_SECRET_KEY A unique identifier that's associated with an access key. You use the access key ID and secret access key to sign programmatic Amazon Web Services requests cryptographically.
USA specific
US_BANK_ACCOUNT_NUMBER A US bank account number, which is typically 10 to 12 digits long.
US_BANK_ROUTING_NUMBER A US bank account routing number. These are typically nine digits long,
US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER A US Individual Taxpayer Identification Number (ITIN) is a nine-digit number that starts with a "9" and contain a "7" or "8" as the fourth digit. An ITIN can be formatted with a space or a dash after the third and forth digits.
US_PASSPORT_NUMBER A US passport number. Passport numbers range from six to nine alphanumeric characters.
US_SOCIAL_SECURITY_NUMBER A US Social Security Number (SSN) is a nine-digit number that is issued to US citizens, permanent residents, and temporary working residents.
Canada specific
CA_HEALTH_NUMBER A Canadian Health Service Number is a 10-digit unique identifier, required for individuals to access healthcare benefits.
CA_SOCIAL_INSURANCE_NUMBER A Canadian Social Insurance Number (SIN) is a nine-digit unique identifier, required for individuals to access government programs and benefits. The SIN is formatted as three groups of three digits, such as 123-456-789. A SIN can be validated through a simple check-digit process called the Luhn algorithm.
UK Specific
UK_NATIONAL_HEALTH_SERVICE_NUMBER A UK National Health Service Number is a 10-17 digit number, such as 485 777 3456. The current system formats the 10-digit number with spaces after the third and sixth digits. The final digit is an error-detecting checksum.
UK_NATIONAL_INSURANCE_NUMBER A UK National Insurance Number (NINO) provides individuals with access to National Insurance (social security) benefits. It is also used for some purposes in the UK tax system. The number is nine digits long and starts with two letters, followed by six numbers and one letter. A NINO can be formatted with a space or a dash after the two letters and after the second, forth, and sixth digits.
UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER A UK Unique Taxpayer Reference (UTR) is a 10-digit number that identifies a taxpayer or a business.
Custom
Regex filter - You can use a regular expressions to define patterns for a guardrail to recognize and act upon such as serial number, booking ID etc..
action (string) -- [REQUIRED]
Configure guardrail action when the PII entity is detected.
inputAction (string) --
Specifies the action to take when harmful content is detected in the input. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
ANONYMIZE – Mask the content and replace it with identifier tags.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
Specifies the action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
ANONYMIZE – Mask the content and replace it with identifier tags.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
regexesConfig (list) --
A list of regular expressions to configure to the guardrail.
(dict) --
The regular expression to configure for the guardrail.
name (string) -- [REQUIRED]
The name of the regular expression to configure for the guardrail.
description (string) --
The description of the regular expression to configure for the guardrail.
pattern (string) -- [REQUIRED]
The regular expression pattern to configure for the guardrail.
action (string) -- [REQUIRED]
The guardrail action to configure when matching regular expression is detected.
inputAction (string) --
Specifies the action to take when harmful content is detected in the input. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
Specifies the action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
dict
The contextual grounding policy configuration used to create a guardrail.
filtersConfig (list) -- [REQUIRED]
The filter configuration details for the guardrails contextual grounding policy.
(dict) --
The filter configuration details for the guardrails contextual grounding filter.
type (string) -- [REQUIRED]
The filter details for the guardrails contextual grounding filter.
threshold (float) -- [REQUIRED]
The threshold details for the guardrails contextual grounding filter.
action (string) --
Specifies the action to take when content fails the contextual grounding evaluation. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
enabled (boolean) --
Specifies whether to enable contextual grounding evaluation. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
dict
Optional configuration for integrating Automated Reasoning policies with the new guardrail.
policies (list) -- [REQUIRED]
The list of Automated Reasoning policy ARNs to include in the guardrail configuration.
(string) --
confidenceThreshold (float) --
The confidence threshold for triggering guardrail actions based on Automated Reasoning policy violations.
dict
The system-defined guardrail profile that you're using with your guardrail. Guardrail profiles define the destination Amazon Web Services Regions where guardrail inference requests can be automatically routed.
For more information, see the Amazon Bedrock User Guide.
guardrailProfileIdentifier (string) -- [REQUIRED]
The ID or Amazon Resource Name (ARN) of the guardrail profile that your guardrail is using. Guardrail profile availability depends on your current Amazon Web Services Region. For more information, see the Amazon Bedrock User Guide.
string
[REQUIRED]
The message to return when the guardrail blocks a prompt.
string
[REQUIRED]
The message to return when the guardrail blocks a model response.
string
The ARN of the KMS key that you use to encrypt the guardrail.
list
The tags that you want to attach to the guardrail.
(dict) --
Definition of the key/value pair for a tag.
key (string) -- [REQUIRED]
Key for the tag.
value (string) -- [REQUIRED]
Value for the tag.
string
A unique, case-sensitive identifier to ensure that the API request completes no more than once. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency in the Amazon S3 User Guide.
This field is autopopulated if not provided.
dict
Response Syntax
{ 'guardrailId': 'string', 'guardrailArn': 'string', 'version': 'string', 'createdAt': datetime(2015, 1, 1) }
Response Structure
(dict) --
guardrailId (string) --
The unique identifier of the guardrail that was created.
guardrailArn (string) --
The ARN of the guardrail.
version (string) --
The version of the guardrail that was created. This value will always be DRAFT.
createdAt (datetime) --
The time at which the guardrail was created.
{'automatedReasoningPolicy': {'confidenceThreshold': 'double', 'policies': ['string']}}
Gets details about a guardrail. If you don't specify a version, the response returns details for the DRAFT version.
See also: AWS API Documentation
Request Syntax
client.get_guardrail( guardrailIdentifier='string', guardrailVersion='string' )
string
[REQUIRED]
The unique identifier of the guardrail for which to get details. This can be an ID or the ARN.
string
The version of the guardrail for which to get details. If you don't specify a version, the response returns details for the DRAFT version.
dict
Response Syntax
{ 'name': 'string', 'description': 'string', 'guardrailId': 'string', 'guardrailArn': 'string', 'version': 'string', 'status': 'CREATING'|'UPDATING'|'VERSIONING'|'READY'|'FAILED'|'DELETING', 'topicPolicy': { 'topics': [ { 'name': 'string', 'definition': 'string', 'examples': [ 'string', ], 'type': 'DENY', 'inputAction': 'BLOCK'|'NONE', 'outputAction': 'BLOCK'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ], 'tier': { 'tierName': 'CLASSIC'|'STANDARD' } }, 'contentPolicy': { 'filters': [ { 'type': 'SEXUAL'|'VIOLENCE'|'HATE'|'INSULTS'|'MISCONDUCT'|'PROMPT_ATTACK', 'inputStrength': 'NONE'|'LOW'|'MEDIUM'|'HIGH', 'outputStrength': 'NONE'|'LOW'|'MEDIUM'|'HIGH', 'inputModalities': [ 'TEXT'|'IMAGE', ], 'outputModalities': [ 'TEXT'|'IMAGE', ], 'inputAction': 'BLOCK'|'NONE', 'outputAction': 'BLOCK'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ], 'tier': { 'tierName': 'CLASSIC'|'STANDARD' } }, 'wordPolicy': { 'words': [ { 'text': 'string', 'inputAction': 'BLOCK'|'NONE', 'outputAction': 'BLOCK'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ], 'managedWordLists': [ { 'type': 'PROFANITY', 'inputAction': 'BLOCK'|'NONE', 'outputAction': 'BLOCK'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ] }, 'sensitiveInformationPolicy': { 'piiEntities': [ { 'type': 'ADDRESS'|'AGE'|'AWS_ACCESS_KEY'|'AWS_SECRET_KEY'|'CA_HEALTH_NUMBER'|'CA_SOCIAL_INSURANCE_NUMBER'|'CREDIT_DEBIT_CARD_CVV'|'CREDIT_DEBIT_CARD_EXPIRY'|'CREDIT_DEBIT_CARD_NUMBER'|'DRIVER_ID'|'EMAIL'|'INTERNATIONAL_BANK_ACCOUNT_NUMBER'|'IP_ADDRESS'|'LICENSE_PLATE'|'MAC_ADDRESS'|'NAME'|'PASSWORD'|'PHONE'|'PIN'|'SWIFT_CODE'|'UK_NATIONAL_HEALTH_SERVICE_NUMBER'|'UK_NATIONAL_INSURANCE_NUMBER'|'UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER'|'URL'|'USERNAME'|'US_BANK_ACCOUNT_NUMBER'|'US_BANK_ROUTING_NUMBER'|'US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER'|'US_PASSPORT_NUMBER'|'US_SOCIAL_SECURITY_NUMBER'|'VEHICLE_IDENTIFICATION_NUMBER', 'action': 'BLOCK'|'ANONYMIZE'|'NONE', 'inputAction': 'BLOCK'|'ANONYMIZE'|'NONE', 'outputAction': 'BLOCK'|'ANONYMIZE'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ], 'regexes': [ { 'name': 'string', 'description': 'string', 'pattern': 'string', 'action': 'BLOCK'|'ANONYMIZE'|'NONE', 'inputAction': 'BLOCK'|'ANONYMIZE'|'NONE', 'outputAction': 'BLOCK'|'ANONYMIZE'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ] }, 'contextualGroundingPolicy': { 'filters': [ { 'type': 'GROUNDING'|'RELEVANCE', 'threshold': 123.0, 'action': 'BLOCK'|'NONE', 'enabled': True|False }, ] }, 'automatedReasoningPolicy': { 'policies': [ 'string', ], 'confidenceThreshold': 123.0 }, 'crossRegionDetails': { 'guardrailProfileId': 'string', 'guardrailProfileArn': 'string' }, 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1), 'statusReasons': [ 'string', ], 'failureRecommendations': [ 'string', ], 'blockedInputMessaging': 'string', 'blockedOutputsMessaging': 'string', 'kmsKeyArn': 'string' }
Response Structure
(dict) --
name (string) --
The name of the guardrail.
description (string) --
The description of the guardrail.
guardrailId (string) --
The unique identifier of the guardrail.
guardrailArn (string) --
The ARN of the guardrail.
version (string) --
The version of the guardrail.
status (string) --
The status of the guardrail.
topicPolicy (dict) --
The topic policy that was configured for the guardrail.
topics (list) --
A list of policies related to topics that the guardrail should deny.
(dict) --
Details about topics for the guardrail to identify and deny.
This data type is used in the following API operations:
name (string) --
The name of the topic to deny.
definition (string) --
A definition of the topic to deny.
examples (list) --
A list of prompts, each of which is an example of a prompt that can be categorized as belonging to the topic.
(string) --
type (string) --
Specifies to deny the topic.
inputAction (string) --
The action to take when harmful content is detected in the input. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
The action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Indicates whether guardrail evaluation is enabled on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Indicates whether guardrail evaluation is enabled on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
tier (dict) --
The tier that your guardrail uses for denied topic filters.
tierName (string) --
The tier that your guardrail uses for denied topic filters. Valid values include:
CLASSIC tier – Provides established guardrails functionality supporting English, French, and Spanish languages.
STANDARD tier – Provides a more robust solution than the CLASSIC tier and has more comprehensive language support. This tier requires that your guardrail use cross-Region inference.
contentPolicy (dict) --
The content policy that was configured for the guardrail.
filters (list) --
Contains the type of the content filter and how strongly it should apply to prompts and model responses.
(dict) --
Contains filter strengths for harmful content. Guardrails support the following content filters to detect and filter harmful user inputs and FM-generated outputs.
Hate – Describes language or a statement that discriminates, criticizes, insults, denounces, or dehumanizes a person or group on the basis of an identity (such as race, ethnicity, gender, religion, sexual orientation, ability, and national origin).
Insults – Describes language or a statement that includes demeaning, humiliating, mocking, insulting, or belittling language. This type of language is also labeled as bullying.
Sexual – Describes language or a statement that indicates sexual interest, activity, or arousal using direct or indirect references to body parts, physical traits, or sex.
Violence – Describes language or a statement that includes glorification of or threats to inflict physical pain, hurt, or injury toward a person, group or thing.
Content filtering depends on the confidence classification of user inputs and FM responses across each of the four harmful categories. All input and output statements are classified into one of four confidence levels (NONE, LOW, MEDIUM, HIGH) for each harmful category. For example, if a statement is classified as Hate with HIGH confidence, the likelihood of the statement representing hateful content is high. A single statement can be classified across multiple categories with varying confidence levels. For example, a single statement can be classified as Hate with HIGH confidence, Insults with LOW confidence, Sexual with NONE confidence, and Violence with MEDIUM confidence.
For more information, see Guardrails content filters.
This data type is used in the following API operations:
type (string) --
The harmful category that the content filter is applied to.
inputStrength (string) --
The strength of the content filter to apply to prompts. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.
outputStrength (string) --
The strength of the content filter to apply to model responses. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.
inputModalities (list) --
The input modalities selected for the guardrail content filter.
(string) --
outputModalities (list) --
The output modalities selected for the guardrail content filter.
(string) --
inputAction (string) --
The action to take when harmful content is detected in the input. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
The action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Indicates whether guardrail evaluation is enabled on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Indicates whether guardrail evaluation is enabled on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
tier (dict) --
The tier that your guardrail uses for content filters.
tierName (string) --
The tier that your guardrail uses for content filters. Valid values include:
CLASSIC tier – Provides established guardrails functionality supporting English, French, and Spanish languages.
STANDARD tier – Provides a more robust solution than the CLASSIC tier and has more comprehensive language support. This tier requires that your guardrail use cross-Region inference.
wordPolicy (dict) --
The word policy that was configured for the guardrail.
words (list) --
A list of words configured for the guardrail.
(dict) --
A word configured for the guardrail.
text (string) --
Text of the word configured for the guardrail to block.
inputAction (string) --
The action to take when harmful content is detected in the input. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
The action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Indicates whether guardrail evaluation is enabled on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Indicates whether guardrail evaluation is enabled on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
managedWordLists (list) --
A list of managed words configured for the guardrail.
(dict) --
The managed word list that was configured for the guardrail. (This is a list of words that are pre-defined and managed by guardrails only.)
type (string) --
ManagedWords$type The managed word type that was configured for the guardrail. (For now, we only offer profanity word list)
inputAction (string) --
The action to take when harmful content is detected in the input. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
The action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Indicates whether guardrail evaluation is enabled on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Indicates whether guardrail evaluation is enabled on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
sensitiveInformationPolicy (dict) --
The sensitive information policy that was configured for the guardrail.
piiEntities (list) --
The list of PII entities configured for the guardrail.
(dict) --
The PII entity configured for the guardrail.
type (string) --
The type of PII entity. For example, Social Security Number.
action (string) --
The configured guardrail action when PII entity is detected.
inputAction (string) --
The action to take when harmful content is detected in the input. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
ANONYMIZE – Mask the content and replace it with identifier tags.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
The action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
ANONYMIZE – Mask the content and replace it with identifier tags.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Indicates whether guardrail evaluation is enabled on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Indicates whether guardrail evaluation is enabled on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
regexes (list) --
The list of regular expressions configured for the guardrail.
(dict) --
The regular expression configured for the guardrail.
name (string) --
The name of the regular expression for the guardrail.
description (string) --
The description of the regular expression for the guardrail.
pattern (string) --
The pattern of the regular expression configured for the guardrail.
action (string) --
The action taken when a match to the regular expression is detected.
inputAction (string) --
The action to take when harmful content is detected in the input. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
The action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Indicates whether guardrail evaluation is enabled on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Indicates whether guardrail evaluation is enabled on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
contextualGroundingPolicy (dict) --
The contextual grounding policy used in the guardrail.
filters (list) --
The filter details for the guardrails contextual grounding policy.
(dict) --
The details for the guardrails contextual grounding filter.
type (string) --
The filter type details for the guardrails contextual grounding filter.
threshold (float) --
The threshold details for the guardrails contextual grounding filter.
action (string) --
The action to take when content fails the contextual grounding evaluation. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
enabled (boolean) --
Indicates whether contextual grounding is enabled for evaluation. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
automatedReasoningPolicy (dict) --
The current Automated Reasoning policy configuration for the guardrail, if any is configured.
policies (list) --
The list of Automated Reasoning policy ARNs that should be applied as part of this guardrail configuration.
(string) --
confidenceThreshold (float) --
The minimum confidence level required for Automated Reasoning policy violations to trigger guardrail actions. Values range from 0.0 to 1.0.
crossRegionDetails (dict) --
Details about the system-defined guardrail profile that you're using with your guardrail, including the guardrail profile ID and Amazon Resource Name (ARN).
guardrailProfileId (string) --
The ID of the guardrail profile that your guardrail is using. Profile availability depends on your current Amazon Web Services Region. For more information, see the Amazon Bedrock User Guide.
guardrailProfileArn (string) --
The Amazon Resource Name (ARN) of the guardrail profile that you're using with your guardrail.
createdAt (datetime) --
The date and time at which the guardrail was created.
updatedAt (datetime) --
The date and time at which the guardrail was updated.
statusReasons (list) --
Appears if the status is FAILED. A list of reasons for why the guardrail failed to be created, updated, versioned, or deleted.
(string) --
failureRecommendations (list) --
Appears if the status of the guardrail is FAILED. A list of recommendations to carry out before retrying the request.
(string) --
blockedInputMessaging (string) --
The message that the guardrail returns when it blocks a prompt.
blockedOutputsMessaging (string) --
The message that the guardrail returns when it blocks a model response.
kmsKeyArn (string) --
The ARN of the KMS key that encrypts the guardrail.
{'automatedReasoningPolicyConfig': {'confidenceThreshold': 'double', 'policies': ['string']}}
Updates a guardrail with the values you specify.
Specify a name and optional description.
Specify messages for when the guardrail successfully blocks a prompt or a model response in the blockedInputMessaging and blockedOutputsMessaging fields.
Specify topics for the guardrail to deny in the topicPolicyConfig object. Each GuardrailTopicConfig object in the topicsConfig list pertains to one topic.
Give a name and description so that the guardrail can properly identify the topic.
Specify DENY in the type field.
(Optional) Provide up to five prompts that you would categorize as belonging to the topic in the examples list.
Specify filter strengths for the harmful categories defined in Amazon Bedrock in the contentPolicyConfig object. Each GuardrailContentFilterConfig object in the filtersConfig list pertains to a harmful category. For more information, see Content filters. For more information about the fields in a content filter, see GuardrailContentFilterConfig.
Specify the category in the type field.
Specify the strength of the filter for prompts in the inputStrength field and for model responses in the strength field of the GuardrailContentFilterConfig.
(Optional) For security, include the ARN of a KMS key in the kmsKeyId field.
See also: AWS API Documentation
Request Syntax
client.update_guardrail( guardrailIdentifier='string', name='string', description='string', topicPolicyConfig={ 'topicsConfig': [ { 'name': 'string', 'definition': 'string', 'examples': [ 'string', ], 'type': 'DENY', 'inputAction': 'BLOCK'|'NONE', 'outputAction': 'BLOCK'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ], 'tierConfig': { 'tierName': 'CLASSIC'|'STANDARD' } }, contentPolicyConfig={ 'filtersConfig': [ { 'type': 'SEXUAL'|'VIOLENCE'|'HATE'|'INSULTS'|'MISCONDUCT'|'PROMPT_ATTACK', 'inputStrength': 'NONE'|'LOW'|'MEDIUM'|'HIGH', 'outputStrength': 'NONE'|'LOW'|'MEDIUM'|'HIGH', 'inputModalities': [ 'TEXT'|'IMAGE', ], 'outputModalities': [ 'TEXT'|'IMAGE', ], 'inputAction': 'BLOCK'|'NONE', 'outputAction': 'BLOCK'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ], 'tierConfig': { 'tierName': 'CLASSIC'|'STANDARD' } }, wordPolicyConfig={ 'wordsConfig': [ { 'text': 'string', 'inputAction': 'BLOCK'|'NONE', 'outputAction': 'BLOCK'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ], 'managedWordListsConfig': [ { 'type': 'PROFANITY', 'inputAction': 'BLOCK'|'NONE', 'outputAction': 'BLOCK'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ] }, sensitiveInformationPolicyConfig={ 'piiEntitiesConfig': [ { 'type': 'ADDRESS'|'AGE'|'AWS_ACCESS_KEY'|'AWS_SECRET_KEY'|'CA_HEALTH_NUMBER'|'CA_SOCIAL_INSURANCE_NUMBER'|'CREDIT_DEBIT_CARD_CVV'|'CREDIT_DEBIT_CARD_EXPIRY'|'CREDIT_DEBIT_CARD_NUMBER'|'DRIVER_ID'|'EMAIL'|'INTERNATIONAL_BANK_ACCOUNT_NUMBER'|'IP_ADDRESS'|'LICENSE_PLATE'|'MAC_ADDRESS'|'NAME'|'PASSWORD'|'PHONE'|'PIN'|'SWIFT_CODE'|'UK_NATIONAL_HEALTH_SERVICE_NUMBER'|'UK_NATIONAL_INSURANCE_NUMBER'|'UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER'|'URL'|'USERNAME'|'US_BANK_ACCOUNT_NUMBER'|'US_BANK_ROUTING_NUMBER'|'US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER'|'US_PASSPORT_NUMBER'|'US_SOCIAL_SECURITY_NUMBER'|'VEHICLE_IDENTIFICATION_NUMBER', 'action': 'BLOCK'|'ANONYMIZE'|'NONE', 'inputAction': 'BLOCK'|'ANONYMIZE'|'NONE', 'outputAction': 'BLOCK'|'ANONYMIZE'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ], 'regexesConfig': [ { 'name': 'string', 'description': 'string', 'pattern': 'string', 'action': 'BLOCK'|'ANONYMIZE'|'NONE', 'inputAction': 'BLOCK'|'ANONYMIZE'|'NONE', 'outputAction': 'BLOCK'|'ANONYMIZE'|'NONE', 'inputEnabled': True|False, 'outputEnabled': True|False }, ] }, contextualGroundingPolicyConfig={ 'filtersConfig': [ { 'type': 'GROUNDING'|'RELEVANCE', 'threshold': 123.0, 'action': 'BLOCK'|'NONE', 'enabled': True|False }, ] }, automatedReasoningPolicyConfig={ 'policies': [ 'string', ], 'confidenceThreshold': 123.0 }, crossRegionConfig={ 'guardrailProfileIdentifier': 'string' }, blockedInputMessaging='string', blockedOutputsMessaging='string', kmsKeyId='string' )
string
[REQUIRED]
The unique identifier of the guardrail. This can be an ID or the ARN.
string
[REQUIRED]
A name for the guardrail.
string
A description of the guardrail.
dict
The topic policy to configure for the guardrail.
topicsConfig (list) -- [REQUIRED]
A list of policies related to topics that the guardrail should deny.
(dict) --
Details about topics for the guardrail to identify and deny.
name (string) -- [REQUIRED]
The name of the topic to deny.
definition (string) -- [REQUIRED]
A definition of the topic to deny.
examples (list) --
A list of prompts, each of which is an example of a prompt that can be categorized as belonging to the topic.
(string) --
type (string) -- [REQUIRED]
Specifies to deny the topic.
inputAction (string) --
Specifies the action to take when harmful content is detected in the input. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
Specifies the action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
tierConfig (dict) --
The tier that your guardrail uses for denied topic filters.
tierName (string) -- [REQUIRED]
The tier that your guardrail uses for denied topic filters. Valid values include:
CLASSIC tier – Provides established guardrails functionality supporting English, French, and Spanish languages.
STANDARD tier – Provides a more robust solution than the CLASSIC tier and has more comprehensive language support. This tier requires that your guardrail use cross-Region inference.
dict
The content policy to configure for the guardrail.
filtersConfig (list) -- [REQUIRED]
Contains the type of the content filter and how strongly it should apply to prompts and model responses.
(dict) --
Contains filter strengths for harmful content. Guardrails support the following content filters to detect and filter harmful user inputs and FM-generated outputs.
Hate – Describes language or a statement that discriminates, criticizes, insults, denounces, or dehumanizes a person or group on the basis of an identity (such as race, ethnicity, gender, religion, sexual orientation, ability, and national origin).
Insults – Describes language or a statement that includes demeaning, humiliating, mocking, insulting, or belittling language. This type of language is also labeled as bullying.
Sexual – Describes language or a statement that indicates sexual interest, activity, or arousal using direct or indirect references to body parts, physical traits, or sex.
Violence – Describes language or a statement that includes glorification of or threats to inflict physical pain, hurt, or injury toward a person, group or thing.
Content filtering depends on the confidence classification of user inputs and FM responses across each of the four harmful categories. All input and output statements are classified into one of four confidence levels (NONE, LOW, MEDIUM, HIGH) for each harmful category. For example, if a statement is classified as Hate with HIGH confidence, the likelihood of the statement representing hateful content is high. A single statement can be classified across multiple categories with varying confidence levels. For example, a single statement can be classified as Hate with HIGH confidence, Insults with LOW confidence, Sexual with NONE confidence, and Violence with MEDIUM confidence.
For more information, see Guardrails content filters.
type (string) -- [REQUIRED]
The harmful category that the content filter is applied to.
inputStrength (string) -- [REQUIRED]
The strength of the content filter to apply to prompts. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.
outputStrength (string) -- [REQUIRED]
The strength of the content filter to apply to model responses. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.
inputModalities (list) --
The input modalities selected for the guardrail content filter configuration.
(string) --
outputModalities (list) --
The output modalities selected for the guardrail content filter configuration.
(string) --
inputAction (string) --
Specifies the action to take when harmful content is detected. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
Specifies the action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
tierConfig (dict) --
The tier that your guardrail uses for content filters.
tierName (string) -- [REQUIRED]
The tier that your guardrail uses for content filters. Valid values include:
CLASSIC tier – Provides established guardrails functionality supporting English, French, and Spanish languages.
STANDARD tier – Provides a more robust solution than the CLASSIC tier and has more comprehensive language support. This tier requires that your guardrail use cross-Region inference.
dict
The word policy to configure for the guardrail.
wordsConfig (list) --
A list of words to configure for the guardrail.
(dict) --
A word to configure for the guardrail.
text (string) -- [REQUIRED]
Text of the word configured for the guardrail to block.
inputAction (string) --
Specifies the action to take when harmful content is detected in the input. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
Specifies the action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the intput. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
managedWordListsConfig (list) --
A list of managed words to configure for the guardrail.
(dict) --
The managed word list to configure for the guardrail.
type (string) -- [REQUIRED]
The managed word type to configure for the guardrail.
inputAction (string) --
Specifies the action to take when harmful content is detected in the input. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
Specifies the action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
dict
The sensitive information policy to configure for the guardrail.
piiEntitiesConfig (list) --
A list of PII entities to configure to the guardrail.
(dict) --
The PII entity to configure for the guardrail.
type (string) -- [REQUIRED]
Configure guardrail type when the PII entity is detected.
The following PIIs are used to block or mask sensitive information:
General
ADDRESS A physical address, such as "100 Main Street, Anytown, USA" or "Suite #12, Building 123". An address can include information such as the street, building, location, city, state, country, county, zip code, precinct, and neighborhood.
AGE An individual's age, including the quantity and unit of time. For example, in the phrase "I am 40 years old," Guardrails recognizes "40 years" as an age.
NAME An individual's name. This entity type does not include titles, such as Dr., Mr., Mrs., or Miss. guardrails doesn't apply this entity type to names that are part of organizations or addresses. For example, guardrails recognizes the "John Doe Organization" as an organization, and it recognizes "Jane Doe Street" as an address.
EMAIL An email address, such as marymajor@email.com.
PHONE A phone number. This entity type also includes fax and pager numbers.
USERNAME A user name that identifies an account, such as a login name, screen name, nick name, or handle.
PASSWORD An alphanumeric string that is used as a password, such as "very20special#pass".
DRIVER_ID The number assigned to a driver's license, which is an official document permitting an individual to operate one or more motorized vehicles on a public road. A driver's license number consists of alphanumeric characters.
LICENSE_PLATE A license plate for a vehicle is issued by the state or country where the vehicle is registered. The format for passenger vehicles is typically five to eight digits, consisting of upper-case letters and numbers. The format varies depending on the location of the issuing state or country.
VEHICLE_IDENTIFICATION_NUMBER A Vehicle Identification Number (VIN) uniquely identifies a vehicle. VIN content and format are defined in the ISO 3779 specification. Each country has specific codes and formats for VINs.
Finance
CREDIT_DEBIT_CARD_CVV A three-digit card verification code (CVV) that is present on VISA, MasterCard, and Discover credit and debit cards. For American Express credit or debit cards, the CVV is a four-digit numeric code.
CREDIT_DEBIT_CARD_EXPIRY The expiration date for a credit or debit card. This number is usually four digits long and is often formatted as month/year or MM/YY. Guardrails recognizes expiration dates such as 01/21, 01/2021, and Jan 2021.
CREDIT_DEBIT_CARD_NUMBER The number for a credit or debit card. These numbers can vary from 13 to 16 digits in length. However, Amazon Comprehend also recognizes credit or debit card numbers when only the last four digits are present.
PIN A four-digit personal identification number (PIN) with which you can access your bank account.
INTERNATIONAL_BANK_ACCOUNT_NUMBER An International Bank Account Number has specific formats in each country. For more information, see www.iban.com/structure.
SWIFT_CODE A SWIFT code is a standard format of Bank Identifier Code (BIC) used to specify a particular bank or branch. Banks use these codes for money transfers such as international wire transfers. SWIFT codes consist of eight or 11 characters. The 11-digit codes refer to specific branches, while eight-digit codes (or 11-digit codes ending in 'XXX') refer to the head or primary office.
IT
IP_ADDRESS An IPv4 address, such as 198.51.100.0.
MAC_ADDRESS A media access control (MAC) address is a unique identifier assigned to a network interface controller (NIC).
URL A web address, such as www.example.com.
AWS_ACCESS_KEY A unique identifier that's associated with a secret access key; you use the access key ID and secret access key to sign programmatic Amazon Web Services requests cryptographically.
AWS_SECRET_KEY A unique identifier that's associated with an access key. You use the access key ID and secret access key to sign programmatic Amazon Web Services requests cryptographically.
USA specific
US_BANK_ACCOUNT_NUMBER A US bank account number, which is typically 10 to 12 digits long.
US_BANK_ROUTING_NUMBER A US bank account routing number. These are typically nine digits long,
US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER A US Individual Taxpayer Identification Number (ITIN) is a nine-digit number that starts with a "9" and contain a "7" or "8" as the fourth digit. An ITIN can be formatted with a space or a dash after the third and forth digits.
US_PASSPORT_NUMBER A US passport number. Passport numbers range from six to nine alphanumeric characters.
US_SOCIAL_SECURITY_NUMBER A US Social Security Number (SSN) is a nine-digit number that is issued to US citizens, permanent residents, and temporary working residents.
Canada specific
CA_HEALTH_NUMBER A Canadian Health Service Number is a 10-digit unique identifier, required for individuals to access healthcare benefits.
CA_SOCIAL_INSURANCE_NUMBER A Canadian Social Insurance Number (SIN) is a nine-digit unique identifier, required for individuals to access government programs and benefits. The SIN is formatted as three groups of three digits, such as 123-456-789. A SIN can be validated through a simple check-digit process called the Luhn algorithm.
UK Specific
UK_NATIONAL_HEALTH_SERVICE_NUMBER A UK National Health Service Number is a 10-17 digit number, such as 485 777 3456. The current system formats the 10-digit number with spaces after the third and sixth digits. The final digit is an error-detecting checksum.
UK_NATIONAL_INSURANCE_NUMBER A UK National Insurance Number (NINO) provides individuals with access to National Insurance (social security) benefits. It is also used for some purposes in the UK tax system. The number is nine digits long and starts with two letters, followed by six numbers and one letter. A NINO can be formatted with a space or a dash after the two letters and after the second, forth, and sixth digits.
UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER A UK Unique Taxpayer Reference (UTR) is a 10-digit number that identifies a taxpayer or a business.
Custom
Regex filter - You can use a regular expressions to define patterns for a guardrail to recognize and act upon such as serial number, booking ID etc..
action (string) -- [REQUIRED]
Configure guardrail action when the PII entity is detected.
inputAction (string) --
Specifies the action to take when harmful content is detected in the input. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
ANONYMIZE – Mask the content and replace it with identifier tags.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
Specifies the action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
ANONYMIZE – Mask the content and replace it with identifier tags.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
regexesConfig (list) --
A list of regular expressions to configure to the guardrail.
(dict) --
The regular expression to configure for the guardrail.
name (string) -- [REQUIRED]
The name of the regular expression to configure for the guardrail.
description (string) --
The description of the regular expression to configure for the guardrail.
pattern (string) -- [REQUIRED]
The regular expression pattern to configure for the guardrail.
action (string) -- [REQUIRED]
The guardrail action to configure when matching regular expression is detected.
inputAction (string) --
Specifies the action to take when harmful content is detected in the input. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
outputAction (string) --
Specifies the action to take when harmful content is detected in the output. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
inputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
outputEnabled (boolean) --
Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
dict
The contextual grounding policy configuration used to update a guardrail.
filtersConfig (list) -- [REQUIRED]
The filter configuration details for the guardrails contextual grounding policy.
(dict) --
The filter configuration details for the guardrails contextual grounding filter.
type (string) -- [REQUIRED]
The filter details for the guardrails contextual grounding filter.
threshold (float) -- [REQUIRED]
The threshold details for the guardrails contextual grounding filter.
action (string) --
Specifies the action to take when content fails the contextual grounding evaluation. Supported values include:
BLOCK – Block the content and replace it with blocked messaging.
NONE – Take no action but return detection information in the trace response.
enabled (boolean) --
Specifies whether to enable contextual grounding evaluation. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
dict
Updated configuration for Automated Reasoning policies associated with the guardrail.
policies (list) -- [REQUIRED]
The list of Automated Reasoning policy ARNs to include in the guardrail configuration.
(string) --
confidenceThreshold (float) --
The confidence threshold for triggering guardrail actions based on Automated Reasoning policy violations.
dict
The system-defined guardrail profile that you're using with your guardrail. Guardrail profiles define the destination Amazon Web Services Regions where guardrail inference requests can be automatically routed.
For more information, see the Amazon Bedrock User Guide.
guardrailProfileIdentifier (string) -- [REQUIRED]
The ID or Amazon Resource Name (ARN) of the guardrail profile that your guardrail is using. Guardrail profile availability depends on your current Amazon Web Services Region. For more information, see the Amazon Bedrock User Guide.
string
[REQUIRED]
The message to return when the guardrail blocks a prompt.
string
[REQUIRED]
The message to return when the guardrail blocks a model response.
string
The ARN of the KMS key with which to encrypt the guardrail.
dict
Response Syntax
{ 'guardrailId': 'string', 'guardrailArn': 'string', 'version': 'string', 'updatedAt': datetime(2015, 1, 1) }
Response Structure
(dict) --
guardrailId (string) --
The unique identifier of the guardrail
guardrailArn (string) --
The ARN of the guardrail.
version (string) --
The version of the guardrail.
updatedAt (datetime) --
The date and time at which the guardrail was updated.