aws-sdk-bedrockruntime 1.80.0 → 1.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 763244b999635486db8fdbf419f5821213f4272feaab80bb3d04a2ebe2032bb3
4
- data.tar.gz: de3a4e784bb5303e4abe7b64bed087d60a6e669aa47737ee7d9350cb6a8800d5
3
+ metadata.gz: 74d887866a2775310febb949d5664ad9c624582938ce8b81118eba0c6809ff4a
4
+ data.tar.gz: e49be363782fb93964ebfebd19a4299e802154216ed88fc30460eecb925d17bf
5
5
  SHA512:
6
- metadata.gz: e2e1859baaa0a2f1dd284da72f8def4f4d8d148e5d8ac4e3f043e20899ae288a591f1f86e2afcf60f268900beb894600d35fa4c1e246fb132c4e7ee89f170aa4
7
- data.tar.gz: 3993dbe642ca75d5faa34a3ff886167d25267ce25350590f689d82af96df9b9790df2dd54ea8ecfb1436e18c344879e4fa869d03d2c17c6f027ad8c148e280c7
6
+ metadata.gz: 8eed8a1a38571674d0f35a9a97f0745bc8a677370446467d0838379c98fac905468897ff095a278125c5dda69eacced12723c9d2b85c86dadf3ce6a0b1cd98ef
7
+ data.tar.gz: 9b589df40d8fb1191cb31e321785d9be29dd270bb2ccfc419c1c9da55eac071b9a1bbc4bb4ed9180086f5fb9917d97abe9897e533e78d96088a26ae63d90e9e9
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.81.0 (2026-06-15)
5
+ ------------------
6
+
7
+ * Feature - InvokeGuardrailChecks API evaluates prompts and responses against safety checks (content filters, prompt attacks, sensitive info) without creating guardrail resources. It's a detect-only API, returning numeric scores so you can build adaptive logic as per your application.
8
+
4
9
  1.80.0 (2026-05-28)
5
10
  ------------------
6
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.80.0
1
+ 1.81.0
@@ -619,7 +619,7 @@ module Aws::BedrockRuntime
619
619
  tracer: tracer
620
620
  )
621
621
  context[:gem_name] = 'aws-sdk-bedrockruntime'
622
- context[:gem_version] = '1.80.0'
622
+ context[:gem_version] = '1.81.0'
623
623
  Seahorse::Client::Request.new(handlers, context)
624
624
  end
625
625
 
@@ -3260,6 +3260,90 @@ module Aws::BedrockRuntime
3260
3260
  req.send_request(options)
3261
3261
  end
3262
3262
 
3263
+ # Evaluates messages against inline guardrail checks. You specify the
3264
+ # check configurations directly in the request, and Amazon Bedrock
3265
+ # returns per-check results with severity or confidence scores.
3266
+ #
3267
+ # @option params [required, Array<Types::GuardrailChecksMessage>] :messages
3268
+ # The messages to evaluate against the specified guardrail checks. Each
3269
+ # message includes a role and one or more content blocks.
3270
+ #
3271
+ # @option params [required, Types::GuardrailChecksConfig] :checks
3272
+ # The inline check configurations that specify which guardrail checks to
3273
+ # run against the messages.
3274
+ #
3275
+ # @return [Types::InvokeGuardrailChecksResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
3276
+ #
3277
+ # * {Types::InvokeGuardrailChecksResponse#results #results} => Types::GuardrailChecksResults
3278
+ # * {Types::InvokeGuardrailChecksResponse#usage #usage} => Types::GuardrailChecksUsageResults
3279
+ #
3280
+ # @example Request syntax with placeholder values
3281
+ #
3282
+ # resp = client.invoke_guardrail_checks({
3283
+ # messages: [ # required
3284
+ # {
3285
+ # role: "user", # required, accepts user, assistant, system
3286
+ # content: [ # required
3287
+ # {
3288
+ # text: "GuardrailChecksTextContent",
3289
+ # },
3290
+ # ],
3291
+ # },
3292
+ # ],
3293
+ # checks: { # required
3294
+ # content_filter: {
3295
+ # categories: [ # required
3296
+ # {
3297
+ # category: "VIOLENCE", # required, accepts VIOLENCE, HATE, SEXUAL, MISCONDUCT, INSULTS
3298
+ # },
3299
+ # ],
3300
+ # },
3301
+ # prompt_attack: {
3302
+ # categories: [ # required
3303
+ # {
3304
+ # category: "JAILBREAK", # required, accepts JAILBREAK, PROMPT_INJECTION, PROMPT_LEAKAGE
3305
+ # },
3306
+ # ],
3307
+ # },
3308
+ # sensitive_information: {
3309
+ # entities: [ # required
3310
+ # {
3311
+ # type: "ADDRESS", # required, accepts 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
3312
+ # },
3313
+ # ],
3314
+ # },
3315
+ # },
3316
+ # })
3317
+ #
3318
+ # @example Response structure
3319
+ #
3320
+ # resp.results.content_filter.results #=> Array
3321
+ # resp.results.content_filter.results[0].category #=> String, one of "VIOLENCE", "HATE", "SEXUAL", "MISCONDUCT", "INSULTS"
3322
+ # resp.results.content_filter.results[0].severity_score #=> Float
3323
+ # resp.results.prompt_attack.results #=> Array
3324
+ # resp.results.prompt_attack.results[0].category #=> String, one of "JAILBREAK", "PROMPT_INJECTION", "PROMPT_LEAKAGE"
3325
+ # resp.results.prompt_attack.results[0].severity_score #=> Float
3326
+ # resp.results.sensitive_information.results #=> Array
3327
+ # resp.results.sensitive_information.results[0].type #=> String, one of "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"
3328
+ # resp.results.sensitive_information.results[0].confidence_score #=> Float
3329
+ # resp.results.sensitive_information.results[0].begin_offset #=> Integer
3330
+ # resp.results.sensitive_information.results[0].end_offset #=> Integer
3331
+ # resp.results.sensitive_information.results[0].message_index #=> Integer
3332
+ # resp.results.sensitive_information.results[0].content_index #=> Integer
3333
+ # resp.results.sensitive_information.truncated #=> Boolean
3334
+ # resp.usage.content_filter.text_units #=> Integer
3335
+ # resp.usage.prompt_attack.text_units #=> Integer
3336
+ # resp.usage.sensitive_information.text_units #=> Integer
3337
+ #
3338
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeGuardrailChecks AWS API Documentation
3339
+ #
3340
+ # @overload invoke_guardrail_checks(params = {})
3341
+ # @param [Hash] params ({})
3342
+ def invoke_guardrail_checks(params = {}, options = {})
3343
+ req = build_request(:invoke_guardrail_checks, params)
3344
+ req.send_request(options)
3345
+ end
3346
+
3263
3347
  # Invokes the specified Amazon Bedrock model to run inference using the
3264
3348
  # prompt and inference parameters provided in the request body. You use
3265
3349
  # model inference to generate text, images, and embeddings.
