Repository navigation
fix(wizard-ask): tell the agent to pass a warehouse credential in the tool's arguments #1492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Gilbert09
wants to merge
1
commit into
main
Choose a base branch
from
posthog/wizard-ask-forward-warehouse-credentials
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,22 +113,24 @@ export function resolveAskQuestionKinds< | |
| * the secret-handling guidance cannot drift between them — the same discipline | ||
| * `HANDOFF_FIELDS` applies to the handoff schema. | ||
| * | ||
| * The load-bearing part is the last two sentences: a vaulted `{secretRef}` is | ||
| * resolved only by wizard-tools that accept it, and the PostHog data-warehouse | ||
| * tools reject it. Without that, a pi agent collecting a credential it must hand | ||
| * to `external-data-sources-create` vaults it, gets a ref the create tool | ||
| * rejects, and dead-ends into the browser fallback — the exact loss the wizard's | ||
| * in-cli source setup is meant to avoid. | ||
| * The load-bearing part is the tail: a vaulted `{secretRef}` is resolved only by | ||
| * `set_env_values`, and a credential bound for a PostHog data-warehouse tool is | ||
| * a plain answer passed in that tool's arguments. Read as a ban on secrets in | ||
| * tool arguments, it leaves the agent holding a credential the user typed and | ||
| * dead-ending into the browser fallback — the exact loss the wizard's in-cli | ||
| * source setup is meant to avoid. | ||
| */ | ||
| export const WIZARD_ASK_SENSITIVE_DESCRIPTION = | ||
| "Only valid for kind='text'. When true, the user's answer is stored in the " + | ||
| "wizard's secret vault and returned to you as { secretRef: 'secret:...' } " + | ||
| 'instead of the raw string. Use for API keys, tokens, and any other secret ' + | ||
| 'the user types in. The secretRef is only resolved by wizard-tools that ' + | ||
| 'accept it (e.g. set_env_values) — it is NOT resolved when passed to other ' + | ||
| 'MCP tools (e.g. PostHog data-warehouse tools), which will reject it. For a ' + | ||
| 'secret that must reach another tool, write it to the env with set_env_values ' + | ||
| "first, or use that tool's own credential-reference flow."; | ||
| '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 ' + | ||
| 'source credential, is collected with sensitive unset and passed in that ' + | ||
|
veria-ai[bot] marked this conversation as resolved.
|
||
| "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.'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
| /** | ||
| * The `wizard_ask` `subject` field description, shared by both harness facades | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
sensitiveunset means the terminal prompt does not mask it:shouldMaskAnswerinsrc/tui/screens/WizardAskScreen.tsxmasks only whensensitive === 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.