Skip to content

fix: use gateway-owned file trust guidance - #1227

Open
gewenyu99 wants to merge 20 commits into
mainfrom
codex/wizard-gateway-prompt-boundary
Open

fix: use gateway-owned file trust guidance#1227
gewenyu99 wants to merge 20 commits into
mainfrom
codex/wizard-gateway-prompt-boundary

Conversation

@gewenyu99

@gewenyu99 gewenyu99 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Problem

Wizard’s Pi system prompt quotes an instruction-override attack as defensive guidance. The gateway prompt checks reject that quote with HTTP 400, so the orchestrator plans no work and the integration aborts.

Changes

Remove the duplicate file-trust guidance from Wizard’s runtime notes. The gateway-owned Wizard prompt already supplies that boundary. Refresh the existing prompt snapshots.

Stacked on #1225. Companion fix for PostHog/ai-gateway#464 and PostHog/ai-gateway#461; deploy with their gateway-owned prompt policy.

Test plan

  • Reproduced on the Express real-TUI smoke: mint succeeded, first model response succeeded, then planning requests hit instruction_override.
  • Existing test suite: 2,678 tests passed; three prompt snapshots updated.
  • Build, CLI smoke, and Warlock smoke passed; formatting and staged-file ESLint checks passed.
  • Combined local-stack Express sanity: five successful model completions, including four planning turns; stopped at the requested limit before integration completion.
  • Smoke used a locally minted OAuth fixture with the application’s full scope ceiling; the user’s supplied PostHog keys were not exercised. No additional unit tests added.

gewenyu99 and others added 19 commits September 8, 2026 13:00
A refused mint carried a fixed message per status, so a blocklisted account read "Your access to this project has changed" instead of the server's detail naming the contact address. Prefer the response detail when it is a short string; keep the fixed message otherwise.

Generated-By: PostHog Desktop
Task-Id: ecbe6b2f-c266-41d5-be54-272f86314c88
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…detail

Dropping the legacy fallback means a 404 is no longer useful here, but the
server still owes one to builds that do fall back. The mint now says which
this is, so the server can answer a refusal with its reason without
breaking every older client.

The detail it sends is printed to a terminal, so control characters and
the escapes an ANSI sequence is built from are stripped first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
401 and 404 come from layers with no wizard-specific message, so their
detail is DRF's "Invalid token." or "Not found.", which replaced the copy
naming the upgrade command. A detail that cleans to nothing also falls
back now, and a control-only detail pins both the C1 arm and the trim
running after the substitution.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Suppressing it on 401 and 404 assumed those carry DRF boilerplate, but the
mint answers 404 with the reason a client that does not declare itself
gets: the rollout is off, or the program is unrecognised. Dropping that
text left the user with generic copy on the refusals that explain
themselves best.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…PostHog/wizard into brandon/wizard-w1-1-drop-legacy-posture
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
typeof body.code === 'string' is true for the empty string, so a refusal
carrying both keys lost its outcome whenever the code cleaned to nothing.
The catalog doc gains the group this PR adds, and the precedence has
fixtures that carry one key each, so swapping the arms goes red.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… prose

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The duplicated defensive example triggers the gateway instruction-override check and aborts planning. The gateway policy owns this trust boundary.

Refs PostHog/ai-gateway#464
@gewenyu99
gewenyu99 requested a review from a team as a code owner September 9, 2026 01:21
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a Context Mill branch:

  • /wizard-ci all context-mill:my-branch

Add context-mill:<branch> to any command above to pin the Context Mill branch. It defaults to main.

Results will be posted here when complete.

Select the constrained gateway classifier so suspicious reports can be
triaged without tripping the integration prompt policy. Unwrap its
structured verdict envelope for Warlock, preserving fail-closed parsing.

Refs PostHog/ai-gateway#464
@gewenyu99
gewenyu99 force-pushed the brandon/wizard-w1-4-ci-accepts-gateway-token branch 4 times, most recently from 1729506 to 6a233b5 Compare September 9, 2026 04:19
Base automatically changed from brandon/wizard-w1-4-ci-accepts-gateway-token to main September 9, 2026 04:23
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.

3 participants