@@ -3932,7 +4016,7 @@ module Aws::BedrockRuntime
3932
4016
  tracer: tracer
3933
4017
  )
3934
4018
  context[:gem_name] = 'aws-sdk-bedrockruntime'
3935
- context[:gem_version] = '1.80.0'
4019
+ context[:gem_version] = '1.81.0'
3936
4020
  Seahorse::Client::Request.new(handlers, context)
3937
4021
  end
3938
4022
 
@@ -147,6 +147,46 @@ module Aws::BedrockRuntime
147
147
  GuardrailAutomatedReasoningTranslationOption = Shapes::StructureShape.new(name: 'GuardrailAutomatedReasoningTranslationOption')
148
148
  GuardrailAutomatedReasoningTranslationOptionList = Shapes::ListShape.new(name: 'GuardrailAutomatedReasoningTranslationOptionList')
149
149
  GuardrailAutomatedReasoningValidFinding = Shapes::StructureShape.new(name: 'GuardrailAutomatedReasoningValidFinding')
150
+ GuardrailChecksConfig = Shapes::StructureShape.new(name: 'GuardrailChecksConfig')
151
+ GuardrailChecksContentBlock = Shapes::UnionShape.new(name: 'GuardrailChecksContentBlock')
152
+ GuardrailChecksContentBlockList = Shapes::ListShape.new(name: 'GuardrailChecksContentBlockList')
153
+ GuardrailChecksContentFilterCategory = Shapes::StringShape.new(name: 'GuardrailChecksContentFilterCategory')
154
+ GuardrailChecksContentFilterCategoryConfig = Shapes::StructureShape.new(name: 'GuardrailChecksContentFilterCategoryConfig')
155
+ GuardrailChecksContentFilterCategoryConfigList = Shapes::ListShape.new(name: 'GuardrailChecksContentFilterCategoryConfigList')
156
+ GuardrailChecksContentFilterConfig = Shapes::StructureShape.new(name: 'GuardrailChecksContentFilterConfig')
157
+ GuardrailChecksContentFilterResult = Shapes::StructureShape.new(name: 'GuardrailChecksContentFilterResult')
158
+ GuardrailChecksContentFilterResultEntry = Shapes::StructureShape.new(name: 'GuardrailChecksContentFilterResultEntry')
159
+ GuardrailChecksContentFilterResultEntrySeverityScoreDouble = Shapes::FloatShape.new(name: 'GuardrailChecksContentFilterResultEntrySeverityScoreDouble')
160
+ GuardrailChecksContentFilterResultList = Shapes::ListShape.new(name: 'GuardrailChecksContentFilterResultList')
161
+ GuardrailChecksContentFilterUsage = Shapes::StructureShape.new(name: 'GuardrailChecksContentFilterUsage')
162
+ GuardrailChecksMessage = Shapes::StructureShape.new(name: 'GuardrailChecksMessage')
163
+ GuardrailChecksMessageList = Shapes::ListShape.new(name: 'GuardrailChecksMessageList')
164
+ GuardrailChecksPromptAttackCategory = Shapes::StringShape.new(name: 'GuardrailChecksPromptAttackCategory')
165
+ GuardrailChecksPromptAttackCategoryConfig = Shapes::StructureShape.new(name: 'GuardrailChecksPromptAttackCategoryConfig')
166
+ GuardrailChecksPromptAttackCategoryConfigList = Shapes::ListShape.new(name: 'GuardrailChecksPromptAttackCategoryConfigList')
167
+ GuardrailChecksPromptAttackConfig = Shapes::StructureShape.new(name: 'GuardrailChecksPromptAttackConfig')
168
+ GuardrailChecksPromptAttackResult = Shapes::StructureShape.new(name: 'GuardrailChecksPromptAttackResult')
169
+ GuardrailChecksPromptAttackResultEntry = Shapes::StructureShape.new(name: 'GuardrailChecksPromptAttackResultEntry')
170
+ GuardrailChecksPromptAttackResultEntrySeverityScoreDouble = Shapes::FloatShape.new(name: 'GuardrailChecksPromptAttackResultEntrySeverityScoreDouble')
171
+ GuardrailChecksPromptAttackResultList = Shapes::ListShape.new(name: 'GuardrailChecksPromptAttackResultList')
172
+ GuardrailChecksPromptAttackUsage = Shapes::StructureShape.new(name: 'GuardrailChecksPromptAttackUsage')
173
+ GuardrailChecksResults = Shapes::StructureShape.new(name: 'GuardrailChecksResults')
174
+ GuardrailChecksRole = Shapes::StringShape.new(name: 'GuardrailChecksRole')
175
+ GuardrailChecksSensitiveInformationConfig = Shapes::StructureShape.new(name: 'GuardrailChecksSensitiveInformationConfig')
176
+ GuardrailChecksSensitiveInformationEntityConfig = Shapes::StructureShape.new(name: 'GuardrailChecksSensitiveInformationEntityConfig')
177
+ GuardrailChecksSensitiveInformationEntityConfigList = Shapes::ListShape.new(name: 'GuardrailChecksSensitiveInformationEntityConfigList')
178
+ GuardrailChecksSensitiveInformationEntityType = Shapes::StringShape.new(name: 'GuardrailChecksSensitiveInformationEntityType')
179
+ GuardrailChecksSensitiveInformationResult = Shapes::StructureShape.new(name: 'GuardrailChecksSensitiveInformationResult')
180
+ GuardrailChecksSensitiveInformationResultEntry = Shapes::StructureShape.new(name: 'GuardrailChecksSensitiveInformationResultEntry')
181
+ GuardrailChecksSensitiveInformationResultEntryBeginOffsetInteger = Shapes::IntegerShape.new(name: 'GuardrailChecksSensitiveInformationResultEntryBeginOffsetInteger')
182
+ GuardrailChecksSensitiveInformationResultEntryConfidenceScoreDouble = Shapes::FloatShape.new(name: 'GuardrailChecksSensitiveInformationResultEntryConfidenceScoreDouble')
183
+ GuardrailChecksSensitiveInformationResultEntryContentIndexInteger = Shapes::IntegerShape.new(name: 'GuardrailChecksSensitiveInformationResultEntryContentIndexInteger')
184
+ GuardrailChecksSensitiveInformationResultEntryEndOffsetInteger = Shapes::IntegerShape.new(name: 'GuardrailChecksSensitiveInformationResultEntryEndOffsetInteger')
185
+ GuardrailChecksSensitiveInformationResultEntryMessageIndexInteger = Shapes::IntegerShape.new(name: 'GuardrailChecksSensitiveInformationResultEntryMessageIndexInteger')
186
+ GuardrailChecksSensitiveInformationResultList = Shapes::ListShape.new(name: 'GuardrailChecksSensitiveInformationResultList')
187
+ GuardrailChecksSensitiveInformationUsage = Shapes::StructureShape.new(name: 'GuardrailChecksSensitiveInformationUsage')
188
+ GuardrailChecksTextContent = Shapes::StringShape.new(name: 'GuardrailChecksTextContent')
189
+ GuardrailChecksUsageResults = Shapes::StructureShape.new(name: 'GuardrailChecksUsageResults')
150
190
  GuardrailConfiguration = Shapes::StructureShape.new(name: 'GuardrailConfiguration')
