Add failOpen to CES Guardrail llmPromptSecurity#1324
Merged
Conversation
[upstream:56dcd4246708a95bcc57b60d6bbad9383a64de64] Signed-off-by: Modular Magician <magic-modules@google.com>
3fc5798
into
terraform-google-modules:master
2 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add failOpen field to llmPromptSecurity in google_ces_guardrail and google_ces_app_version
This PR adds the missing
fail_openattribute to thellm_prompt_securityblock in thegoogle_ces_guardrailandgoogle_ces_app_versionresources, achieving full API parity for this security feature.Documentation
Rationale
The
failOpenfield at the root of thellmPromptSecurityobject was missing from the Terraform provider schemas. This field determines whether the guardrail fails open (allowing user queries to pass through if LLM classification fails) or closed. Without it, users were unable to configure this critical fallback behavior when using the default system security settings.Technical Details
failOpen(Boolean) tollmPromptSecurityproperties inGuardrail.yaml.failOpen(Boolean, read-onlyoutput: true) under the nestedguardrails.llmPromptSecurityproperties inAppVersion.yamlto ensure complete schema parity across resources.ces_guardrail_llm_prompt_security_fail_open.tf.tmplto demonstrate usage withdefault_settingsandfail_open = true.TestAccCESGuardrail_cesGuardrailLlmPromptSecurityFailOpenExample_updatetoces_guardrail_test.go.fail_open = true) to robustly handle proto3 default-value (false) omission in API responses, avoiding Terraform "empty nested block" diff loops.Verification Results
googleandgoogle-betaproviders usingPRODUCT=ces.TestAccCESGuardrail_cesGuardrailLlmPromptSecurityFailOpenExample_update).Derived from GoogleCloudPlatform/magic-modules#17634