From 96e220a9ac0bdcfec8787de2ecc778ded0711dd8 Mon Sep 17 00:00:00 2001 From: Dotta Date: Fri, 6 Nov 2026 03:07:34 -0600 Subject: [PATCH] Reject an explicitly negated acknowledgment action itself Co-Authored-By: Paperclip --- .../external-company-secret-confirmation.test.ts | 2 ++ .../external-company-secret-confirmation.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/runner-e2e/chat-catalog-domains/external-company-secret-confirmation.test.ts b/tests/runner-e2e/chat-catalog-domains/external-company-secret-confirmation.test.ts index 08130fbbad5..da40774808b 100644 --- a/tests/runner-e2e/chat-catalog-domains/external-company-secret-confirmation.test.ts +++ b/tests/runner-e2e/chat-catalog-domains/external-company-secret-confirmation.test.ts @@ -80,6 +80,8 @@ it("keeps unrelated safety warnings outside save and acknowledgment negation",() ])expect(companySecretConfirmationHandoff({...card(),payload:{...card().payload,prompt:context+text}},binding,guidance),text).toBeDefined(); for(const text of [ "Save the deployment key there. Do not confirm yet. Then accept this card.", + "Save the deployment key there. Do not accept this card.", + "Save the deployment key there. Never confirm here.", "After saving your profile, confirm here that secure entry is complete.", "Never save the deployment key there. Then accept this card.", ])expect(companySecretConfirmationHandoff({...card(),payload:{...card().payload,prompt:context+text}},binding,guidance),text).toBeUndefined(); diff --git a/tests/runner-e2e/chat-catalog-domains/external-company-secret-confirmation.ts b/tests/runner-e2e/chat-catalog-domains/external-company-secret-confirmation.ts index 9d7957537d0..b1137f648db 100644 --- a/tests/runner-e2e/chat-catalog-domains/external-company-secret-confirmation.ts +++ b/tests/runner-e2e/chat-catalog-domains/external-company-secret-confirmation.ts @@ -24,7 +24,7 @@ function orderedSecureSaveAcknowledgment(prompt:string){ const after=prompt.slice(clause.index!+save.index+save[0].length); for(const acknowledgment of after.matchAll(/\b(?:accept|confirm)\b[^.!?;\n]*/gi)){ const between=after.slice(0,acknowledgment.index),intent=acknowledgment[0]; - if(/\b(?:(?:do not|don.t|never)\s+(?:save|enter|set|accept|confirm)|(?:cancel|decline|skip|avoid)(?:\s+(?:the|to))?\s+(?:save|saving|entry|acknowledgment|confirmation|accept|confirm))\b/i.test(between)||/\b(?:before|permission|authorize|another|other card)\b/i.test(intent))continue; + if(/(?:\b(?:do|should|must)\s+not|\bdon.t|\bnever|\b(?:cancel|decline|skip|avoid)(?:\s+to)?)\s*$/i.test(between.trim())||/\b(?:(?:do not|don.t|never)\s+(?:save|enter|set|accept|confirm)|(?:cancel|decline|skip|avoid)(?:\s+(?:the|to))?\s+(?:save|saving|entry|acknowledgment|confirmation|accept|confirm))\b/i.test(between)||/\b(?:before|permission|authorize|another|other card)\b/i.test(intent))continue; if(/^(?:accept|confirm)\s+(?:this\s+card|here\b|(?:that\s+)?(?:the\s+)?(?:deployment\s+(?:api\s+)?key|secure entry)\b[^.!?;\n]{0,80}\b(?:saved|complete))/i.test(intent))return true; } }