151
191
  GuardrailContentBlock = Shapes::UnionShape.new(name: 'GuardrailContentBlock')
152
192
  GuardrailContentBlockList = Shapes::ListShape.new(name: 'GuardrailContentBlockList')
@@ -242,6 +282,8 @@ module Aws::BedrockRuntime
242
282
  Integer = Shapes::IntegerShape.new(name: 'Integer')
243
283
  InternalServerException = Shapes::StructureShape.new(name: 'InternalServerException')
244
284
  InvocationArn = Shapes::StringShape.new(name: 'InvocationArn')
285
+ InvokeGuardrailChecksRequest = Shapes::StructureShape.new(name: 'InvokeGuardrailChecksRequest')
286
+ InvokeGuardrailChecksResponse = Shapes::StructureShape.new(name: 'InvokeGuardrailChecksResponse')
245
287
  InvokeModelIdentifier = Shapes::StringShape.new(name: 'InvokeModelIdentifier')
246
288
  InvokeModelRequest = Shapes::StructureShape.new(name: 'InvokeModelRequest')
247
289
  InvokeModelResponse = Shapes::StructureShape.new(name: 'InvokeModelResponse')
@@ -848,6 +890,100 @@ module Aws::BedrockRuntime
848
890
  GuardrailAutomatedReasoningValidFinding.add_member(:logic_warning, Shapes::ShapeRef.new(shape: GuardrailAutomatedReasoningLogicWarning, location_name: "logicWarning"))
849
891
  GuardrailAutomatedReasoningValidFinding.struct_class = Types::GuardrailAutomatedReasoningValidFinding
850
892
 
893
+ GuardrailChecksConfig.add_member(:content_filter, Shapes::ShapeRef.new(shape: GuardrailChecksContentFilterConfig, location_name: "contentFilter"))
894
+ GuardrailChecksConfig.add_member(:prompt_attack, Shapes::ShapeRef.new(shape: GuardrailChecksPromptAttackConfig, location_name: "promptAttack"))
895
+ GuardrailChecksConfig.add_member(:sensitive_information, Shapes::ShapeRef.new(shape: GuardrailChecksSensitiveInformationConfig, location_name: "sensitiveInformation"))
896
+ GuardrailChecksConfig.struct_class = Types::GuardrailChecksConfig
897
+
898
+ GuardrailChecksContentBlock.add_member(:text, Shapes::ShapeRef.new(shape: GuardrailChecksTextContent, location_name: "text"))
899
+ GuardrailChecksContentBlock.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
900
+ GuardrailChecksContentBlock.add_member_subclass(:text, Types::GuardrailChecksContentBlock::Text)
901
+ GuardrailChecksContentBlock.add_member_subclass(:unknown, Types::GuardrailChecksContentBlock::Unknown)
902
+ GuardrailChecksContentBlock.struct_class = Types::GuardrailChecksContentBlock
903
+
904
+ GuardrailChecksContentBlockList.member = Shapes::ShapeRef.new(shape: GuardrailChecksContentBlock)
905
+
906
+ GuardrailChecksContentFilterCategoryConfig.add_member(:category, Shapes::ShapeRef.new(shape: GuardrailChecksContentFilterCategory, required: true, location_name: "category"))
907
+ GuardrailChecksContentFilterCategoryConfig.struct_class = Types::GuardrailChecksContentFilterCategoryConfig
908
+
909
+ GuardrailChecksContentFilterCategoryConfigList.member = Shapes::ShapeRef.new(shape: GuardrailChecksContentFilterCategoryConfig)
910
+
911
+ GuardrailChecksContentFilterConfig.add_member(:categories, Shapes::ShapeRef.new(shape: GuardrailChecksContentFilterCategoryConfigList, required: true, location_name: "categories"))
912
+ GuardrailChecksContentFilterConfig.struct_class = Types::GuardrailChecksContentFilterConfig
913
+
914
+ GuardrailChecksContentFilterResult.add_member(:results, Shapes::ShapeRef.new(shape: GuardrailChecksContentFilterResultList, required: true, location_name: "results"))
915
+ GuardrailChecksContentFilterResult.struct_class = Types::GuardrailChecksContentFilterResult
916
+
917
+ GuardrailChecksContentFilterResultEntry.add_member(:category, Shapes::ShapeRef.new(shape: GuardrailChecksContentFilterCategory, required: true, location_name: "category"))
918
+ GuardrailChecksContentFilterResultEntry.add_member(:severity_score, Shapes::ShapeRef.new(shape: GuardrailChecksContentFilterResultEntrySeverityScoreDouble, required: true, location_name: "severityScore"))
919
+ GuardrailChecksContentFilterResultEntry.struct_class = Types::GuardrailChecksContentFilterResultEntry
920
+
921
+ GuardrailChecksContentFilterResultList.member = Shapes::ShapeRef.new(shape: GuardrailChecksContentFilterResultEntry)
922
+
923
+ GuardrailChecksContentFilterUsage.add_member(:text_units, Shapes::ShapeRef.new(shape: Integer, required: true, location_name: "textUnits"))
924
+ GuardrailChecksContentFilterUsage.struct_class = Types::GuardrailChecksContentFilterUsage
925
+
926
+ GuardrailChecksMessage.add_member(:role, Shapes::ShapeRef.new(shape: GuardrailChecksRole, required: true, location_name: "role"))
927
+ GuardrailChecksMessage.add_member(:content, Shapes::ShapeRef.new(shape: GuardrailChecksContentBlockList, required: true, location_name: "content"))
928
+ GuardrailChecksMessage.struct_class = Types::GuardrailChecksMessage
929
+
930
+ GuardrailChecksMessageList.member = Shapes::ShapeRef.new(shape: GuardrailChecksMessage)
931
+
932
+ GuardrailChecksPromptAttackCategoryConfig.add_member(:category, Shapes::ShapeRef.new(shape: GuardrailChecksPromptAttackCategory, required: true, location_name: "category"))
933
+ GuardrailChecksPromptAttackCategoryConfig.struct_class = Types::GuardrailChecksPromptAttackCategoryConfig
934
+
935
+ GuardrailChecksPromptAttackCategoryConfigList.member = Shapes::ShapeRef.new(shape: GuardrailChecksPromptAttackCategoryConfig)
936
+
937
+ GuardrailChecksPromptAttackConfig.add_member(:categories, Shapes::ShapeRef.new(shape: GuardrailChecksPromptAttackCategoryConfigList, required: true, location_name: "categories"))
938
+ GuardrailChecksPromptAttackConfig.struct_class = Types::GuardrailChecksPromptAttackConfig
939
+
940
+ GuardrailChecksPromptAttackResult.add_member(:results, Shapes::ShapeRef.new(shape: GuardrailChecksPromptAttackResultList, required: true, location_name: "results"))
941
+ GuardrailChecksPromptAttackResult.struct_class = Types::GuardrailChecksPromptAttackResult
942
+
943
+ GuardrailChecksPromptAttackResultEntry.add_member(:category, Shapes::ShapeRef.new(shape: GuardrailChecksPromptAttackCategory, required: true, location_name: "category"))
944
+ GuardrailChecksPromptAttackResultEntry.add_member(:severity_score, Shapes::ShapeRef.new(shape: GuardrailChecksPromptAttackResultEntrySeverityScoreDouble, required: true, location_name: "severityScore"))
945
+ GuardrailChecksPromptAttackResultEntry.struct_class = Types::GuardrailChecksPromptAttackResultEntry
946
+
947
+ GuardrailChecksPromptAttackResultList.member = Shapes::ShapeRef.new(shape: GuardrailChecksPromptAttackResultEntry)
948
+
949
+ GuardrailChecksPromptAttackUsage.add_member(:text_units, Shapes::ShapeRef.new(shape: Integer, required: true, location_name: "textUnits"))
950
+ GuardrailChecksPromptAttackUsage.struct_class = Types::GuardrailChecksPromptAttackUsage
951
+
952
+ GuardrailChecksResults.add_member(:content_filter, Shapes::ShapeRef.new(shape: GuardrailChecksContentFilterResult, location_name: "contentFilter"))
953
+ GuardrailChecksResults.add_member(:prompt_attack, Shapes::ShapeRef.new(shape: GuardrailChecksPromptAttackResult, location_name: "promptAttack"))
954
+ GuardrailChecksResults.add_member(:sensitive_information, Shapes::ShapeRef.new(shape: GuardrailChecksSensitiveInformationResult, location_name: "sensitiveInformation"))
955
+ GuardrailChecksResults.struct_class = Types::GuardrailChecksResults
956
+
957
+ GuardrailChecksSensitiveInformationConfig.add_member(:entities, Shapes::ShapeRef.new(shape: GuardrailChecksSensitiveInformationEntityConfigList, required: true, location_name: "entities"))
958
+ GuardrailChecksSensitiveInformationConfig.struct_class = Types::GuardrailChecksSensitiveInformationConfig
959
+
960
+ GuardrailChecksSensitiveInformationEntityConfig.add_member(:type, Shapes::ShapeRef.new(shape: GuardrailChecksSensitiveInformationEntityType, required: true, location_name: "type"))
961
+ GuardrailChecksSensitiveInformationEntityConfig.struct_class = Types::GuardrailChecksSensitiveInformationEntityConfig
962
+
963
+ GuardrailChecksSensitiveInformationEntityConfigList.member = Shapes::ShapeRef.new(shape: GuardrailChecksSensitiveInformationEntityConfig)
964
+
965
+ GuardrailChecksSensitiveInformationResult.add_member(:results, Shapes::ShapeRef.new(shape: GuardrailChecksSensitiveInformationResultList, required: true, location_name: "results"))
966
+ GuardrailChecksSensitiveInformationResult.add_member(:truncated, Shapes::ShapeRef.new(shape: Boolean, location_name: "truncated"))
967
+ GuardrailChecksSensitiveInformationResult.struct_class = Types::GuardrailChecksSensitiveInformationResult
968
+
969
+ GuardrailChecksSensitiveInformationResultEntry.add_member(:type, Shapes::ShapeRef.new(shape: GuardrailChecksSensitiveInformationEntityType, required: true, location_name: "type"))
970
+ GuardrailChecksSensitiveInformationResultEntry.add_member(:confidence_score, Shapes::ShapeRef.new(shape: GuardrailChecksSensitiveInformationResultEntryConfidenceScoreDouble, required: true, location_name: "confidenceScore"))
971
+ GuardrailChecksSensitiveInformationResultEntry.add_member(:begin_offset, Shapes::ShapeRef.new(shape: GuardrailChecksSensitiveInformationResultEntryBeginOffsetInteger, required: true, location_name: "beginOffset"))
972
+ GuardrailChecksSensitiveInformationResultEntry.add_member(:end_offset, Shapes::ShapeRef.new(shape: GuardrailChecksSensitiveInformationResultEntryEndOffsetInteger, required: true, location_name: "endOffset"))
973
+ GuardrailChecksSensitiveInformationResultEntry.add_member(:message_index, Shapes::ShapeRef.new(shape: GuardrailChecksSensitiveInformationResultEntryMessageIndexInteger, required: true, location_name: "messageIndex"))
974
+ GuardrailChecksSensitiveInformationResultEntry.add_member(:content_index, Shapes::ShapeRef.new(shape: GuardrailChecksSensitiveInformationResultEntryContentIndexInteger, required: true, location_name: "contentIndex"))
975
+ GuardrailChecksSensitiveInformationResultEntry.struct_class = Types::GuardrailChecksSensitiveInformationResultEntry
976
+
977
+ GuardrailChecksSensitiveInformationResultList.member = Shapes::ShapeRef.new(shape: GuardrailChecksSensitiveInformationResultEntry)
978
+
979
+ GuardrailChecksSensitiveInformationUsage.add_member(:text_units, Shapes::ShapeRef.new(shape: Integer, required: true, location_name: "textUnits"))
980
+ GuardrailChecksSensitiveInformationUsage.struct_class = Types::GuardrailChecksSensitiveInformationUsage
981
+
982
+ GuardrailChecksUsageResults.add_member(:content_filter, Shapes::ShapeRef.new(shape: GuardrailChecksContentFilterUsage, location_name: "contentFilter"))
983
+ GuardrailChecksUsageResults.add_member(:prompt_attack, Shapes::ShapeRef.new(shape: GuardrailChecksPromptAttackUsage, location_name: "promptAttack"))
984
+ GuardrailChecksUsageResults.add_member(:sensitive_information, Shapes::ShapeRef.new(shape: GuardrailChecksSensitiveInformationUsage, location_name: "sensitiveInformation"))
985
+ GuardrailChecksUsageResults.struct_class = Types::GuardrailChecksUsageResults
986
+
851
987
  GuardrailConfiguration.add_member(:guardrail_identifier, Shapes::ShapeRef.new(shape: GuardrailIdentifier, location_name: "guardrailIdentifier"))
852
988
  GuardrailConfiguration.add_member(:guardrail_version, Shapes::ShapeRef.new(shape: GuardrailVersion, location_name: "guardrailVersion"))
853
989
  GuardrailConfiguration.add_member(:trace, Shapes::ShapeRef.new(shape: GuardrailTrace, location_name: "trace"))
@@ -1056,6 +1192,14 @@ module Aws::BedrockRuntime
1056
1192
  InternalServerException.add_member(:message, Shapes::ShapeRef.new(shape: NonBlankString, location_name: "message"))
1057
1193
  InternalServerException.struct_class = Types::InternalServerException
1058
1194
 
1195
+ InvokeGuardrailChecksRequest.add_member(:messages, Shapes::ShapeRef.new(shape: GuardrailChecksMessageList, required: true, location_name: "messages"))
1196
+ InvokeGuardrailChecksRequest.add_member(:checks, Shapes::ShapeRef.new(shape: GuardrailChecksConfig, required: true, location_name: "checks"))
1197
+ InvokeGuardrailChecksRequest.struct_class = Types::InvokeGuardrailChecksRequest
1198
+
1199
+ InvokeGuardrailChecksResponse.add_member(:results, Shapes::ShapeRef.new(shape: GuardrailChecksResults, required: true, location_name: "results"))
1200
+ InvokeGuardrailChecksResponse.add_member(:usage, Shapes::ShapeRef.new(shape: GuardrailChecksUsageResults, required: true, location_name: "usage"))
1201
+ InvokeGuardrailChecksResponse.struct_class = Types::InvokeGuardrailChecksResponse
1202
+
1059
1203
  InvokeModelRequest.add_member(:body, Shapes::ShapeRef.new(shape: Body, location_name: "body"))
1060
1204
  InvokeModelRequest.add_member(:content_type, Shapes::ShapeRef.new(shape: MimeType, location: "header", location_name: "Content-Type"))
1061
1205
  InvokeModelRequest.add_member(:accept, Shapes::ShapeRef.new(shape: MimeType, location: "header", location_name: "Accept"))
@@ -1522,6 +1666,19 @@ module Aws::BedrockRuntime
1522
1666
  o.errors << Shapes::ShapeRef.new(shape: ValidationException)
1523
1667
  end)
1524
1668
 
1669
+ api.add_operation(:invoke_guardrail_checks, Seahorse::Model::Operation.new.tap do |o|
1670
+ o.name = "InvokeGuardrailChecks"
1671
+ o.http_method = "POST"
1672
+ o.http_request_uri = "/guardrail-checks/invoke"
1673
+ o.input = Shapes::ShapeRef.new(shape: InvokeGuardrailChecksRequest)
1674
+ o.output = Shapes::ShapeRef.new(shape: InvokeGuardrailChecksResponse)
1675
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
1676
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
1677
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
1678
+ o.errors << Shapes::ShapeRef.new(shape: ServiceUnavailableException)
1679
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
1680
+ end)
1681
+
1525
1682
  api.add_operation(:invoke_model, Seahorse::Model::Operation.new.tap do |o|
1526
1683
  o.name = "InvokeModel"
1527
1684
  o.http_method = "POST"
@@ -2295,6 +2295,386 @@ module Aws::BedrockRuntime
2295
2295
  include Aws::Structure
2296
2296
  end
2297
2297
 
2298
+ # The configuration for inline guardrail checks. Specify one or more
2299
+ # check types to run against the messages.
2300
+ #
2301
+ # @!attribute [rw] content_filter
2302
+ # The content filter check configuration.
2303
+ # @return [Types::GuardrailChecksContentFilterConfig]
2304
+ #
2305
+ # @!attribute [rw] prompt_attack
2306
+ # The prompt attack check configuration.
2307
+ # @return [Types::GuardrailChecksPromptAttackConfig]
2308
+ #
2309
+ # @!attribute [rw] sensitive_information
2310
+ # The sensitive information check configuration.
2311
+ # @return [Types::GuardrailChecksSensitiveInformationConfig]
2312
+ #
2313
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksConfig AWS API Documentation
2314
+ #
2315
+ class GuardrailChecksConfig < Struct.new(
2316
+ :content_filter,
2317
+ :prompt_attack,
2318
+ :sensitive_information)
2319
+ SENSITIVE = []
2320
+ include Aws::Structure
2321
+ end
2322
+
2323
+ # A content block within a message to evaluate.
2324
+ #
2325
+ # @note GuardrailChecksContentBlock is a union - when making an API calls you must set exactly one of the members.
2326
+ #
2327
+ # @!attribute [rw] text
2328
+ # The text content to evaluate.
2329
+ # @return [String]
2330
+ #
2331
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksContentBlock AWS API Documentation
2332
+ #
2333
+ class GuardrailChecksContentBlock < Struct.new(
2334
+ :text,
2335
+ :unknown)
2336
+ SENSITIVE = [:text]
2337
+ include Aws::Structure
2338
+ include Aws::Structure::Union
2339
+
2340
+ class Text < GuardrailChecksContentBlock; end
2341
+ class Unknown < GuardrailChecksContentBlock; end
2342
+ end
2343
+
2344
+ # The configuration for a single content filter category to evaluate.
2345
+ #
2346
+ # @!attribute [rw] category
2347
+ # The content filter category to evaluate.
2348
+ # @return [String]
2349
+ #
2350
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksContentFilterCategoryConfig AWS API Documentation
2351
+ #
2352
+ class GuardrailChecksContentFilterCategoryConfig < Struct.new(
2353
+ :category)
2354
+ SENSITIVE = []
2355
+ include Aws::Structure
2356
+ end
2357
+
2358
+ # The configuration for the content filter check, specifying which
2359
+ # categories to evaluate.
2360
+ #
2361
+ # @!attribute [rw] categories
2362
+ # The content filter categories to evaluate.
2363
+ # @return [Array<Types::GuardrailChecksContentFilterCategoryConfig>]
2364
+ #
2365
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksContentFilterConfig AWS API Documentation
2366
+ #
2367
+ class GuardrailChecksContentFilterConfig < Struct.new(
2368
+ :categories)
2369
+ SENSITIVE = []
2370
+ include Aws::Structure
2371
+ end
2372
+
2373
+ # The content filter check results.
2374
+ #
2375
+ # @!attribute [rw] results
2376
+ # The per-category content filter results.
2377
+ # @return [Array<Types::GuardrailChecksContentFilterResultEntry>]
2378
+ #
2379
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksContentFilterResult AWS API Documentation
2380
+ #
2381
+ class GuardrailChecksContentFilterResult < Struct.new(
2382
+ :results)
2383
+ SENSITIVE = []
2384
+ include Aws::Structure
2385
+ end
2386
+
2387
+ # The evaluation result for a single content filter category.
2388
+ #
2389
+ # @!attribute [rw] category
2390
+ # The content filter category that was evaluated.
2391
+ # @return [String]
2392
+ #
2393
+ # @!attribute [rw] severity_score
2394
+ # The severity score for the category, ranging from 0.0 to 1.0. Higher
2395
+ # values indicate greater severity.
2396
+ # @return [Float]
2397
+ #
2398
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksContentFilterResultEntry AWS API Documentation
2399
+ #
2400
+ class GuardrailChecksContentFilterResultEntry < Struct.new(
2401
+ :category,
2402
+ :severity_score)
2403
+ SENSITIVE = []
2404
+ include Aws::Structure
2405
+ end
2406
+
2407
+ # The text unit usage for the content filter check.
2408
+ #
2409
+ # @!attribute [rw] text_units
2410
+ # The number of text units consumed by the content filter check.
2411
+ # @return [Integer]
2412
+ #
2413
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksContentFilterUsage AWS API Documentation
2414
+ #
2415
+ class GuardrailChecksContentFilterUsage < Struct.new(
2416
+ :text_units)
2417
+ SENSITIVE = []
2418
+ include Aws::Structure
2419
+ end
2420
+
2421
+ # A message to evaluate against guardrail checks, containing a role and
2422
+ # content blocks.
2423
+ #
2424
+ # @!attribute [rw] role
2425
+ # The role of the message sender.
2426
+ # @return [String]
2427
+ #
2428
+ # @!attribute [rw] content
2429
+ # The content blocks for the message.
2430
+ # @return [Array<Types::GuardrailChecksContentBlock>]
2431
+ #
2432
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksMessage AWS API Documentation
2433
+ #
2434
+ class GuardrailChecksMessage < Struct.new(
2435
+ :role,
2436
+ :content)
2437
+ SENSITIVE = []
2438
+ include Aws::Structure
2439
+ end
2440
+
2441
+ # The configuration for a single prompt attack category to evaluate.
2442
+ #
2443
+ # @!attribute [rw] category
2444
+ # The prompt attack category to evaluate.
2445
+ # @return [String]
2446
+ #
2447
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksPromptAttackCategoryConfig AWS API Documentation
2448
+ #
2449
+ class GuardrailChecksPromptAttackCategoryConfig < Struct.new(
2450
+ :category)
2451
+ SENSITIVE = []
2452
+ include Aws::Structure
2453
+ end
2454
+
2455
+ # The configuration for the prompt attack check, specifying which
2456
+ # categories to evaluate.
2457
+ #
2458
+ # @!attribute [rw] categories
2459
+ # The prompt attack categories to evaluate.
2460
+ # @return [Array<Types::GuardrailChecksPromptAttackCategoryConfig>]
2461
+ #
2462
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksPromptAttackConfig AWS API Documentation
2463
+ #
2464
+ class GuardrailChecksPromptAttackConfig < Struct.new(
2465
+ :categories)
2466
+ SENSITIVE = []
2467
+ include Aws::Structure
2468
+ end
2469
+
2470
+ # The prompt attack check results.
2471
+ #
2472
+ # @!attribute [rw] results
2473
+ # The per-category prompt attack results.
2474
+ # @return [Array<Types::GuardrailChecksPromptAttackResultEntry>]
2475
+ #
2476
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksPromptAttackResult AWS API Documentation
2477
+ #
2478
+ class GuardrailChecksPromptAttackResult < Struct.new(
2479
+ :results)
2480
+ SENSITIVE = []
2481
+ include Aws::Structure
2482
+ end
2483
+
2484
+ # The evaluation result for a single prompt attack category.
2485
+ #
2486
+ # @!attribute [rw] category
2487
+ # The prompt attack category that was evaluated.
2488
+ # @return [String]
2489
+ #
2490
+ # @!attribute [rw] severity_score
2491
+ # The severity score for the category, ranging from 0.0 to 1.0. Higher
2492
+ # values indicate greater severity.
2493
+ # @return [Float]
2494
+ #
2495
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksPromptAttackResultEntry AWS API Documentation
2496
+ #
2497
+ class GuardrailChecksPromptAttackResultEntry < Struct.new(
2498
+ :category,
2499
+ :severity_score)
2500
+ SENSITIVE = []
2501
+ include Aws::Structure
2502
+ end
2503
+
2504
+ # The text unit usage for the prompt attack check.
2505
+ #
2506
+ # @!attribute [rw] text_units
2507
+ # The number of text units consumed by the prompt attack check.
2508
+ # @return [Integer]
2509
+ #
2510
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksPromptAttackUsage AWS API Documentation
2511
+ #
2512
+ class GuardrailChecksPromptAttackUsage < Struct.new(
2513
+ :text_units)
2514
+ SENSITIVE = []
2515
+ include Aws::Structure
2516
+ end
2517
+
2518
+ # The results from the guardrail checks evaluation, organized by check
2519
+ # type.
2520
+ #
2521
+ # @!attribute [rw] content_filter
2522
+ # The content filter check results.
2523
+ # @return [Types::GuardrailChecksContentFilterResult]
2524
+ #
2525
+ # @!attribute [rw] prompt_attack
2526
+ # The prompt attack check results.
2527
+ # @return [Types::GuardrailChecksPromptAttackResult]
2528
+ #
2529
+ # @!attribute [rw] sensitive_information
2530
+ # The sensitive information check results.
2531
+ # @return [Types::GuardrailChecksSensitiveInformationResult]
2532
+ #
2533
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksResults AWS API Documentation
2534
+ #
2535
+ class GuardrailChecksResults < Struct.new(
2536
+ :content_filter,
2537
+ :prompt_attack,
2538
+ :sensitive_information)
2539
+ SENSITIVE = []
2540
+ include Aws::Structure
2541
+ end
2542
+
2543
+ # The configuration for the sensitive information check, specifying
2544
+ # which entity types to detect.
2545
+ #
2546
+ # @!attribute [rw] entities
2547
+ # The sensitive information entity types to detect.
2548
+ # @return [Array<Types::GuardrailChecksSensitiveInformationEntityConfig>]
2549
+ #
2550
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksSensitiveInformationConfig AWS API Documentation
2551
+ #
2552
+ class GuardrailChecksSensitiveInformationConfig < Struct.new(
2553
+ :entities)
2554
+ SENSITIVE = []
2555
+ include Aws::Structure
2556
+ end
2557
+
2558
+ # The configuration for a single sensitive information entity type to
2559
+ # detect.
2560
+ #
2561
+ # @!attribute [rw] type
2562
+ # The PII entity type to detect.
2563
+ # @return [String]
2564
+ #
2565
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksSensitiveInformationEntityConfig AWS API Documentation
2566
+ #
2567
+ class GuardrailChecksSensitiveInformationEntityConfig < Struct.new(
2568
+ :type)
2569
+ SENSITIVE = []
2570
+ include Aws::Structure
2571
+ end
2572
+
2573
+ # The sensitive information check results.
2574
+ #
2575
+ # @!attribute [rw] results
2576
+ # The detected sensitive information entities.
2577
+ # @return [Array<Types::GuardrailChecksSensitiveInformationResultEntry>]
2578
+ #
2579
+ # @!attribute [rw] truncated
2580
+ # Specifies whether the results were truncated because the number of
2581
+ # detected entities exceeded the maximum limit.
2582
+ # @return [Boolean]
2583
+ #
2584
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksSensitiveInformationResult AWS API Documentation
2585
+ #
2586
+ class GuardrailChecksSensitiveInformationResult < Struct.new(
2587
+ :results,
2588
+ :truncated)
2589
+ SENSITIVE = []
2590
+ include Aws::Structure
2591
+ end
2592
+
2593
+ # The detection result for a single sensitive information entity found
2594
+ # in the evaluated messages.
2595
+ #
2596
+ # @!attribute [rw] type
2597
+ # The PII entity type that was detected.
2598
+ # @return [String]
2599
+ #
2600
+ # @!attribute [rw] confidence_score
2601
+ # The confidence score for the detection, ranging from 0.0 to 1.0.
2602
+ # Higher values indicate greater confidence.
2603
+ # @return [Float]
2604
+ #
2605
+ # @!attribute [rw] begin_offset
2606
+ # The start character offset of the detected entity within the content
2607
+ # block.
2608
+ # @return [Integer]
2609
+ #
2610
+ # @!attribute [rw] end_offset
2611
+ # The end character offset of the detected entity within the content
2612
+ # block.
2613
+ # @return [Integer]
2614
+ #
2615
+ # @!attribute [rw] message_index
2616
+ # The zero-based index of the message in the input messages array
2617
+ # where the entity was detected.
2618
+ # @return [Integer]
2619
+ #
2620
+ # @!attribute [rw] content_index
2621
+ # The zero-based index of the content block within the message where
2622
+ # the entity was detected.
2623
+ # @return [Integer]
2624
+ #
2625
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksSensitiveInformationResultEntry AWS API Documentation
2626
+ #
2627
+ class GuardrailChecksSensitiveInformationResultEntry < Struct.new(
2628
+ :type,
2629
+ :confidence_score,
2630
+ :begin_offset,
2631
+ :end_offset,
2632
+ :message_index,
2633
+ :content_index)
2634
+ SENSITIVE = []
2635
+ include Aws::Structure
2636
+ end
2637
+
2638
+ # The text unit usage for the sensitive information check.
2639
+ #
2640
+ # @!attribute [rw] text_units
2641
+ # The number of text units consumed by the sensitive information
2642
+ # check.
2643
+ # @return [Integer]
2644
+ #
2645
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksSensitiveInformationUsage AWS API Documentation
2646
+ #
2647
+ class GuardrailChecksSensitiveInformationUsage < Struct.new(
2648
+ :text_units)
2649
+ SENSITIVE = []
2650
+ include Aws::Structure
2651
+ end
2652
+
2653
+ # The text unit usage for the guardrail checks evaluation, organized by
2654
+ # check type.
2655
+ #
2656
+ # @!attribute [rw] content_filter
2657
+ # The text unit usage for the content filter check.
2658
+ # @return [Types::GuardrailChecksContentFilterUsage]
2659
+ #
2660
+ # @!attribute [rw] prompt_attack
2661
+ # The text unit usage for the prompt attack check.
2662
+ # @return [Types::GuardrailChecksPromptAttackUsage]
2663
+ #
2664
+ # @!attribute [rw] sensitive_information
2665
+ # The text unit usage for the sensitive information check.
2666
+ # @return [Types::GuardrailChecksSensitiveInformationUsage]
2667
+ #
2668
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailChecksUsageResults AWS API Documentation
2669
+ #
2670
+ class GuardrailChecksUsageResults < Struct.new(
2671
+ :content_filter,
2672
+ :prompt_attack,
2673
+ :sensitive_information)
2674
+ SENSITIVE = []
2675
+ include Aws::Structure
2676
+ end
2677
+
2298
2678
  # Configuration information for a guardrail that you use with the
2299
2679
  # [Converse][1] operation.
2300
2680
  #
@@ -3242,6 +3622,43 @@ module Aws::BedrockRuntime
3242
3622
  include Aws::Structure
3243
3623
  end
3244
3624
 
3625
+ # @!attribute [rw] messages
3626
+ # The messages to evaluate against the specified guardrail checks.
3627
+ # Each message includes a role and one or more content blocks.
3628
+ # @return [Array<Types::GuardrailChecksMessage>]
3629
+ #
3630
+ # @!attribute [rw] checks
3631
+ # The inline check configurations that specify which guardrail checks
3632
+ # to run against the messages.
3633
+ # @return [Types::GuardrailChecksConfig]
3634
+ #
3635
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeGuardrailChecksRequest AWS API Documentation
3636
+ #
3637
+ class InvokeGuardrailChecksRequest < Struct.new(
3638
+ :messages,
3639
+ :checks)
3640
+ SENSITIVE = []
3641
+ include Aws::Structure
3642
+ end
3643
+
3644
+ # @!attribute [rw] results
3645
+ # The per-check results containing findings from the guardrail
3646
+ # evaluation.
3647
+ # @return [Types::GuardrailChecksResults]
3648
+ #
3649
+ # @!attribute [rw] usage
3650
+ # The per-check text unit consumption for the guardrail evaluation.
3651
+ # @return [Types::GuardrailChecksUsageResults]
3652
+ #
3653
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeGuardrailChecksResponse AWS API Documentation
3654
+ #
3655
+ class InvokeGuardrailChecksResponse < Struct.new(
3656
+ :results,
3657
+ :usage)
3658
+ SENSITIVE = []
3659
+ include Aws::Structure
3660
+ end
3661
+
3245
3662
  # @!attribute [rw] body
3246
3663
  # The prompt and inference parameters in the format specified in the
3247
3664
  # `contentType` in the header. You must provide the body in JSON
@@ -73,7 +73,7 @@ module Aws::BedrockRuntime
73
73
  autoload :AsyncClient, 'aws-sdk-bedrockruntime/async_client'
74
74
  autoload :EventStreams, 'aws-sdk-bedrockruntime/event_streams'
75
75
 
76
- GEM_VERSION = '1.80.0'
76
+ GEM_VERSION = '1.81.0'
77
77
 
78
78
  end
79
79
 
data/sig/client.rbs CHANGED
@@ -249,6 +249,49 @@ module Aws
249
249
  ) -> _GetAsyncInvokeResponseSuccess
