Skip to content

fix(guardrails): check feature flag helper in PIIMasker to honor DB overrides (#8708) - #8730

Merged
diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.49from
Dingding-leo:pr/fix-pii-masker-feature-flag
Jul 27, 2026
Merged

diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.49from
Dingding-leo:pr/fix-pii-masker-feature-flag

Conversation

@Dingding-leo

Copy link
Copy Markdown
Contributor

Summary

Fixes #8708.

Changes

  • Updated in to call instead of directly querying .
  • Added unit test in verifying that database feature flag overrides enable request PII masking as expected.

Verification

  • Ran unit tests: TAP version 13

GUARDRAIL earlier pre-call modified undefined

GUARDRAIL later pre-call modified undefined

[DB] Changing cache_size from 65536KB to 16384KB

[DB] cache_size changed to 16384KB

[DB] SQLite database ready: /Users/austinliu/.omniroute/storage.sqlite (DATA_DIR=/Users/austinliu/.omniroute, SQLITE_FILE=/Users/austinliu/.omniroute/storage.sqlite)

Request blocked by prompt injection guard {

detections: [

{ pattern: 'system_override', severity: 'high' },

{ pattern: 'system_prompt_leak', severity: 'high' }

]

}

Subtest: guardrail registry runs pre-call hooks in priority order

ok 1 - guardrail registry runs pre-call hooks in priority order

duration_ms: 0.872042
type: 'test'
...

Subtest: guardrail registry respects disabledGuardrails from context

ok 2 - guardrail registry respects disabledGuardrails from context

duration_ms: 0.112417
type: 'test'
...

Subtest: resolveDisabledGuardrails merges api key, body metadata, and headers

ok 3 - resolveDisabledGuardrails merges api key, body metadata, and headers

duration_ms: 0.094708
type: 'test'
...

Subtest: prompt injection guardrail blocks suspicious content in block mode

ok 4 - prompt injection guardrail blocks suspicious content in block mode

duration_ms: 21.844042
type: 'test'
...

Subtest: pii masker guardrail redacts request and response payloads

ok 5 - pii masker guardrail redacts request and response payloads

duration_ms: 1.37375
type: 'test'
...

Subtest: pii masker respects feature flag overrides (DB and env)

ok 6 - pii masker respects feature flag overrides (DB and env)

duration_ms: 0.26475
type: 'test'
...

Subtest: pii masker does not rewrite request PII when redaction flag is off

ok 7 - pii masker does not rewrite request PII when redaction flag is off

duration_ms: 0.110583
type: 'test'
...

Subtest: guardrail registry fails open when a guardrail throws

ok 8 - guardrail registry fails open when a guardrail throws

duration_ms: 0.097959
type: 'test'
...
1..8

tests 8

suites 0

pass 8

fail 0

cancelled 0

skipped 0

todo 0

duration_ms 400.818792 (PASS, 8/8).

…verrides (#8708)

Previously  checked  directly, ignoring database feature flag overrides configured via settings/UI. This update routes the check through  so DB overrides are respected as intended.
Copilot AI review requested due to automatic review settings July 26, 2026 23:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@diegosouzapw

Copy link
Copy Markdown
Collaborator

✅ Conflito resolvido automaticamente — pronto para o merge-train

O conflito contra release/v3.8.49 foi resolvido e o branch foi atualizado para incluir a resolução:

  • HEAD anterior → HEAD atual: ver git log --oneline no branch.
  • Estratégia de resolução: commit merge-tree preservando a intenção das duas pontas (PR + release).
  • Co-autoria preservada: o(s) commit(s) original(is) da contribuição continuam intactos.

Esta PR agora é MERGEABLE contra release/v3.8.49 e vai entrar no merge-train v3.8.49 local (suite validada em 192.168.0.113, squash merge via --admin).

@diegosouzapw
diegosouzapw merged commit 0c1654b into cheaper-inference:release/v3.8.49 Jul 27, 2026
15 checks passed
@diegosouzapw diegosouzapw mentioned this pull request Jul 28, 2026
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
…verrides (cheaper-inference#8708) (cheaper-inference#8730)

Previously  checked  directly, ignoring database feature flag overrides configured via settings/UI. This update routes the check through  so DB overrides are respected as intended.

Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…verrides (cheaper-inference#8708) (cheaper-inference#8730)

Previously  checked  directly, ignoring database feature flag overrides configured via settings/UI. This update routes the check through  so DB overrides are respected as intended.

Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
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.

fix(backend): PII_REDACTION_ENABLED dashboard toggle is ignored — runtime reads only process.env

3 participants