feat(security): collect credentials via elicitation for createAccessibilityAuthConfig and createLCASteps - #361
Merged
ruturaj-browserstack merged 1 commit intoAug 6, 2026
Conversation
…bilityAuthConfig and createLCASteps Both tools previously accepted credentials as tool arguments, so the values transited the model context. They now prefer MCP elicitation: when the connected client advertises elicitation support, missing credentials are requested directly from the user via the client — the value flows user -> client -> server and never enters the LLM's tool-call arguments, context, or logs. A shared, capability-gated helper (elicitCredentialsIfSupported) drives this. When the client can't elicit, the user declines, or the request errors, it falls back to the existing argument-based flow — so behavior is unchanged for clients without elicitation and it is safe to ship to remote MCP (degrades gracefully). - createAccessibilityAuthConfig: username/password are now optional; elicited when absent and supported, otherwise the tool errors asking for them. - createLCASteps: adds a `requires_authentication` flag so credentials are only elicited when the test case actually needs login; the credentials arg remains a fallback. Backward-compatible (no argument removed). Tests cover the helper's branches and the elicit / no-capability / decline / error paths for both tools. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
Author
Why we implemented it this way (arg path kept as fallback)
Note — new requires_authentication flag (LCA only): Unlike the accessibility tool (creds always required), most LCA test cases don't need a login, so there's no reliable way to know when to prompt. The flag is an explicit "this test case needs login" signal — the agent sets it instead of passing credentials, and the tool then elicits them. Additive and optional (defaults false), so it changes nothing for existing calls. |
ruturaj-browserstack
approved these changes
Aug 6, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Both tools previously accepted credentials as tool arguments, so the values transited the model context. They now prefer MCP elicitation: when the connected client advertises elicitation support, missing credentials are requested directly from the user via the client — the value flows user -> client -> server and never enters the LLM's tool-call arguments, context, or logs.
A shared, capability-gated helper (elicitCredentialsIfSupported) drives this. When the client can't elicit, the user declines, or the request errors, it falls back to the existing argument-based flow — so behavior is unchanged for clients without elicitation and it is safe to ship to remote MCP (degrades gracefully).
requires_authenticationflag so credentials are only elicited when the test case actually needs login; the credentials arg remains a fallback.Backward-compatible (no argument removed). Tests cover the helper's branches and the elicit / no-capability / decline / error paths for both tools.