250
250
  | (Hash[Symbol, untyped] params, ?Hash[Symbol, untyped] options) -> _GetAsyncInvokeResponseSuccess
251
251
 
252
+ interface _InvokeGuardrailChecksResponseSuccess
253
+ include ::Seahorse::Client::_ResponseSuccess[Types::InvokeGuardrailChecksResponse]
254
+ def results: () -> Types::GuardrailChecksResults
255
+ def usage: () -> Types::GuardrailChecksUsageResults
256
+ end
257
+ # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockRuntime/Client.html#invoke_guardrail_checks-instance_method
258
+ def invoke_guardrail_checks: (
259
+ messages: Array[
260
+ {
261
+ role: ("user" | "assistant" | "system"),
262
+ content: Array[
263
+ {
264
+ text: ::String?
265
+ }
266
+ ]
267
+ }
268
+ ],
269
+ checks: {
270
+ content_filter: {
271
+ categories: Array[
272
+ {
273
+ category: ("VIOLENCE" | "HATE" | "SEXUAL" | "MISCONDUCT" | "INSULTS")
274
+ }
275
+ ]
276
+ }?,
277
+ prompt_attack: {
278
+ categories: Array[
279
+ {
280
+ category: ("JAILBREAK" | "PROMPT_INJECTION" | "PROMPT_LEAKAGE")
281
+ }
282
+ ]
283
+ }?,
284
+ sensitive_information: {
285
+ entities: Array[
286
+ {
287
+ 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")
288
+ }
289
+ ]
290
+ }?
291
+ }
292
+ ) -> _InvokeGuardrailChecksResponseSuccess
293
+ | (Hash[Symbol, untyped] params, ?Hash[Symbol, untyped] options) -> _InvokeGuardrailChecksResponseSuccess
294
+
252
295
  interface _InvokeModelResponseSuccess
