diff --git a/docs/agent-steps.mdx b/docs/agent-steps.mdx index 5fdf842a76..23c57d02bf 100644 --- a/docs/agent-steps.mdx +++ b/docs/agent-steps.mdx @@ -21,8 +21,9 @@ unless the agents entry sets a [custom one](/executors). For `act`, the first prompt holds the instruction, the params, the completed steps, and a redacted text snapshot of the screen: roles, names, text, and states. It holds no raw HTML, cookies, headers, or environment values. -Password fields are masked, and a configured secret value on screen becomes -``. +Password fields are masked, unless a page script hides one from e2e +([where redaction stops](/reference/security#where-redaction-stops)). +A configured secret value on screen becomes ``. After an action, the model gets the changes to the screen, or a new full snapshot when most of it changed. Node ids stay the same while their diff --git a/docs/decision-models.mdx b/docs/decision-models.mdx index ca86124f14..380189c3dc 100644 --- a/docs/decision-models.mdx +++ b/docs/decision-models.mdx @@ -132,8 +132,10 @@ the decision model picks again. For `upload`, the text model lists the project-relative paths the goal or params name, and the runner authorizes each one. Model output never becomes a selector, a URL, or a key. -Password fields never reach the text model. Only `typeSecret` fills a -secret, from its declared handle. +Password fields never reach the text model, unless a page script hides one +from e2e. Then the text model sees its value, and `type` can fill it +([where redaction stops](/reference/security#where-redaction-stops)). +Only `typeSecret` fills a configured secret, from its declared handle. The text model also answers `waitFor` and `extract`. Instead of `textModel`, you can set `model` on the agents entry. With neither, the diff --git a/docs/reference/mcp.mdx b/docs/reference/mcp.mdx index 8fc119942f..ab72cd34a4 100644 --- a/docs/reference/mcp.mdx +++ b/docs/reference/mcp.mdx @@ -304,7 +304,7 @@ Left out: the built-in fixtures an engine contributes (`browser`, `device`), | `INVALID_ARGUMENT` | Code that doesn't parse or is outside the grammar, such as another name, a call it lacks, an assignment, or a function. The message quotes it with its line and column, and no statement runs. | | `INVALID_ARGUMENT` | A matcher that expects ``, since a test compares the real value. No statement runs. | | `POLICY_DENIED` | A secret `fill` into a field that fails the `type_secret` checks. Nothing is typed. | -| `POLICY_DENIED` | A read of a password field. | +| `POLICY_DENIED` | A read of a secure field, such as a password input. | | `POLICY_DENIED` | When the config declares a secret or credential, a locator found by part of a text: a regular expression, an `exact` other than `true`, or `hasText`. Find it by its exact text. No statement runs. | #### `test_lines` diff --git a/docs/reference/security.mdx b/docs/reference/security.mdx index 03a022a2cc..6b3bc11173 100644 --- a/docs/reference/security.mdx +++ b/docs/reference/security.mdx @@ -39,7 +39,7 @@ larger budget. [How agent steps work](/agent-steps) explains a step in full. | In the prompt | Form | | --- | --- | | Your instruction and params | Quoted inside `` and marked as data. A `Secret` param shows only its name and purpose. | -| The screen | An accessibility tree with node ids, roles, names, text, test ids, link targets, and states, cut at a size limit. No selectors. A link's query and fragment show only as `?…` and `#…`. Secure fields show as `value=`. | +| The screen | An accessibility tree with node ids, roles, names, text, test ids, link targets, and states, cut at a size limit. No selectors. A link's query and fragment show only as `?…` and `#…`. Secure fields show as `value=`, unless [a page script hides one](#where-redaction-stops). | | The location | The current URL, redacted, without userinfo. A judgment gets it as a path on the app's origin and as the whole URL elsewhere, cut at a size limit. On a device, the app and screen title. | | A screenshot | When needed or requested, and only if the engine proves secure fields are masked. | | Prior steps | `agent.act` receives bounded records from the same test or serial group. Judgments use only the current screen, its location, the instruction and its params, and the agent's context. | @@ -263,6 +263,13 @@ Redaction matches strings. These pass through: are redacted before any provider runs, - console output of tests that run in the runner's own process, when an embedding host passes the config or tests in memory, +- on the web engine, a password field that a page script hides from e2e, for + example by replacing `Element.prototype.matches`. e2e reads it as a plain + field: the observed screen and `inputValue` show its value, and a failed + `toHaveValue` prints it. `getAttribute` and `toHaveAttribute` do the same + when the HTML `value` attribute holds it. A configured secret's value is + still ``. Screenshots still mask the field, unless it is in a + closed shadow root and the page also replaces `querySelectorAll`, - a screenshot, including one sent to the model: it masks secure fields only, so a value the app shows elsewhere is in the image, - video: it masks nothing and is labeled `redaction: "incomplete"`. A diff --git a/plugins/e2e/skills/e2e/references/agent.md b/plugins/e2e/skills/e2e/references/agent.md index 4aab737490..bb44d0d1b5 100644 --- a/plugins/e2e/skills/e2e/references/agent.md +++ b/plugins/e2e/skills/e2e/references/agent.md @@ -361,10 +361,11 @@ of sleeping. A redacted snapshot of the screen (roles, names, text, states), prior-step summaries, and your context; never raw HTML, cookies, headers, environment -values, or a `Secret`'s value; password fields masked. The first -screen of a step arrives whole; later action results report what changed, -keyed by node ids stable while an element exists, or the whole screen when -most changed. Pixels arrive through `vision` on a judgment or the act loop's +values, or a `Secret`'s value; password fields masked, unless a page +script hides one from e2e. The first screen of a step arrives whole; later +action results report what changed, keyed by node ids stable while an +element exists, or the whole screen when most changed. +Pixels arrive through `vision` on a judgment or the act loop's `screenshot` and point tools, with secure fields masked. When the browser engine's tree capture times out, the model gets a screenshot and a warning, a judgment needs `vision: true`, and no control may be inferred diff --git a/plugins/e2e/skills/e2e/references/writing-tests.md b/plugins/e2e/skills/e2e/references/writing-tests.md index 5a8e48481e..e2facd1217 100644 --- a/plugins/e2e/skills/e2e/references/writing-tests.md +++ b/plugins/e2e/skills/e2e/references/writing-tests.md @@ -345,7 +345,7 @@ drops out, `
` is a space); `toHaveText` reads the same. `isChecked()` on a node that cannot be checked (a button), and `inputValue()` on one that holds no value (a heading), throw `ACTION_FAILED`. `waitFor({ state?: 'attached' | 'detached' | 'visible' | 'hidden', timeout? })` waits within `actionTimeout`, else `LOCATOR_NOT_FOUND`. For a value that has to -settle use `expect`, not a read. Reading a password field's value or +settle use `expect`, not a read. Reading a secure field's value or attributes is `POLICY_DENIED`, as is `toHaveAttribute` on one, negated too. `screen.tree()` returns the whole screen as the agent reads it (one node @@ -401,7 +401,7 @@ typed; prefer it when the app already has a schema for the response. `toHaveText` compares the whole normalized text, `toContainText` a substring or RegExp, `toHaveValue` a form control's value as is, whitespace included -(it fails on a node with none); on a password field all three are +(it fails on a node with none); on a secure field all three are `POLICY_DENIED`, never a comparison against `''`. List forms: `toHaveText(['Alpha', /^Beta/])` needs exactly two matches with those texts in order; `toContainText(['Alpha', 'Beta'])` needs each entry in a distinct diff --git a/skills/e2e/references/agent.md b/skills/e2e/references/agent.md index 4aab737490..bb44d0d1b5 100644 --- a/skills/e2e/references/agent.md +++ b/skills/e2e/references/agent.md @@ -361,10 +361,11 @@ of sleeping. A redacted snapshot of the screen (roles, names, text, states), prior-step summaries, and your context; never raw HTML, cookies, headers, environment -values, or a `Secret`'s value; password fields masked. The first -screen of a step arrives whole; later action results report what changed, -keyed by node ids stable while an element exists, or the whole screen when -most changed. Pixels arrive through `vision` on a judgment or the act loop's +values, or a `Secret`'s value; password fields masked, unless a page +script hides one from e2e. The first screen of a step arrives whole; later +action results report what changed, keyed by node ids stable while an +element exists, or the whole screen when most changed. +Pixels arrive through `vision` on a judgment or the act loop's `screenshot` and point tools, with secure fields masked. When the browser engine's tree capture times out, the model gets a screenshot and a warning, a judgment needs `vision: true`, and no control may be inferred diff --git a/skills/e2e/references/writing-tests.md b/skills/e2e/references/writing-tests.md index 5a8e48481e..e2facd1217 100644 --- a/skills/e2e/references/writing-tests.md +++ b/skills/e2e/references/writing-tests.md @@ -345,7 +345,7 @@ drops out, `
` is a space); `toHaveText` reads the same. `isChecked()` on a node that cannot be checked (a button), and `inputValue()` on one that holds no value (a heading), throw `ACTION_FAILED`. `waitFor({ state?: 'attached' | 'detached' | 'visible' | 'hidden', timeout? })` waits within `actionTimeout`, else `LOCATOR_NOT_FOUND`. For a value that has to -settle use `expect`, not a read. Reading a password field's value or +settle use `expect`, not a read. Reading a secure field's value or attributes is `POLICY_DENIED`, as is `toHaveAttribute` on one, negated too. `screen.tree()` returns the whole screen as the agent reads it (one node @@ -401,7 +401,7 @@ typed; prefer it when the app already has a schema for the response. `toHaveText` compares the whole normalized text, `toContainText` a substring or RegExp, `toHaveValue` a form control's value as is, whitespace included -(it fails on a node with none); on a password field all three are +(it fails on a node with none); on a secure field all three are `POLICY_DENIED`, never a comparison against `''`. List forms: `toHaveText(['Alpha', /^Beta/])` needs exactly two matches with those texts in order; `toContainText(['Alpha', 'Beta'])` needs each entry in a distinct