Bedrock / Client / get_automated_reasoning_policy_test_result
get_automated_reasoning_policy_test_result¶
- Bedrock.Client.get_automated_reasoning_policy_test_result(**kwargs)¶
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
response = client.get_automated_reasoning_policy_test_result( policyArn='string', buildWorkflowId='string', testCaseId='string' )
- Parameters:
policyArn (string) –
[REQUIRED]
The Amazon Resource Name (ARN) of the Automated Reasoning policy.
buildWorkflowId (string) –
[REQUIRED]
The build workflow identifier. The build workflow must display a
COMPLETED
status to get results.testCaseId (string) –
[REQUIRED]
The unique identifier of the test for which to retrieve results.
- Return type:
dict
- Returns:
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) –
The test case that was executed, including the input content, expected results, and configuration parameters used during validation.
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.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set:
valid
,invalid
,satisfiable
,impossible
,translationAmbiguous
,tooComplex
,noTranslations
. If a client receives an unknown member it will setSDK_UNKNOWN_MEMBER
as the top level key, which maps to the name or tag of the unknown member. The structure ofSDK_UNKNOWN_MEMBER
is as follows:'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
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.
Exceptions