Skip to content

fix(native): drop the dead-key moderation guardrail — every guarded run 401'd before its model - #912

Merged
lilyshen0722 merged 1 commit into
mainfrom
fix/native-guardrails-dead-key
Aug 13, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
fix/native-guardrails-dead-key

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

The Guide's first live smoke run (fresh signup on dev, first hello) failed with Incorrect API key provided: placeholder from platform.openai.com — while a direct probe of deepseek-v4-flash through the same LiteLLM path authenticates fine. The 401 is the openai-moderation-enforce guardrail, whose OPENAI_API_KEY is the literal string placeholder: every guarded native run has been dying on the guardrail before reaching any model. Timeline note: this is also the probable cause of the native fleet's 98% July failure rate (guardrails validated 2026-07-01; the August ECONNREFUSED wall the #891 review found was layered on top).

Fix:

  • NATIVE_RUNTIME_GUARDRAILS becomes a helm-tracked backend env (the documented off-switch, but through values — a kubectl set env is drift the next upgrade reverts, per the fix(helm): per-agent replicas knob — a parked cloud-codex agent must stay parked #900 lesson).
  • Dev pins injection-guard only: it's LiteLLM-native (keyless, no external service) and is the layer that matters for untrusted input. The moderation layer returns when a real OpenAI key lands in the api-keys secret (Sam credential decision, noted in the values comment).

Render-verified (helm template shows the env; lint clean). Post-merge deploy + the Guide smoke test rerun is the verification.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8

…un 401'd before its model

The Guide's first live smoke run failed with "Incorrect API key provided:
placeholder" from platform.openai.com — not the model (deepseek-v4-flash
authenticates fine, probed) but the openai-moderation-enforce guardrail,
whose OPENAI_API_KEY is the literal placeholder. Every guarded native run
dies on the guardrail before reaching any model, which is also the probable
cause of the native fleet's 98% July failure rate (predating the August
LiteLLM outage the #891 review surfaced).

NATIVE_RUNTIME_GUARDRAILS becomes helm-tracked (a kubectl-set env is drift
the next upgrade reverts — the #900 lesson) and dev pins it to
injection-guard only: LiteLLM-native, keyless, and the guardrail that
actually matters for untrusted input. Restore the moderation layer when a
real OpenAI key lands in the api-keys secret.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
@lilyshen0722
lilyshen0722 merged commit 53568d5 into main Aug 13, 2026
11 checks passed
@lilyshen0722
lilyshen0722 deleted the fix/native-guardrails-dead-key branch August 13, 2026 01:06
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.

1 participant