Skip to content

fix(examples): repair guardrail e2e suite assertions and flaky triggers - #169

Merged
ling-senpeng13 merged 1 commit into
mainfrom
fix/guardrail-e2e-assertions
Aug 19, 2026
Merged

fix(examples): repair guardrail e2e suite assertions and flaky triggers#169
ling-senpeng13 merged 1 commit into
mainfrom
fix/guardrail-e2e-assertions

Conversation

@ling-senpeng13

Copy link
Copy Markdown
Contributor

The 27-test guardrail matrix (90-guardrail-e2e-tests.ts) reported failures on #8/#9, but the guardrails and server were behaving correctly — both defects were in the suite itself:

1. Assertions inspected "[object Object]". check() built its haystack with String(result.output), but output is an object. Every expectContains/expectNotContains across all 27 tests matched against that literal: #9's REDACTED check could never pass (the fix-guardrail's redacted output was verified present in the actual workflow result), and every leak assertion passed vacuously. Fixed with JSON.stringify for object outputs — the content assertions now audit real output for the first time.

2. The raise/fix cells left their trigger to chance. #2/#8/#9 assert what happens when a guardrail fires, but firing requires the model to actually repeat the sensitive value — and the prompts sometimes got a paraphrase instead (guardrail correctly passes → test "fails"). Prompts now ask for the value directly as a natural support request ("tell me the SSN on file"), which reliably elicits it. Note: verbatim-quoting demands ("repeat EXACTLY word for word") were tried and made things worse — models refuse them outright.

Also: #7 (retry) now accepts either terminal status as long as the secret never escapes — with a reliably-leaking prompt, retry exhaustion is legitimate (matches the CI e2e suite's handling of the same case).

Verified: 27/27 pass against conductor-oss 3.32.0-rc18.

@ling-senpeng13
ling-senpeng13 marked this pull request as ready for review August 18, 2026 00:33
@ling-senpeng13
ling-senpeng13 marked this pull request as draft August 18, 2026 16:02
@ling-senpeng13
ling-senpeng13 marked this pull request as ready for review August 18, 2026 22:15
@ling-senpeng13
ling-senpeng13 force-pushed the fix/guardrail-e2e-assertions branch from a0d9e58 to 0b6da07 Compare August 18, 2026 22:27
Comment thread examples/agents/90-guardrail-e2e-tests.ts Outdated
The 27-test guardrail matrix had two suite-level defects:

1. check() stringified result.output with String(), yielding
   '[object Object]' — every expectContains/expectNotContains matched
   against that literal, so #9's REDACTED check could never pass and
   all leak checks passed vacuously. Use JSON.stringify for objects.

2. The raise/fix cells (#2, #8, #9) only prove anything when the model
   actually repeats the sensitive value, which the prompts left to
   chance (paraphrase -> guardrail correctly passes -> test 'fails').
   Ask for the value directly as a natural support request so the leak
   the guardrail exists to catch happens reliably. Verbatim-quoting
   demands were tried and rejected: they trigger model refusals.

Also accept retry exhaustion (FAILED) for #7 as long as the secret
never escapes, matching the CI e2e suite's handling of the same case.

Verified: 27/27 pass against conductor-oss 3.32.0-rc18.
@ling-senpeng13
ling-senpeng13 force-pushed the fix/guardrail-e2e-assertions branch from 0b6da07 to 04e6f28 Compare August 19, 2026 00:34
@ling-senpeng13
ling-senpeng13 merged commit 4666f98 into main Aug 19, 2026
23 of 27 checks passed
@ling-senpeng13
ling-senpeng13 deleted the fix/guardrail-e2e-assertions branch August 19, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants