BEDROCK-RUNTIME

ApplyGuardrail

enum_GuardrailContentQualifier := [ "grounding_source", "query", "guard_content" ]
enum_GuardrailContentSource := [ "INPUT", "OUTPUT" ]

valid {
    input.Body.source == enum_GuardrailContentSource[_]
    input.Body.content[_].text.text == STRING
    input.Body.content[_].text.qualifiers[_] == enum_GuardrailContentQualifier[_]
    input.ReqMap.guardrailIdentifier == STRING
    input.ReqMap.guardrailVersion == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

Converse

enum_ConversationRole := [ "user", "assistant" ]
enum_DocumentFormat := [ "pdf", "csv", "doc", "docx", "xls", "xlsx", "html", "txt", "md" ]
enum_GuardrailConverseContentQualifier := [ "grounding_source", "query", "guard_content" ]
enum_GuardrailTrace := [ "enabled", "disabled" ]
enum_ImageFormat := [ "png", "jpeg", "gif", "webp" ]
enum_ToolResultStatus := [ "success", "error" ]

valid {
    input.Body.messages[_].role == enum_ConversationRole[_]
    input.Body.messages[_].content[_].text == STRING
    input.Body.messages[_].content[_].image.format == enum_ImageFormat[_]
    input.Body.messages[_].content[_].image.source.bytes == BLOB
    input.Body.messages[_].content[_].document.format == enum_DocumentFormat[_]
    input.Body.messages[_].content[_].document.name == STRING
    input.Body.messages[_].content[_].document.source.bytes == BLOB
    input.Body.messages[_].content[_].toolUse.toolUseId == STRING
    input.Body.messages[_].content[_].toolUse.name == STRING
    input.Body.messages[_].content[_].toolUse.input == {}
    input.Body.messages[_].content[_].toolResult.toolUseId == STRING
    input.Body.messages[_].content[_].toolResult.content[_].json == {}
    input.Body.messages[_].content[_].toolResult.content[_].text == STRING
    input.Body.messages[_].content[_].toolResult.content[_].image.format == enum_ImageFormat[_]
    input.Body.messages[_].content[_].toolResult.content[_].image.source.bytes == BLOB
    input.Body.messages[_].content[_].toolResult.content[_].document.format == enum_DocumentFormat[_]
    input.Body.messages[_].content[_].toolResult.content[_].document.name == STRING
    input.Body.messages[_].content[_].toolResult.content[_].document.source.bytes == BLOB
    input.Body.messages[_].content[_].toolResult.status == enum_ToolResultStatus[_]
    input.Body.messages[_].content[_].guardContent.text.text == STRING
    input.Body.messages[_].content[_].guardContent.text.qualifiers[_] == enum_GuardrailConverseContentQualifier[_]
    input.Body.system[_].text == STRING
    input.Body.system[_].guardContent.text.text == STRING
    input.Body.system[_].guardContent.text.qualifiers[_] == enum_GuardrailConverseContentQualifier[_]
    input.Body.inferenceConfig.maxTokens == INTEGER
    input.Body.inferenceConfig.temperature == FLOAT
    input.Body.inferenceConfig.topP == FLOAT
    input.Body.inferenceConfig.stopSequences[_] == STRING
    input.Body.toolConfig.tools[_].toolSpec.name == STRING
    input.Body.toolConfig.tools[_].toolSpec.description == STRING
    input.Body.toolConfig.tools[_].toolSpec.inputSchema.json == {}
    input.Body.toolConfig.toolChoice.auto == {}
    input.Body.toolConfig.toolChoice.any == {}
    input.Body.toolConfig.toolChoice.tool.name == STRING
    input.Body.guardrailConfig.guardrailIdentifier == STRING
    input.Body.guardrailConfig.guardrailVersion == STRING
    input.Body.guardrailConfig.trace == enum_GuardrailTrace[_]
    input.Body.additionalModelRequestFields == {}
    input.Body.promptVariables.STRING.text == STRING
    input.Body.additionalModelResponseFieldPaths[_] == STRING
    input.ReqMap.modelId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

ConverseStream

enum_ConversationRole := [ "user", "assistant" ]
enum_DocumentFormat := [ "pdf", "csv", "doc", "docx", "xls", "xlsx", "html", "txt", "md" ]
enum_GuardrailConverseContentQualifier := [ "grounding_source", "query", "guard_content" ]
enum_GuardrailStreamProcessingMode := [ "sync", "async" ]
enum_GuardrailTrace := [ "enabled", "disabled" ]
enum_ImageFormat := [ "png", "jpeg", "gif", "webp" ]
enum_ToolResultStatus := [ "success", "error" ]

valid {
    input.Body.messages[_].role == enum_ConversationRole[_]
    input.Body.messages[_].content[_].text == STRING
    input.Body.messages[_].content[_].image.format == enum_ImageFormat[_]
    input.Body.messages[_].content[_].image.source.bytes == BLOB
    input.Body.messages[_].content[_].document.format == enum_DocumentFormat[_]
    input.Body.messages[_].content[_].document.name == STRING
    input.Body.messages[_].content[_].document.source.bytes == BLOB
    input.Body.messages[_].content[_].toolUse.toolUseId == STRING
    input.Body.messages[_].content[_].toolUse.name == STRING
    input.Body.messages[_].content[_].toolUse.input == {}
    input.Body.messages[_].content[_].toolResult.toolUseId == STRING
    input.Body.messages[_].content[_].toolResult.content[_].json == {}
    input.Body.messages[_].content[_].toolResult.content[_].text == STRING
    input.Body.messages[_].content[_].toolResult.content[_].image.format == enum_ImageFormat[_]
    input.Body.messages[_].content[_].toolResult.content[_].image.source.bytes == BLOB
    input.Body.messages[_].content[_].toolResult.content[_].document.format == enum_DocumentFormat[_]
    input.Body.messages[_].content[_].toolResult.content[_].document.name == STRING
    input.Body.messages[_].content[_].toolResult.content[_].document.source.bytes == BLOB
    input.Body.messages[_].content[_].toolResult.status == enum_ToolResultStatus[_]
    input.Body.messages[_].content[_].guardContent.text.text == STRING
    input.Body.messages[_].content[_].guardContent.text.qualifiers[_] == enum_GuardrailConverseContentQualifier[_]
    input.Body.system[_].text == STRING
    input.Body.system[_].guardContent.text.text == STRING
    input.Body.system[_].guardContent.text.qualifiers[_] == enum_GuardrailConverseContentQualifier[_]
    input.Body.inferenceConfig.maxTokens == INTEGER
    input.Body.inferenceConfig.temperature == FLOAT
    input.Body.inferenceConfig.topP == FLOAT
    input.Body.inferenceConfig.stopSequences[_] == STRING
    input.Body.toolConfig.tools[_].toolSpec.name == STRING
    input.Body.toolConfig.tools[_].toolSpec.description == STRING
    input.Body.toolConfig.tools[_].toolSpec.inputSchema.json == {}
    input.Body.toolConfig.toolChoice.auto == {}
    input.Body.toolConfig.toolChoice.any == {}
    input.Body.toolConfig.toolChoice.tool.name == STRING
    input.Body.guardrailConfig.guardrailIdentifier == STRING
    input.Body.guardrailConfig.guardrailVersion == STRING
    input.Body.guardrailConfig.trace == enum_GuardrailTrace[_]
    input.Body.guardrailConfig.streamProcessingMode == enum_GuardrailStreamProcessingMode[_]
    input.Body.additionalModelRequestFields == {}
    input.Body.promptVariables.STRING.text == STRING
    input.Body.additionalModelResponseFieldPaths[_] == STRING
    input.ReqMap.modelId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

InvokeModel

enum_Trace := [ "ENABLED", "DISABLED" ]

valid {
    input.Body.body == BLOB
    input.ReqMap.modelId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

InvokeModelWithResponseStream

enum_Trace := [ "ENABLED", "DISABLED" ]

valid {
    input.Body.body == BLOB
    input.ReqMap.modelId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}