Skip to content

fix(gem4gov): stop update-compliance stripping the Model Armor binding from customerPolicy - #205

Open
AloysJehwin wants to merge 1 commit into
google:mainfrom
AloysJehwin:fix/update-compliance-preserves-model-armor
Open

fix(gem4gov): stop update-compliance stripping the Model Armor binding from customerPolicy#205
AloysJehwin wants to merge 1 commit into
google:mainfrom
AloysJehwin:fix/update-compliance-preserves-model-armor

Conversation

@AloysJehwin

Copy link
Copy Markdown
Contributor

deploy.sh binds the Model Armor template by merging modelArmorConfig into the assistant's customerPolicy and widening its mask. gem4gov app update-compliance then PATCHes the same assistant with customerPolicy still named in the updateMask but a body whose customerPolicy contains only an empty bannedPhrases list. A field named in a mask is replaced wholesale, not merged, so the binding is silently dropped — the template stays in the project, nothing references it, and no prompt or response is screened.

Dropped customerPolicy from both the mask and the body. The empty bannedPhrases list wasn't doing anything — the API discards it, which is why the assistant reads back as customerPolicy: {} — so removing it costs nothing and leaves whatever deploy.sh configured intact. The alternative would have been reading the assistant back and re-merging modelArmorConfig, but that adds a round trip to preserve a value the command has no reason to touch.

Only FedRAMP High is affected; the IL4 and IL5 masks don't name customerPolicy.

One thing I left alone: the mask also names agentConfigs and the body has no agentConfigs either, so that field looks like it gets cleared the same way. I wasn't sure whether that one is deliberate for compliance, so I haven't touched it — happy to fold it in if it's the same oversight.

Fixes #184

The FedRAMP High assistant PATCH named customerPolicy in the updateMask while
sending a body whose customerPolicy held only an empty bannedPhrases list. A
masked field is replaced wholesale, so this silently discarded the
modelArmorConfig deploy.sh had bound, leaving the template in place but
referenced by nothing.

Dropped customerPolicy from both the mask and the body. The empty bannedPhrases
list was inert anyway — the API drops it — so nothing is lost and the binding
survives.

Fixes google#184

Signed-off-by: Aloys Jehwin <aloysjehwin@gmail.com>
@aghassemlouei aghassemlouei added bug Something isn't working Priority - High Critical issues blocking development or users; urgent bugs or core features for release Level of Effort - Low Quick, well-defined tasks with no unknowns; takes a few hours up to one day to complete gemini for government Gemini for Government (G4G) related labels Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working gemini for government Gemini for Government (G4G) related Level of Effort - Low Quick, well-defined tasks with no unknowns; takes a few hours up to one day to complete Priority - High Critical issues blocking development or users; urgent bugs or core features for release

Projects

None yet

2 participants