253
296
  include ::Seahorse::Client::_ResponseSuccess[Types::InvokeModelResponse]
254
297
  def body: () -> ::String
data/sig/types.rbs CHANGED
@@ -654,6 +654,127 @@ module Aws::BedrockRuntime
654
654
  SENSITIVE: []
655
655
  end
656
656
 
657
+ class GuardrailChecksConfig
658
+ attr_accessor content_filter: Types::GuardrailChecksContentFilterConfig
659
+ attr_accessor prompt_attack: Types::GuardrailChecksPromptAttackConfig
660
+ attr_accessor sensitive_information: Types::GuardrailChecksSensitiveInformationConfig
661
+ SENSITIVE: []
662
+ end
663
+
664
+ class GuardrailChecksContentBlock
665
+ attr_accessor text: ::String
666
+ attr_accessor unknown: untyped
667
+ SENSITIVE: [:text]
668
+
669
+ class Text < GuardrailChecksContentBlock
670
+ end
671
+ class Unknown < GuardrailChecksContentBlock
672
+ end
673
+ end
674
+
675
+ class GuardrailChecksContentFilterCategoryConfig
676
+ attr_accessor category: ("VIOLENCE" | "HATE" | "SEXUAL" | "MISCONDUCT" | "INSULTS")
677
+ SENSITIVE: []
678
+ end
679
+
680
+ class GuardrailChecksContentFilterConfig
681
+ attr_accessor categories: ::Array[Types::GuardrailChecksContentFilterCategoryConfig]
682
+ SENSITIVE: []
683
+ end
684
+
685
+ class GuardrailChecksContentFilterResult
686
+ attr_accessor results: ::Array[Types::GuardrailChecksContentFilterResultEntry]
687
+ SENSITIVE: []
688
+ end
689
+
690
+ class GuardrailChecksContentFilterResultEntry
691
+ attr_accessor category: ("VIOLENCE" | "HATE" | "SEXUAL" | "MISCONDUCT" | "INSULTS")
692
+ attr_accessor severity_score: ::Float
693
+ SENSITIVE: []
694
+ end
695
+
696
+ class GuardrailChecksContentFilterUsage
697
+ attr_accessor text_units: ::Integer
698
+ SENSITIVE: []
699
+ end
700
+
701
+ class GuardrailChecksMessage
702
+ attr_accessor role: ("user" | "assistant" | "system")
703
+ attr_accessor content: ::Array[Types::GuardrailChecksContentBlock]
704
+ SENSITIVE: []
705
+ end
706
+
707
+ class GuardrailChecksPromptAttackCategoryConfig
708
+ attr_accessor category: ("JAILBREAK" | "PROMPT_INJECTION" | "PROMPT_LEAKAGE")
709
+ SENSITIVE: []
710
+ end
711
+
712
+ class GuardrailChecksPromptAttackConfig
713
+ attr_accessor categories: ::Array[Types::GuardrailChecksPromptAttackCategoryConfig]
714
+ SENSITIVE: []
715
+ end
716
+
717
+ class GuardrailChecksPromptAttackResult
718
+ attr_accessor results: ::Array[Types::GuardrailChecksPromptAttackResultEntry]
719
+ SENSITIVE: []
720
+ end
721
+
722
+ class GuardrailChecksPromptAttackResultEntry
723
+ attr_accessor category: ("JAILBREAK" | "PROMPT_INJECTION" | "PROMPT_LEAKAGE")
724
+ attr_accessor severity_score: ::Float
725
+ SENSITIVE: []
726
+ end
727
+
728
+ class GuardrailChecksPromptAttackUsage
729
+ attr_accessor text_units: ::Integer
730
+ SENSITIVE: []
731
+ end
732
+
733
+ class GuardrailChecksResults
734
+ attr_accessor content_filter: Types::GuardrailChecksContentFilterResult
735
+ attr_accessor prompt_attack: Types::GuardrailChecksPromptAttackResult
736
+ attr_accessor sensitive_information: Types::GuardrailChecksSensitiveInformationResult
737
+ SENSITIVE: []
738
+ end
739
+
740
+ class GuardrailChecksSensitiveInformationConfig
741
+ attr_accessor entities: ::Array[Types::GuardrailChecksSensitiveInformationEntityConfig]
742
+ SENSITIVE: []
743
+ end
744
+
745
+ class GuardrailChecksSensitiveInformationEntityConfig
746
+ attr_accessor 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")
747
+ SENSITIVE: []
748
+ end
749
+
750
+ class GuardrailChecksSensitiveInformationResult
751
+ attr_accessor results: ::Array[Types::GuardrailChecksSensitiveInformationResultEntry]
752
+ attr_accessor truncated: bool
753
+ SENSITIVE: []
754
+ end
755
+
756
+ class GuardrailChecksSensitiveInformationResultEntry
757
+ attr_accessor 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")
758
+ attr_accessor confidence_score: ::Float
759
+ attr_accessor begin_offset: ::Integer
760
+ attr_accessor end_offset: ::Integer
761
+ attr_accessor message_index: ::Integer
762
+ attr_accessor content_index: ::Integer
763
+ SENSITIVE: []
764
+ end
765
+
766
+ class GuardrailChecksSensitiveInformationUsage
767
+ attr_accessor text_units: ::Integer
768
+ SENSITIVE: []
769
+ end
770
+
771
+ class GuardrailChecksUsageResults
772
+ attr_accessor content_filter: Types::GuardrailChecksContentFilterUsage
773
+ attr_accessor prompt_attack: Types::GuardrailChecksPromptAttackUsage
774
+ attr_accessor sensitive_information: Types::GuardrailChecksSensitiveInformationUsage
775
+ SENSITIVE: []
776
+ end
777
+
657
778
  class GuardrailConfiguration
658
779
  attr_accessor guardrail_identifier: ::String
659
780
  attr_accessor guardrail_version: ::String
@@ -925,6 +1046,18 @@ module Aws::BedrockRuntime
925
1046
  SENSITIVE: []
926
1047
  end
927
1048
 
1049
+ class InvokeGuardrailChecksRequest
1050
+ attr_accessor messages: ::Array[Types::GuardrailChecksMessage]
1051
+ attr_accessor checks: Types::GuardrailChecksConfig
1052
+ SENSITIVE: []
1053
+ end
1054
+
1055
+ class InvokeGuardrailChecksResponse
1056
+ attr_accessor results: Types::GuardrailChecksResults
1057
+ attr_accessor usage: Types::GuardrailChecksUsageResults
1058
+ SENSITIVE: []
1059
+ end
1060
+
928
1061
  class InvokeModelRequest
929
1062
  attr_accessor body: ::String
930
1063
  attr_accessor content_type: ::String
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-bedrockruntime
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.80.0
4
+ version: 1.81.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services