Skip to content

Commit d28e9cb

Browse files
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.
1 parent 9dc6e0b commit d28e9cb

File tree

289 files changed

+48190
-2978
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

289 files changed

+48190
-2978
lines changed

generator/ServiceModels/bedrock/bedrock-2023-04-20.api.json

Lines changed: 2472 additions & 117 deletions
Large diffs are not rendered by default.

generator/ServiceModels/bedrock/bedrock-2023-04-20.docs.json

Lines changed: 1358 additions & 1 deletion
Large diffs are not rendered by default.

generator/ServiceModels/bedrock/bedrock-2023-04-20.normal.json

Lines changed: 3475 additions & 148 deletions
Large diffs are not rendered by default.

generator/ServiceModels/bedrock/bedrock-2023-04-20.paginators.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
{
22
"pagination": {
3+
"ListAutomatedReasoningPolicies": {
4+
"input_token": "nextToken",
5+
"output_token": "nextToken",
6+
"limit_key": "maxResults",
7+
"result_key": "automatedReasoningPolicySummaries"
8+
},
9+
"ListAutomatedReasoningPolicyBuildWorkflows": {
10+
"input_token": "nextToken",
11+
"output_token": "nextToken",
12+
"limit_key": "maxResults",
13+
"result_key": "automatedReasoningPolicyBuildWorkflowSummaries"
14+
},
15+
"ListAutomatedReasoningPolicyTestCases": {
16+
"input_token": "nextToken",
17+
"output_token": "nextToken",
18+
"limit_key": "maxResults",
19+
"result_key": "testCases"
20+
},
21+
"ListAutomatedReasoningPolicyTestResults": {
22+
"input_token": "nextToken",
23+
"output_token": "nextToken",
24+
"limit_key": "maxResults",
25+
"result_key": "testResults"
26+
},
327
"ListCustomModelDeployments": {
428
"input_token": "nextToken",
529
"output_token": "nextToken",

sdk/code-analysis/ServiceAnalysis/Bedrock/Generated/PropertyValueRules.xml

Lines changed: 1046 additions & 11 deletions
Large diffs are not rendered by default.
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the bedrock-2023-04-20.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
#pragma warning disable CS0612,CS0618,CS1570
30+
namespace Amazon.Bedrock.Model
31+
{
32+
/// <summary>
33+
/// Represents the result of an Automated Reasoning validation check, indicating whether
34+
/// the content is logically valid, invalid, or falls into other categories based on the
35+
/// policy rules.
36+
/// </summary>
37+
public partial class AutomatedReasoningCheckFinding
38+
{
39+
private AutomatedReasoningCheckImpossibleFinding _impossible;
40+
private AutomatedReasoningCheckInvalidFinding _invalid;
41+
private AutomatedReasoningCheckNoTranslationsFinding _noTranslations;
42+
private AutomatedReasoningCheckSatisfiableFinding _satisfiable;
43+
private AutomatedReasoningCheckTooComplexFinding _tooComplex;
44+
private AutomatedReasoningCheckTranslationAmbiguousFinding _translationAmbiguous;
45+
private AutomatedReasoningCheckValidFinding _valid;
46+
47+
/// <summary>
48+
/// Gets and sets the property Impossible.
49+
/// <para>
50+
/// Indicates that Automated Reasoning cannot make a statement about the claims. This
51+
/// can happen if the premises are logically incorrect, or if there is a conflict within
52+
/// the Automated Reasoning policy itself.
53+
/// </para>
54+
/// </summary>
55+
public AutomatedReasoningCheckImpossibleFinding Impossible
56+
{
57+
get { return this._impossible; }
58+
set { this._impossible = value; }
59+
}
60+
61+
// Check to see if Impossible property is set
62+
internal bool IsSetImpossible()
63+
{
64+
return this._impossible != null;
65+
}
66+
67+
/// <summary>
68+
/// Gets and sets the property Invalid.
69+
/// <para>
70+
/// Indicates that the claims are false. The claims are not implied by the premises and
71+
/// Automated Reasoning policy. Furthermore, there exist different claims that are consistent
72+
/// with the premises and Automated Reasoning policy.
73+
/// </para>
74+
/// </summary>
75+
public AutomatedReasoningCheckInvalidFinding Invalid
76+
{
77+
get { return this._invalid; }
78+
set { this._invalid = value; }
79+
}
80+
81+
// Check to see if Invalid property is set
82+
internal bool IsSetInvalid()
83+
{
84+
return this._invalid != null;
85+
}
86+
87+
/// <summary>
88+
/// Gets and sets the property NoTranslations.
89+
/// <para>
90+
/// Identifies that some or all of the input prompt wasn't translated into logic. This
91+
/// can happen if the input isn't relevant to the Automated Reasoning policy, or if the
92+
/// policy doesn't have variables to model relevant input.
93+
/// </para>
94+
/// </summary>
95+
public AutomatedReasoningCheckNoTranslationsFinding NoTranslations
96+
{
97+
get { return this._noTranslations; }
98+
set { this._noTranslations = value; }
99+
}
100+
101+
// Check to see if NoTranslations property is set
102+
internal bool IsSetNoTranslations()
103+
{
104+
return this._noTranslations != null;
105+
}
106+
107+
/// <summary>
108+
/// Gets and sets the property Satisfiable.
109+
/// <para>
110+
/// Indicates that the claims can be true or false. It depends on what assumptions are
111+
/// made for the claim to be implied from the premises and Automated Reasoning policy
112+
/// rules. In this situation, different assumptions can make input claims false and alternative
113+
/// claims true.
114+
/// </para>
115+
/// </summary>
116+
public AutomatedReasoningCheckSatisfiableFinding Satisfiable
117+
{
118+
get { return this._satisfiable; }
119+
set { this._satisfiable = value; }
120+
}
121+
122+
// Check to see if Satisfiable property is set
123+
internal bool IsSetSatisfiable()
124+
{
125+
return this._satisfiable != null;
126+
}
127+
128+
/// <summary>
129+
/// Gets and sets the property TooComplex.
130+
/// <para>
131+
/// Indicates that the input contains too much information for Automated Reasoning to
132+
/// process within its latency limits.
133+
/// </para>
134+
/// </summary>
135+
public AutomatedReasoningCheckTooComplexFinding TooComplex
136+
{
137+
get { return this._tooComplex; }
138+
set { this._tooComplex = value; }
139+
}
140+
141+
// Check to see if TooComplex property is set
142+
internal bool IsSetTooComplex()
143+
{
144+
return this._tooComplex != null;
145+
}
146+
147+
/// <summary>
148+
/// Gets and sets the property TranslationAmbiguous.
149+
/// <para>
150+
/// Indicates that an ambiguity was detected in the translation, making it unsound to
151+
/// continue with validity checking. Additional context or follow-up questions might be
152+
/// needed to get translation to succeed.
153+
/// </para>
154+
/// </summary>
155+
public AutomatedReasoningCheckTranslationAmbiguousFinding TranslationAmbiguous
156+
{
157+
get { return this._translationAmbiguous; }
158+
set { this._translationAmbiguous = value; }
159+
}
160+
161+
// Check to see if TranslationAmbiguous property is set
162+
internal bool IsSetTranslationAmbiguous()
163+
{
164+
return this._translationAmbiguous != null;
165+
}
166+
167+
/// <summary>
168+
/// Gets and sets the property Valid.
169+
/// <para>
170+
/// Indicates that the claims are true. The claims are implied by the premises and the
171+
/// Automated Reasoning policy. Given the Automated Reasoning policy and premises, it
172+
/// is not possible for these claims to be false.
173+
/// </para>
174+
/// </summary>
175+
public AutomatedReasoningCheckValidFinding Valid
176+
{
177+
get { return this._valid; }
178+
set { this._valid = value; }
179+
}
180+
181+
// Check to see if Valid property is set
182+
internal bool IsSetValid()
183+
{
184+
return this._valid != null;
185+
}
186+
187+
}
188+
}
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the bedrock-2023-04-20.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
#pragma warning disable CS0612,CS0618,CS1570
30+
namespace Amazon.Bedrock.Model
31+
{
32+
/// <summary>
33+
/// Indicates that no valid claims can be made due to logical contradictions in the premises
34+
/// or rules.
35+
/// </summary>
36+
public partial class AutomatedReasoningCheckImpossibleFinding
37+
{
38+
private List<AutomatedReasoningCheckRule> _contradictingRules = AWSConfigs.InitializeCollections ? new List<AutomatedReasoningCheckRule>() : null;
39+
private AutomatedReasoningCheckLogicWarning _logicWarning;
40+
private AutomatedReasoningCheckTranslation _translation;
41+
42+
/// <summary>
43+
/// Gets and sets the property ContradictingRules.
44+
/// <para>
45+
/// The automated reasoning policy rules that contradict the claims and/or premises in
46+
/// the input.
47+
/// </para>
48+
/// </summary>
49+
public List<AutomatedReasoningCheckRule> ContradictingRules
50+
{
51+
get { return this._contradictingRules; }
52+
set { this._contradictingRules = value; }
53+
}
54+
55+
// Check to see if ContradictingRules property is set
56+
internal bool IsSetContradictingRules()
57+
{
58+
return this._contradictingRules != null && (this._contradictingRules.Count > 0 || !AWSConfigs.InitializeCollections);
59+
}
60+
61+
/// <summary>
62+
/// Gets and sets the property LogicWarning.
63+
/// <para>
64+
/// Indication of a logic issue with the translation without needing to consider the automated
65+
/// reasoning policy rules.
66+
/// </para>
67+
/// </summary>
68+
public AutomatedReasoningCheckLogicWarning LogicWarning
69+
{
70+
get { return this._logicWarning; }
71+
set { this._logicWarning = value; }
72+
}
73+
74+
// Check to see if LogicWarning property is set
75+
internal bool IsSetLogicWarning()
76+
{
77+
return this._logicWarning != null;
78+
}
79+
80+
/// <summary>
81+
/// Gets and sets the property Translation.
82+
/// <para>
83+
/// The logical translation of the input that this finding evaluates.
84+
/// </para>
85+
/// </summary>
86+
public AutomatedReasoningCheckTranslation Translation
87+
{
88+
get { return this._translation; }
89+
set { this._translation = value; }
90+
}
91+
92+
// Check to see if Translation property is set
93+
internal bool IsSetTranslation()
94+
{
95+
return this._translation != null;
96+
}
97+
98+
}
99+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the bedrock-2023-04-20.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
#pragma warning disable CS0612,CS0618,CS1570
30+
namespace Amazon.Bedrock.Model
31+
{
32+
/// <summary>
33+
/// References a portion of the original input text that corresponds to logical elements.
34+
/// </summary>
35+
public partial class AutomatedReasoningCheckInputTextReference
36+
{
37+
private string _text;
38+
39+
/// <summary>
40+
/// Gets and sets the property Text.
41+
/// <para>
42+
/// The specific text from the original input that this reference points to.
43+
/// </para>
44+
/// </summary>
45+
[AWSProperty(Sensitive=true, Min=0, Max=1000)]
46+
public string Text
47+
{
48+
get { return this._text; }
49+
set { this._text = value; }
50+
}
51+
52+
// Check to see if Text property is set
53+
internal bool IsSetText()
54+
{
55+
return this._text != null;
56+
}
57+
58+
}
59+
}

0 commit comments

Comments
 (0)