Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
fix(SKY-9930): copilot classifier infers credential intent from URL shape (#6049)
Andrew Neilsondca6fa406a81
diff --git a/skyvern/forge/prompts/skyvern/workflow-copilot-request-policy.j2 b/skyvern/forge/prompts/skyvern/workflow-copilot-request-policy.j2index 9ae4c4226..610a2ed4d 100644--- a/skyvern/forge/prompts/skyvern/workflow-copilot-request-policy.j2+++ b/skyvern/forge/prompts/skyvern/workflow-copilot-request-policy.j2@@ -11,7 +11,7 @@ credential_input_kind:- raw_secret: the user pasted a literal credential value — a password string, an API key/bearer token value, a session/auth cookie value, a TOTP/OTP/MFA digit code, a private-key body, a card number, or a CVV. The value must look like the secret itself (e.g. `password: hunter2`, `[email protected]:<password>`, bulk `[email protected]:<password>` account rows, `eyJ…` JWT, `sk-…` API key, a numeric OTP). Identifier-shaped vault-pointer strings such as `customer-<uuid>-pass`, `prod-app-secret-id`, `<service>-key-vault-id`, or `https://<vault>.vault.azure.net/secrets/<name>` are POINTERS to where a secret is stored, not secret values; do NOT classify them as raw_secret on the basis of a `-pass`, `-secret`, `-key`, or `-token` suffix alone.- credential_id: the user provided one or more exact credential IDs beginning with `cred_`. Put every ID in credential_refs.- credential_name: the user gave an exact saved credential name, or vaguely says to use "my credentials", "my saved credentials", "credentials saved already", or an entry in the Credentials UI without enough website context. Treat quoted names and bare identifier-like names tied to credential verbs as exact names, for example `using azure_credentials`, `get the code from mfa_email`, or `use Login Prod`. Put exact names in credential_refs; leave credential_refs empty when the reference is vague. Vault-handle-shaped strings (UUID/hex/dashed handles ending in `-pass`, `-secret`, `-key`, `-token`, `-id`, or `-user`) are NOT saved credential names — they are vault pointers; do not classify them as credential_name unless the user explicitly says "use my saved credential named `<handle>`".-- website_stored_credential: the user asks to use stored/saved credentials for a specific website or login page URL. Put URLs in login_page_urls.+- website_stored_credential: the user explicitly asks to use stored/saved credentials for a specific website or login page URL — the message must include a credential or authentication phrase (for example "log in", "sign in", "authenticate", "use the saved/stored login/creds/credentials", "with my credentials", and similar). Put URLs in login_page_urls. A URL alone, or a URL paired only with task language such as "scrape", "fill the form", "extract orders", "navigate to", or "go to", is NOT a website_stored_credential request even when the URL host or path looks like a login, admin, portal, or dashboard page.- placeholder: the user asks to add credential/password/username fields but explicitly says there are no real credentials yet.- none: the request mentions a login workflow but does not provide, request, or refer to any credential material.@@ -44,6 +44,7 @@ Rules:- A bare identifier reply inherits the slot purpose of the latest assistant turn: a vault/parameter/sample-value slot → credential_input_kind=none; an explicit `cred_…` ID slot → credential_id; an exact-saved-name slot → credential_name; a stored-credential URL slot → website_stored_credential. Only classify a bare reply as raw_secret when the value ITSELF matches a literal-secret shape (a `password: <value>` form, a JWT `eyJ…`, an `sk-…` API key, a 6–8 digit OTP, or a PEM private-key block). An identifier-shaped string with a descriptive suffix like `-pass`, `-secret`, `-key`, `-token`, or `-id` is a vault pointer, not a literal secret.- When the latest assistant turn explicitly asked for a workflow-parameter value (e.g. "What value should I use for `<param_name>`?", "What's the `<key>` for this run?"), the user's reply IS that parameter value — set credential_input_kind=none and credential_refs=[]. Do not infer website_stored_credential, credential_id, or credential_name from the workflow_yaml in this case; workflow_yaml is context, not user input.- When credential_input_kind=none, credential_refs MUST be an empty list. Never echo the user's bare reply into credential_refs unless the kind is credential_id or credential_name.+- Do not infer credential intent from URL shape alone. A user message that is essentially just a URL (or a URL paired with task-only language such as "scrape", "fill the form", "extract", "navigate to", "go to") with no credential phrase is credential_input_kind=none and login_page_urls=[], even when the URL host or path looks like a login, admin, portal, or dashboard page. Treat URL shape as ambiguous evidence of the user's goal, not as a credential ask.Latest user message:```{{ user_message }}```Earliest retained user turn (oldest user message in the retained window; the window is truncated upstream, so this may not be the original goal):