Skip to content

fix(wizard-ask): tell the agent to pass a warehouse credential in the tool's arguments - #1492

Open
Gilbert09 wants to merge 1 commit into
mainfrom
posthog/wizard-ask-forward-warehouse-credentials
Open

Gilbert09 wants to merge 1 commit into
mainfrom
posthog/wizard-ask-forward-warehouse-credentials

Conversation

@Gilbert09

Copy link
Copy Markdown
Member

Problem

The seeded warehouse task collects source credentials with wizard_ask and hands them to the PostHog source-setup tool. More and more of these task agents end the task as not needed / blocked even after the user typed the credential. Their remarks give the reason: they say a runtime rule forbids secrets in tool arguments except the wizard's env tools, and that a "credential-reference flow" should be used instead. The rate has been climbing daily since mid-October across several wizard versions, and completions have fallen as it rose.

That rule comes from the wizard's own shared sensitive field description. It says to use sensitive for "any other secret the user types in", and to reach any other tool by writing the secret to .env or through "that tool's own credential-reference flow". The context-mill warehouse skill says the opposite: collect plain text answers and pass them to the PostHog tool.

Why: A user who types a database password or API key into the terminal and then gets no source is the most costly way this flow can fail. This fixes the part of the completion drop where the work is actually lost. It does not cover the part caused by the consent notice moving to the end of the run.

Changes

  • WIZARD_ASK_SENSITIVE_DESCRIPTION, shared by the pi and MCP wizard_ask schemas, now limits sensitive to secrets that go only to a .env file. It says that a credential for another tool, such as a data-warehouse source, is collected with sensitive unset and passed in that tool's arguments as typed, without being replaced by a browser or credential-reference flow.
  • The parity test also asserts the new guidance.

Watch for the effect in the warehouse task's skip events (not_needed_reason = blocked) and in its orchestrator remark events. Both should fall, and orchestrator task completed for type = warehouse should rise.

Test plan

  • pnpm build, pnpm typecheck, and vitest run src/agent (1130 passed)
  • prettier and eslint on the touched files

Created with PostHog Desktop

🤖 Generated with Claude Code

… tool's arguments

The shared `sensitive` description told agents to mark every typed secret sensitive and to reach other tools through "that tool's own credential-reference flow". Warehouse task agents read that as a ban on secrets in tool arguments and ended blocked after the user had typed a credential. The description now limits `sensitive` to secrets bound for .env and says a credential for another tool is a plain answer passed in that tool's arguments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

Generated-By: PostHog Desktop
Task-Id: e2ce3d5f-ccfa-48b2-b0ad-2e364190e91c
@Gilbert09
Gilbert09 requested a review from a team as a code owner October 24, 2026 11:51
@Gilbert09 Gilbert09 self-assigned this Oct 24, 2026
@github-actions

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 feature-flags
  • /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 feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /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.

Comment thread src/agent/tools/tools.ts
@veria-ai

veria-ai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Security review

No open security issues remain on this pull request.

Fixed/addressed: 1 · PR risk: 0/10

@Gilbert09 Gilbert09 added the stamphog Auto-merge stamp for automated PRs label Oct 24, 2026 — with PostHog

@johncwaters johncwaters 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.

Note

Automated review. Not written by a human.

Comment thread src/agent/tools/tools.ts
'instead of the raw string. Set it only for a secret whose one destination ' +
'is a .env file: set_env_values resolves the secretRef, and no other tool ' +
'does — the PostHog data-warehouse tools and every other MCP tool reject it. ' +
'A credential you must hand to another tool, such as a data-warehouse ' +

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.

Note

Automated review. Not written by a human.

[security] HIGH

Telling the agent to collect a warehouse credential with sensitive unset means the terminal prompt does not mask it: shouldMaskAnswer in src/tui/screens/WizardAskScreen.tsx masks only when sensitive === true. The password or API key is echoed on screen (the leak that function's comment describes) and enters the model conversation. Keep masking for this case, or note that unmasked echo is accepted.

Comment thread src/agent/tools/tools.ts
'source credential, is collected with sensitive unset and passed in that ' +
"tool's arguments exactly as the user typed it. That is the intended path: " +
'the user typed it for that purpose, so do not withhold it or swap in a ' +
'browser or credential-reference flow instead.';

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.

Note

Automated review. Not written by a human.

[code-review] LOW

This description is shared by every wizard_ask caller. "do not withhold it" could push the agent to pass a typed secret as plain text to any tool. Narrow the wording to the PostHog source-setup tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stamphog Auto-merge stamp for automated PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants