Skip to content

fix(security): redact prompt provider exception details - #1563

Draft
seonghobae wants to merge 12 commits into
codex/starlette-testclient-dependencyfrom
fix-prompt-error-logging-12644696925697845329
Draft

seonghobae wants to merge 12 commits into
codex/starlette-testclient-dependencyfrom
fix-prompt-error-logging-12644696925697845329

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

문제

provider 예외에서 문자열 보간만 없애고 exc_info=True를 남기면 Python traceback이 예외 메시지를 기록합니다. API 키, Authorization 헤더, 내부 URI, 고객 프롬프트가 애플리케이션 로그 경계를 넘을 수 있습니다. provider 호출 실패 뒤 client cleanup까지 실패하면 finally 예외가 고정 502 응답을 덮어쓰는 문제도 있었습니다.

RED → 근본 수리

  • provider 실패 로그는 고정 문구와 예외 클래스명만 남기고 메시지와 traceback은 기록하지 않습니다.
  • client cleanup 실패에도 같은 규칙을 적용해 원래 고정 502 응답을 보존합니다.
  • 두 예외에 서로 다른 sentinel을 넣는 회귀 테스트가 어느 값도 로그에 남지 않고 cleanup이 한 번 실행되는지 검증합니다.
  • docs/doctoring/prompt-provider-error-boundary.md에 OWASP Logging Cheat Sheet와 NIST SP 800-92 근거, cleanup 경계를 기록했습니다.

Stack과 exact authority

  • protected root: develop@042b0c70531b229af3acbd0421a2f23098d848b3
  • prerequisite/base: PR fix(test): install Starlette TestClient dependency #1565 52dfc863d1a5d6e4e80b6366f719dd09f2aa6172
  • exact head: b1169e26949e7f75ebdccbdb9bb1f07eeacc163b
  • exact tree: 2e9e1a28b08c53092e47193685347c8648a3dec9
  • lifecycle: Draft / source repair complete / current-head hosted evidence pending

#1565를 non-force merge하고 그 branch로 retarget했습니다. 의존성 manifest를 이 PR에서 복제하지 않으며, effective child delta는 prompt 예외 경계의 구현·회귀 테스트·doctoring뿐입니다.

검증

  • frozen project sync: passed
  • prompt, dependency-pin, release-governance warning-as-error tests: 41 passed
  • Ruff: passed
  • parent-base diff check: passed

병합 경계

#1565가 먼저 보호 병합되고, 이 PR을 최신 보호 base에 non-force restack한 뒤 unchanged exact head의 모든 필수 Check와 독립 승인, 미해결 finding 0건을 다시 확인합니다. predecessor 증거 이전, self-approval, force push, admin bypass, dummy commit, traceback 복원은 금지합니다.

The current head non-force merges the parent runtime/provenance follow-up while preserving this child at three effective files. Parent and child hosted evidence remain independent.

@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-04T14:24:55.813672Z 943abe3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 943abe397f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread backend/api/prompts.py Outdated
@seonghobae
seonghobae marked this pull request as draft September 4, 2026 14:39
Assisted-by: OpenAI Codex
Signed-off-by: Seongho Bae <me@seonghobae.me>
Assisted-by: OpenAI Codex
Signed-off-by: Seongho Bae <me@seonghobae.me>
Assisted-by: OpenAI Codex
Signed-off-by: Seongho Bae <me@seonghobae.me>
@seonghobae seonghobae changed the title 🛡️ Sentinel: [MEDIUM] 로그 내 민감 정보 노출 방지 fix(security): redact prompt provider exception details Sep 4, 2026
seonghobae and others added 3 commits September 4, 2026 23:44
Assisted-by: OpenAI Codex
Signed-off-by: Seongho Bae <me@seonghobae.me>
Connect the fixed-event logging contract and sentinel regression to OWASP and NIST guidance without copying an unverified external binary.

Assisted-by: OpenAI Codex

Signed-off-by: Seongho Bae <me@seonghobae.me>
@seonghobae
seonghobae changed the base branch from develop to codex/starlette-testclient-dependency September 4, 2026 17:52
@seonghobae

Copy link
Copy Markdown
Contributor Author

Restacked without force on #1565 exact head 52dfc863d1a5d6e4e80b6366f719dd09f2aa6172. Current child head b1169e26949e7f75ebdccbdb9bb1f07eeacc163b retains a three-file effective delta and now includes the parent runtime/provenance evidence. Prompt redaction, dependency runtime, and release-governance suite: 41 passed with warnings as errors; Ruff and parent-base diff checks pass. Draft and independent exact-head gates remain unchanged.

@google-labs-jules

Copy link
Copy Markdown
Contributor

Restacked without force on #1565 exact head 52dfc863d1a5d6e4e80b6366f719dd09f2aa6172. Current child head b1169e26949e7f75ebdccbdb9bb1f07eeacc163b retains a three-file effective delta and now includes the parent runtime/provenance evidence. Prompt redaction, dependency runtime, and release-governance suite: 41 passed with warnings as errors; Ruff and parent-base diff checks pass. Draft and independent exact-head gates remain unchanged.

Acknowledged.

@seonghobae seonghobae added bug Something isn't working priority: medium Normal-priority or P2 work type: bug Defect or incorrect behavior labels Sep 7, 2026 — with ChatGPT Codex Connector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: medium Normal-priority or P2 work type: bug Defect or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant