feat: add opt-in sensitive-data Guardrails - #4022
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This pull request was already a draft. Its draft status will be preserved after every issue above is resolved. |
리뷰 · 우선순위 33 / 80이 PR은 이슈 #3705의 “민감 데이터를 프로바이더로 보내기 전에 placeholder로 바꾸고, 성공한 어시스턴트 문장에서만 되돌린다”는 Guardrails를 풀 구현 draft로 올린 것이다. 기본값은 꺼짐이고, 전 프로바이더 또는 선택한 프로바이더만 보호한다. Responses / Chat Completions / Anthropic Messages의 JSON·SSE·WebSocket·continuation·compact·combo/fallback·sidecar 경로를 한 번에 덮고, 대시보드 Settings·Rules·Tester·Replace 미리보기·Activity와 Management API까지 기존 GUI 위에 얹는다. 규칙 266개는 지금 코드가 끼는 자리는 checkout 기준으로 분명하다. 새 트리 왜 지금 바로 안 태우나. (1) #3705에서 아직 메인테이너가 훅 지점·실패 불변식·번들/보안 영향을 공식으로 잠그지 않았다. (2) hygiene가 라인 / 경로로 보면 이런 점이 걸린다.
메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
|
I've made the author-side changes requested here:
On core head This PR's new commit changes documentation only; its runtime code is unchanged. Privacy checks and the 433-page docs build passed. This remains a draft, the labels are untouched, and I haven't rebased the full branch again. Maintainer agreement on the split and explicit security sponsorship are still needed. |
Summary
Adds opt-in sensitive-data Guardrails to the existing proxy and dashboard. Supported secrets and personal data become placeholders before provider I/O; only allowlisted successful assistant prose can restore the original values.
Relates to #3705. This is the full implementation as a reference draft, not the proposed first landing. The smaller inert core review branch has no server hooks or dashboard changes and makes no network protection claim. Its separate PR is prepared but will wait for maintainer agreement on the design. The proposed integration contract records the protocol/failure matrix, operator behavior, review split and sponsorship boundaries. Maintainer agreement on that contract and merge sponsorship is still pending. The full branch stays on its pinned base while direction is discussed.
Security and coverage limits
This detects supported patterns; it is not a guarantee that arbitrary sensitive text will be found. Tool/schema definitions and binary/image content are outside the text-scanning contract. Restored streaming output can be delayed until the success terminal. If continuation mappings expire or the process restarts, unresolved placeholders stay masked. Executable tool arguments are deliberately not restored.
The registry has 266 rules from
cloud-ru-tech/guardrails-llm-filter@bbd6f27467a53ff3869b59449edf4209f85ae675(v0.1.2.1) and six OpenCodex-owned supplemental rules. Donor main is unchanged as of September 8; its open tool-definition proposal is not imported.Direct dependencies are pinned to
re2-wasm@1.0.2andyaml@2.8.3. The latter replaces the RFC's 2.8.1 pin with the published fix for GHSA-48c2-rrv3-qjmp. YAML reads fixed package-owned rule assets; Management API imports use JSON. Package checks validate source, npm integrity, WASM hashes and shipped licenses/notices. Attribution is recorded insrc/guardrails/rules/provenance.jsonandTHIRD_PARTY_NOTICES.md.This touches credential handling, CI wiring and dependency installation, so explicit maintainer security review and
maintainer-sponsoredare needed before merge. Local independent reviews do not replace that review.GitHub Push Protection flagged 33 pattern matches in synthetic test fixtures, including duplicate detections of the same values. Each displayed match was checked against its historical test source and allowed as test data in the fork. No repository-wide scanning setting was disabled, and no commits were rewritten to evade detection.
Verification
Published head:
e54048a11ef3cf97e37a4138ddb05d1ed3dfd73e, including pinneddev@29bb221c3(development version 2.49.0). Stable at the September 8 publication check: 2.48.0.The full suite ran on
5b624f5b52bde9feb68b78e3de1deab9af72df21. The upstream merge at273d0fe4echanged onlypackage.json's version and six upstream release archive documents; it was independently reviewed. The currente54048a11adds only four documentation files/edits: the integration contract, its structure link, masked-value operator instructions and the synthetic-fixture contribution record. Runtime source, tests, dashboard source, scripts, lockfile and workflows remain byte-identical to the full-suite candidate. The new docs passed independent review, privacy scanning, 19 local-link checks and a fresh 433-page docs build.bun run test --parallel=2bun test tests4e71450701e055fc14d4f1a9a7c2360ce59fbc1fbun run typecheck,lint:gui:if-changed,privacy:scan,doctor:gui:if-changedbun audit, no severity filterbun run prepublishOnly,bun run verify:guardrails-packagebun install --frozen-lockfile,bun run build273d0fe4echeckpoint: four version/release test files273d0fe4echeckpoint:bun run privacy:scan,bun run prepublishOnlyThese runs used Bun 1.4.0 on macOS arm64. The final version checks were
bun test tests/ci-workflows/version-line.test.ts tests/ci-workflows/bump-dev-version.test.ts tests/ci-workflows/release-version-line.test.ts tests/ci-workflows/compatibility-version.test.ts.The earlier literal
bun run prepushhit an unchanged Desktop lifecycle child-process timeout under host contention. That file passed 46 tests in isolation and then passed in the complete two-worker run above. No test filters, added skips or timeout overrides were used. This is a staged prepush-equivalent pass, not a claim that the earlier command succeeded. The existing GUI bundle-size warning remains. Native Linux/Windows and GitHub PR CI results are separate and are not claimed here.Manual dashboard checks used isolated proxies, temporary homes, synthetic local providers and separate ports. They covered default-off, selected-provider persistence, Tester draft simulation, Activity, Replace preview and desktop/mobile navigation. Protected-provider wire data contained placeholders; excluded-provider wire data was unchanged, and eligible successful client prose was restored. Test proxies were stopped afterward; the primary proxy was untouched.
Screenshots
Captured on the same GUI source tree before the version-only 2.49.0 bump; the visible badge therefore says 2.48.0. All values are synthetic.
Desktop settings and inline save feedback:
Mobile layout, Replace security preview and draft Tester
Checklist
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Kept as a reference draft pending repository checks, agreement on the split and maintainer security sponsorship. Prepared with OpenAI Codex assistance.