From b181466303a12720ed9a70a8f6ded5d4d55f0ea0 Mon Sep 17 00:00:00 2001 From: abrichr Date: Fri, 20 Nov 2026 20:02:43 -0500 Subject: [PATCH 1/7] fix(flow): keep pixel checks off withheld credential fields The recorder fills a withheld credential field with black in every frame that still shows it. A REGION_STABLE crop overlapping one froze that black box, which no live screen shows, so the step refuted on every hosted run (seen on staging: the click into the password field after the username was typed). Clip such a check to the part of its region clear of the box and re-crop it from the same frame; drop it into param_hygiene.json when nothing usable is left. Applies to mined checks and to the focused-field pass. --- packages/flow/CHANGELOG.md | 10 ++ .../flow/openadapt_flow/compiler/compile.py | 139 ++++++++++++++++++ .../flow/tests/e2e/test_wrap_sign_in_e2e.py | 15 ++ 3 files changed, 164 insertions(+) diff --git a/packages/flow/CHANGELOG.md b/packages/flow/CHANGELOG.md index c6efdea356..7ed2c13a01 100644 --- a/packages/flow/CHANGELOG.md +++ b/packages/flow/CHANGELOG.md @@ -67,6 +67,16 @@ ### Fixes +- A wrapped sign-in no longer compiles a pixel check that freezes a withheld + credential field. The recorder blacks out a withheld field in every frame + that still shows it, so a `REGION_STABLE` crop that overlapped one held a + black box that no live screen shows. That refuted the step on every hosted + run, for example the click into the password field. Such a check is now + clipped to the part of its region clear of the box and re-cropped from the + same frame. When no usable part is left, it is dropped and recorded in + `param_hygiene.json`. This applies to mined checks and to the + focused-field pass. + - Choice labels, values, shape metadata and browser-dialog messages are checked against declared secrets before capture. A matching or opaque secret boundary stops recording before that text reaches its artifacts. diff --git a/packages/flow/openadapt_flow/compiler/compile.py b/packages/flow/openadapt_flow/compiler/compile.py index 43d46d42cf..40cff6de22 100644 --- a/packages/flow/openadapt_flow/compiler/compile.py +++ b/packages/flow/openadapt_flow/compiler/compile.py @@ -921,6 +921,115 @@ def _crop_png(png: bytes, region: Region) -> bytes: return encoded +def _shows_blackout(png: Optional[bytes], region: Region) -> bool: + """Whether ``region`` of the frame is the recorder's solid black box. + + The recorder fills a withheld credential field with black in every frame + that still shows it (``Recorder._redact``). Undecodable input counts as + blacked out, the safe direction for dropping a pixel invariant. + """ + if png is None: + return False + img = imgops.decode_bgr(png) + if img is None: + return True + x, y, w, h = region + crop = img[max(y, 0) : max(y, 0) + h, max(x, 0) : max(x, 0) + w] + if crop.size == 0: + return False + return bool((crop <= 8).all(axis=-1).mean() >= 0.95) + + +def _clip_away(region: Region, box: Region) -> Optional[Region]: + """The largest part of ``region`` above, below, left or right of ``box``.""" + x, y, w, h = region + bx, by, bw, bh = box + parts = [ + (x, y, w, by - y), + (x, by + bh, w, y + h - (by + bh)), + (x, y, bx - x, h), + (bx + bw, y, x + w - (bx + bw), h), + ] + parts = [p for p in parts if p[2] >= 8 and p[3] >= 8] + return max(parts, key=lambda p: p[2] * p[3]) if parts else None + + +def _checks_without_withheld_fields( + step: Step, + after_png: Optional[bytes], + boxes: list[Region], + bundle: Path, +) -> list[dict[str, Any]]: + """Keep ``step``'s pixel checks off withheld credential fields. + + The recorder fills a withheld field with black in every frame that still + shows it, so a REGION_STABLE crop over one froze a black box that no live + screen shows and would refute every run. The check is clipped to the part + of its region clear of the box, re-cropped from the same recorded frame; + a region with no usable part left is dropped. Returns one note per change. + """ + notes: list[dict[str, Any]] = [] + if not boxes or not step.expect or after_png is None: + return notes + kept: list[Postcondition] = [] + for pc in step.expect: + hits = [ + box + for box in boxes + if pc.kind is PostconditionKind.REGION_STABLE + and pc.region is not None + and _regions_intersect(pc.region, box) + and _shows_blackout(after_png, box) + ] + if not hits: + kept.append(pc) + continue + region: Optional[Region] = pc.region + for box in hits: + if region is not None and _regions_intersect(region, box): + region = _clip_away(region, box) + if region is not None and any(_regions_intersect(region, b) for b in hits): + region = None + note = {"step": step.id, "region": list(pc.region or ())} + if region is None: + notes.append({**note, "change": "drop_region_stable_over_withheld_field", + "evidence": "the recorded crop holds a withheld field's black box"}) + continue + rel = pc.template or f"templates/{step.id}_expect.png" + _sealed.write_bytes(bundle / rel, _crop_png(after_png, region)) + kept.append(pc.model_copy(update={ + "region": region, + "phash": phash_png(after_png, region=region), + "template": rel, + })) + notes.append({**note, "change": "clip_region_stable_off_withheld_field", + "evidence": "the recorded crop held a withheld field's black box", + "clipped_region": list(region)}) + step.expect = kept + return notes + + +def _record_withheld_field_changes( + changes: list[dict[str, Any]], + param_region_drops: list[tuple[str, Region, str]], +) -> None: + """Log each clip; record each drop in ``param_hygiene.json`` like the + other dropped REGION_STABLE checks (no new bundle file).""" + for change in changes: + if change["change"].startswith("drop_"): + param_region_drops.append( + (change["step"], tuple(change["region"]), "") + ) + else: + logger.info( + "compile-pass %s: REGION_STABLE %s clipped to %s, clear of a " + "withheld credential field", + change["step"], + change["region"], + change["clipped_region"], + ) + + def _regions_intersect(a: Region, b: Region) -> bool: ax, ay, aw, ah = a bx, by, bw, bh = b @@ -3835,6 +3944,9 @@ def cached_lines(i: int, suffix: str, png: bytes) -> list[OcrLine]: # changed region rendered a demonstrated parameter value. Reported (not # raised) below — the drop is the safe outcome, but it must not be silent. param_region_drops: list[tuple[str, Region, str]] = [] + # Boxes of withheld credential fields seen so far (recorder + # ``redacted_region``); recorded frames show them blacked out. + secret_field_regions: list[Region] = [] # Submit-binding observations recorded on click events (unlabeled # controls only), attached once every risk decision is final. binding_observations: dict[str, object] = {} @@ -3920,6 +4032,17 @@ def cached_lines(i: int, suffix: str, png: bytes) -> list[OcrLine]: ) for region, matched in step_region_drops: param_region_drops.append((step.id, region, matched)) + # A withheld credential field is blacked out in this and every later + # recorded frame; keep pixel checks off it (_checks_without_withheld_fields). + redacted = event.get("redacted_region") + if isinstance(redacted, (list, tuple)) and len(redacted) == 4: + secret_field_regions.append(tuple(int(v) for v in redacted)) + _record_withheld_field_changes( + _checks_without_withheld_fields( + step, step_after, secret_field_regions, bundle + ), + param_region_drops, + ) if not step.expect: # Nothing visual survived mining: fall back to structural # postconditions (URL/title change, new tab) so the step is not @@ -4285,6 +4408,22 @@ def cached_lines(i: int, suffix: str, png: bytes) -> list[OcrLine]: pixel_verify_enabled=pixel_verify_enabled, drop_redundant_keys=drop_redundant_keys, ) + # The focused-field pass above crops the clicked box from the recorded + # after-frame, which can still show a neighbouring withheld credential + # field as the recorder's black box. Apply the same rule as mining. + withheld_boxes: list[Region] = [] + after_by_step: dict[str, tuple[Optional[bytes], list[Region]]] = {} + for step, _sb, sa, event in pending: + redacted = event.get("redacted_region") + if isinstance(redacted, (list, tuple)) and len(redacted) == 4: + withheld_boxes.append(tuple(int(v) for v in redacted)) + after_by_step[step.id] = (sa, list(withheld_boxes)) + for step in steps: + after, boxes = after_by_step.get(step.id, (None, [])) + _record_withheld_field_changes( + _checks_without_withheld_fields(step, after, boxes, bundle), + param_region_drops, + ) compile_notes = [ *compile_notes, *guard_notes, diff --git a/packages/flow/tests/e2e/test_wrap_sign_in_e2e.py b/packages/flow/tests/e2e/test_wrap_sign_in_e2e.py index e94d74beac..f59f78f013 100644 --- a/packages/flow/tests/e2e/test_wrap_sign_in_e2e.py +++ b/packages/flow/tests/e2e/test_wrap_sign_in_e2e.py @@ -281,6 +281,7 @@ def test_a_sign_in_becomes_secret_parameters_and_never_persists( _assert_nothing_holds_a_credential(tmp_path, capfd) _assert_fields_blacked_out(Path(program["task_dir"])) + _assert_no_pixel_check_froze_a_black_box(Path(program["bundle"]), workflow) # What `openadapt wrap publish` would upload holds no credential either, # and names the sign-in inputs as secret parameters, not call inputs. @@ -316,6 +317,20 @@ def test_a_sign_in_becomes_secret_parameters_and_never_persists( _assert_nothing_holds_a_credential(tmp_path, capfd) +def _assert_no_pixel_check_froze_a_black_box(bundle: Path, workflow) -> None: + """A REGION_STABLE crop over a withheld field would hold the recorder's + black box, which no live screen shows, and refute every hosted run.""" + import numpy as np + from PIL import Image + + for step in workflow.steps: + for pc in step.expect: + if pc.kind.value != "region_stable" or not pc.template: + continue + pixels = np.asarray(Image.open(bundle / pc.template).convert("L")) + assert (pixels <= 8).mean() < 0.05, (step.id, pc.template) + + def _assert_nothing_holds_a_credential( tmp_path: Path, capfd: pytest.CaptureFixture[str] ) -> None: From 2a5d269548a57ef8ea4ca002c7fc7ce5ec0b8f2f Mon Sep 17 00:00:00 2001 From: abrichr Date: Fri, 20 Nov 2026 20:20:23 -0500 Subject: [PATCH 2/7] docs: sign-in capability status and the withheld-field pixel rule --- CAPABILITIES.md | 2 +- llms-full.txt | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CAPABILITIES.md b/CAPABILITIES.md index 7f7a85d526..d9ca22c33b 100644 --- a/CAPABILITIES.md +++ b/CAPABILITIES.md @@ -319,7 +319,7 @@ improvising or retrying when something is off. | See what your own agent gets wrong, with no risk: `openadapt shadow` is a loopback pass-through proxy beside the agent. It checks each write against the system of record (FHIR through `ensure_record`; SQL through the verifier's whole-database frame), checks each `CONFIRMED` again later, and writes `report.html` and `report.json`. It never blocks, changes or resends a write; the only delay is the read before a write (at most `hold_ms`) | [#1678](https://github.com/OpenAdaptAI/OpenAdapt/pull/1678) | Real app (Medplum 5.2.8, 37 cases through a fault proxy: scripted agent 18 of 18 harms caught, 0 correct writes refuted; Claude Sonnet 5.5 9 of 9 caught, 4 correct but corrected writes refuted; 0 writes by the shadow; 15 to 25 ms median added per write; setup 76.5 s machine time, 3 decisions); real app, SQL mode (Dolibarr 21 on MariaDB 11.4, 13 cases: 8 of 8 harms caught, 5 of 5 correct writes confirmed, 292 ms median added); synthetic (SQLite) | `openadapt shadow`, [SHADOW_MODE.md](packages/flow/docs/SHADOW_MODE.md), [SHADOW_RESULTS.md](packages/flow/benchmark/fhir_medplum/public/SHADOW_RESULTS.md) | | Skill cache for framework agents: an agent in any framework does a browser task through compile-agent's harness as plain tools (`BrowserTools`); when the system of record shows exactly the task's record and the operator confirms the checks, the run is canaried, admitted and emitted as an MCP server. A repeat of the same task (instruction, record, app, contract, environment) calls that tool instead of the agent: no model calls, the program's checks and this task's record check on every run, eviction after a failed run | Released | Synthetic (MockMed, LangGraph on `claude-sonnet-5-5`, 3 trials, repeats on the same record: run 1 6 model calls and $0.022; runs 2 to 10 27/27 VERIFIED, 0 model calls, 7.8 s median); Trac 1.6: run 1 verified, not admitted | `openadapt_flow.integrations.agents.skills`, [benchmark/skill_cache](packages/flow/benchmark/skill_cache/README.md) | | Publish a wrapped task as a hosted endpoint with one credential: `openadapt wrap publish --task TASK` uses only `OPENADAPT_API_KEY`. It finds the task's admitted program, re-verifies its admission signature, refuses a held task, a program without a read-back check (no saving step, a save with no effect contract, or no confirmed `verify.yaml`), symbolic links and a non-public app URL, and stages the bundle with its read-back configuration. It sanitizes the bundle and the recording it was compiled from (the generated wrap files declare each field as content, always scrubbed, or structural, kept only with its machine shape, so schema ids, step ids, digests and the signed admission survive the scrub byte-for-byte), shows one summary and asks once (`--yes` for scripts), finds the key's organization (`GET /api/v1/whoami`, or `--org`), registers the local admission public key with it once, attests the program from the wrap run's own signed recording and attended canary (strict lint with no warn or error finding, certification, VERIFIED replay) against a challenge from the organization's API-key route, uploads it through the governed bundle push to `POST /api/v1/org/{org}/workflow` (or `PUT .../workflow/{id}/definition`), then reads the Cloud workflow definition and prints the endpoint URL and `curl` examples from the acknowledged `execute_path` and `qualification_id`. Each refusal is one line with a code. The upload carries the program's value-free Standard run shape. A managed run of the program rests on its signed admission: `openadapt-flow run --managed-dispatch-file` checks the admission against the registered admission key, requires the authorization to name that admission and match the shape, and reads back through the bundled `verify.yaml`. The CLI, public runtime and deployment API carry one-use verification bound to that dispatch's admission, bundle, inputs, policy, run, session and current trust registry; resume verifies a fresh proof. Each input checks that scope again after preparation and requires a signed v3 permit with a receiver-checked exclusive start deadline. API sequences acknowledge every request separately. Missing receipts or late completion evidence halt further input and require reconciliation. Publish refuses, before anything is uploaded, an admission mode a hosted run cannot verify (only a person's admission or a registered CI admitter key), and an admitter-key admission whose key the organization has not registered (`GET /api/v1/org/{org}/admitter-keys`). The recording stays on the machine; only its sanitized hash is attested. Regulated is refused (`openadapt_flow.jit.hosted_authority`) | On main | Unit tests (real bundle, record check, staging, local sanitization and signed wrap evidence; the attestation's recording binding checked on real derivatives; the whoami, admission-key, challenge, workflow upload and definition routes mocked at the HTTP boundary); no run against a live Cloud deployment. Relies on the API-key workflow routes in openadapt-cloud#430 (draft), which accept this v2 attestation only behind a flag that is off by default; the whoami route is not in #430 yet | `openadapt_flow.wrap.publish`, [WRAP_PUBLISH.md](packages/flow/docs/WRAP_PUBLISH.md), `packages/flow/tests/test_wrap_publish.py`, `packages/flow/tests/test_jit_hosted_authority.py`, `packages/flow/tests/test_jit_hosted_managed_replay.py` | -| Wrapped tasks that sign in: during `openadapt wrap`'s first run the recorder finds a password field (`type=password`, or `autocomplete` `current-password`/`new-password`) and the username field paired with it (`autocomplete=username`, or a unique text, email or phone candidate paired across all password controls in the composed form; ambiguous or unreadable controls refuse declared inputs) from the page's markup alone. Automatic withholding requires that observation seam; a missing or noncallable seam refuses before capture or actor entry. Screen-only native backends use the existing explicit person-secret handoff instead of this automatic path. Their inputs become secret parameters: the recording, program, run records, receipts and publish upload keep the name and never the value, the observed field regions are blacked out in recording frames (arbitrary field movement or echoes are not proven redacted), a credential field given text that matches no declared input is refused before typing, a form with exactly a username and current password is classified as sign-in without lowering independent keyword risk, and replay run screenshots contain black frames while checks use the original pixels in memory. Secret environment/vault aliases must be unambiguous, and managed params files cannot supply secret values. The canary and cached runs type them from `OPENADAPT_FLOW_SECRET_`, set from memory for one run; `publish` lists them as `secret_parameters`, outside the call's inputs | In PR [#2294](https://github.com/OpenAdaptAI/OpenAdapt/pull/2294) | Synthetic (a sign-in notes app in headless Chromium through the real wrap path: first run, canary, admission, publish staging, and a cached run under mcp 2, with a byte scan for the values in every file; unit tests with a fake backend for detection, frame redaction, refusals and the sign-in submit rule). Genuine RDP/Citrix backends refuse automatic withholding before input; explicit person-secret handoff remains tested. Hosted runs need an endpoint vault set (openadapt-cloud) | `openadapt_flow.recorder` (`withhold_credentials`), `openadapt_flow.secret_inputs`, [WRAP_PUBLISH.md](packages/flow/docs/WRAP_PUBLISH.md#tasks-that-sign-in), `packages/flow/tests/test_wrap_sign_in.py`, `packages/flow/tests/e2e/test_wrap_sign_in_e2e.py` | +| Wrapped tasks that sign in: during `openadapt wrap`'s first run the recorder finds a password field (`type=password`, or `autocomplete` `current-password`/`new-password`) and the username field paired with it (`autocomplete=username`, or a unique text, email or phone candidate paired across all password controls in the composed form; ambiguous or unreadable controls refuse declared inputs) from the page's markup alone. Automatic withholding requires that observation seam; a missing or noncallable seam refuses before capture or actor entry. Screen-only native backends use the existing explicit person-secret handoff instead of this automatic path. Their inputs become secret parameters: the recording, program, run records, receipts and publish upload keep the name and never the value, the observed field regions are blacked out in recording frames (arbitrary field movement or echoes are not proven redacted), a credential field given text that matches no declared input is refused before typing, a form with exactly a username and current password is classified as sign-in without lowering independent keyword risk, and replay run screenshots contain black frames while checks use the original pixels in memory, and no compiled pixel check covers a withheld field's black box (it is clipped clear of it or dropped). Secret environment/vault aliases must be unambiguous, and managed params files cannot supply secret values. The canary and cached runs type them from `OPENADAPT_FLOW_SECRET_`, set from memory for one run; `publish` lists them as `secret_parameters`, outside the call's inputs | On main ([#2352](https://github.com/OpenAdaptAI/OpenAdapt/pull/2352), [#2367](https://github.com/OpenAdaptAI/OpenAdapt/pull/2367)) | Synthetic (a sign-in notes app in headless Chromium through the real wrap path: first run, canary, admission, publish staging, and a cached run under mcp 2, with a byte scan for the values in every file; unit tests with a fake backend for detection, frame redaction, refusals and the sign-in submit rule). Genuine RDP/Citrix backends refuse automatic withholding before input; explicit person-secret handoff remains tested. Hosted runs need an endpoint vault set (openadapt-cloud); on staging, hosted runs signed in from the vault set with neither value in any stored table, object, log or receipt, but stop at an irreversible Save that waits for a per-item approval the managed path cannot deliver yet, so none is VERIFIED | `openadapt_flow.recorder` (`withhold_credentials`), `openadapt_flow.secret_inputs`, [WRAP_PUBLISH.md](packages/flow/docs/WRAP_PUBLISH.md#tasks-that-sign-in), `packages/flow/tests/test_wrap_sign_in.py`, `packages/flow/tests/e2e/test_wrap_sign_in_e2e.py` | | Verified write tools for agent frameworks: `verified(tool, contract=...)` wraps a Claude Agent SDK, OpenAI Agents SDK, LangGraph or CrewAI write tool in one line. The contract and any values the operator pins come from the operator, never the agent's arguments; the store is read before and after; the agent gets a receipt or a refusal, and a refused write is held instead of retried | Released | Synthetic (each framework's own agent loop with a scripted model, writing through the example app's order form over real HTTP: verified save, a save the app drops, a save it keeps twice); one real-model run per framework, opt-in | `openadapt_flow.integrations.agents`, extras `claude-agent-sdk`, `openai-agents`, `langgraph` (CrewAI: install `crewai` beside it); [AGENT_FRAMEWORKS.md](packages/flow/docs/AGENT_FRAMEWORKS.md) | | Teach a browser write as a verified tool: with write contracts and a person's signed teach authorization (`serve --teach-browser --contracts DIR --teach-authorization STATEMENT`), the agent teaches a save once. Run 1 starts only when the statement covers the write (origin, contract, write adapter, the record's fields and values) and runs under it; it is verified in the system of record before the `taught_` tool exists. Every call checks the statement and the tool's signature again, makes the write and returns a verified receipt or a refusal. Sign-in values come from the server's environment and never reach the agent or the program. Controls in named iframes are found through their frame | On main ([#1589](https://github.com/OpenAdaptAI/OpenAdapt/pull/1589), [#1763](https://github.com/OpenAdaptAI/OpenAdapt/pull/1763)) | Synthetic (the example app's sign-in and order form in headless Chromium over MCP: verified save, a save the app drops, a save it keeps twice, a page that swaps the record during run 1; refusals for a missing, uncovering, expired, edited or wrongly signed statement) | `openadapt-agent serve --teach-browser --contracts --teach-authorization`, [VERIFY_WRITES.md](packages/flow/docs/VERIFY_WRITES.md#teach-a-write-as-a-tool) | | Guard an agent you already run: attach to its own Chromium over CDP (one added line), hold each save until the record on screen is the one the task names, block it and tell the agent why when it isn't, read the save back; a run that reads back correctly becomes a draft program with a record check from scaffold-verifier, which a person confirms and admits, then a `taught_*` tool with no model calls. `--observe-only` never blocks | Released ([#1357](https://github.com/OpenAdaptAI/OpenAdapt/pull/1357), stacked on [#1335](https://github.com/OpenAdaptAI/OpenAdapt/pull/1335)) | Synthetic (MockMed, scripted Playwright agent, `effect_e2e` faults) | `openadapt-flow guard`, [GUARD_AN_AGENT.md](packages/flow/docs/GUARD_AN_AGENT.md) | diff --git a/llms-full.txt b/llms-full.txt index c74a23a193..4c80146910 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -753,7 +753,7 @@ improvising or retrying when something is off. | See what your own agent gets wrong, with no risk: `openadapt shadow` is a loopback pass-through proxy beside the agent. It checks each write against the system of record (FHIR through `ensure_record`; SQL through the verifier's whole-database frame), checks each `CONFIRMED` again later, and writes `report.html` and `report.json`. It never blocks, changes or resends a write; the only delay is the read before a write (at most `hold_ms`) | [#1678](https://github.com/OpenAdaptAI/OpenAdapt/pull/1678) | Real app (Medplum 5.2.8, 37 cases through a fault proxy: scripted agent 18 of 18 harms caught, 0 correct writes refuted; Claude Sonnet 5.5 9 of 9 caught, 4 correct but corrected writes refuted; 0 writes by the shadow; 15 to 25 ms median added per write; setup 76.5 s machine time, 3 decisions); real app, SQL mode (Dolibarr 21 on MariaDB 11.4, 13 cases: 8 of 8 harms caught, 5 of 5 correct writes confirmed, 292 ms median added); synthetic (SQLite) | `openadapt shadow`, [SHADOW_MODE.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/SHADOW_MODE.md), [SHADOW_RESULTS.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/benchmark/fhir_medplum/public/SHADOW_RESULTS.md) | | Skill cache for framework agents: an agent in any framework does a browser task through compile-agent's harness as plain tools (`BrowserTools`); when the system of record shows exactly the task's record and the operator confirms the checks, the run is canaried, admitted and emitted as an MCP server. A repeat of the same task (instruction, record, app, contract, environment) calls that tool instead of the agent: no model calls, the program's checks and this task's record check on every run, eviction after a failed run | Released | Synthetic (MockMed, LangGraph on `claude-sonnet-5-5`, 3 trials, repeats on the same record: run 1 6 model calls and $0.022; runs 2 to 10 27/27 VERIFIED, 0 model calls, 7.8 s median); Trac 1.6: run 1 verified, not admitted | `openadapt_flow.integrations.agents.skills`, [benchmark/skill_cache](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/benchmark/skill_cache/README.md) | | Publish a wrapped task as a hosted endpoint with one credential: `openadapt wrap publish --task TASK` uses only `OPENADAPT_API_KEY`. It finds the task's admitted program, re-verifies its admission signature, refuses a held task, a program without a read-back check (no saving step, a save with no effect contract, or no confirmed `verify.yaml`), symbolic links and a non-public app URL, and stages the bundle with its read-back configuration. It sanitizes the bundle and the recording it was compiled from (the generated wrap files declare each field as content, always scrubbed, or structural, kept only with its machine shape, so schema ids, step ids, digests and the signed admission survive the scrub byte-for-byte), shows one summary and asks once (`--yes` for scripts), finds the key's organization (`GET /api/v1/whoami`, or `--org`), registers the local admission public key with it once, attests the program from the wrap run's own signed recording and attended canary (strict lint with no warn or error finding, certification, VERIFIED replay) against a challenge from the organization's API-key route, uploads it through the governed bundle push to `POST /api/v1/org/{org}/workflow` (or `PUT .../workflow/{id}/definition`), then reads the Cloud workflow definition and prints the endpoint URL and `curl` examples from the acknowledged `execute_path` and `qualification_id`. Each refusal is one line with a code. The upload carries the program's value-free Standard run shape. A managed run of the program rests on its signed admission: `openadapt-flow run --managed-dispatch-file` checks the admission against the registered admission key, requires the authorization to name that admission and match the shape, and reads back through the bundled `verify.yaml`. The CLI, public runtime and deployment API carry one-use verification bound to that dispatch's admission, bundle, inputs, policy, run, session and current trust registry; resume verifies a fresh proof. Each input checks that scope again after preparation and requires a signed v3 permit with a receiver-checked exclusive start deadline. API sequences acknowledge every request separately. Missing receipts or late completion evidence halt further input and require reconciliation. Publish refuses, before anything is uploaded, an admission mode a hosted run cannot verify (only a person's admission or a registered CI admitter key), and an admitter-key admission whose key the organization has not registered (`GET /api/v1/org/{org}/admitter-keys`). The recording stays on the machine; only its sanitized hash is attested. Regulated is refused (`openadapt_flow.jit.hosted_authority`) | On main | Unit tests (real bundle, record check, staging, local sanitization and signed wrap evidence; the attestation's recording binding checked on real derivatives; the whoami, admission-key, challenge, workflow upload and definition routes mocked at the HTTP boundary); no run against a live Cloud deployment. Relies on the API-key workflow routes in openadapt-cloud#430 (draft), which accept this v2 attestation only behind a flag that is off by default; the whoami route is not in #430 yet | `openadapt_flow.wrap.publish`, [WRAP_PUBLISH.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/WRAP_PUBLISH.md), `packages/flow/tests/test_wrap_publish.py`, `packages/flow/tests/test_jit_hosted_authority.py`, `packages/flow/tests/test_jit_hosted_managed_replay.py` | -| Wrapped tasks that sign in: during `openadapt wrap`'s first run the recorder finds a password field (`type=password`, or `autocomplete` `current-password`/`new-password`) and the username field paired with it (`autocomplete=username`, or a unique text, email or phone candidate paired across all password controls in the composed form; ambiguous or unreadable controls refuse declared inputs) from the page's markup alone. Automatic withholding requires that observation seam; a missing or noncallable seam refuses before capture or actor entry. Screen-only native backends use the existing explicit person-secret handoff instead of this automatic path. Their inputs become secret parameters: the recording, program, run records, receipts and publish upload keep the name and never the value, the observed field regions are blacked out in recording frames (arbitrary field movement or echoes are not proven redacted), a credential field given text that matches no declared input is refused before typing, a form with exactly a username and current password is classified as sign-in without lowering independent keyword risk, and replay run screenshots contain black frames while checks use the original pixels in memory. Secret environment/vault aliases must be unambiguous, and managed params files cannot supply secret values. The canary and cached runs type them from `OPENADAPT_FLOW_SECRET_`, set from memory for one run; `publish` lists them as `secret_parameters`, outside the call's inputs | In PR [#2294](https://github.com/OpenAdaptAI/OpenAdapt/pull/2294) | Synthetic (a sign-in notes app in headless Chromium through the real wrap path: first run, canary, admission, publish staging, and a cached run under mcp 2, with a byte scan for the values in every file; unit tests with a fake backend for detection, frame redaction, refusals and the sign-in submit rule). Genuine RDP/Citrix backends refuse automatic withholding before input; explicit person-secret handoff remains tested. Hosted runs need an endpoint vault set (openadapt-cloud) | `openadapt_flow.recorder` (`withhold_credentials`), `openadapt_flow.secret_inputs`, [WRAP_PUBLISH.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/WRAP_PUBLISH.md#tasks-that-sign-in), `packages/flow/tests/test_wrap_sign_in.py`, `packages/flow/tests/e2e/test_wrap_sign_in_e2e.py` | +| Wrapped tasks that sign in: during `openadapt wrap`'s first run the recorder finds a password field (`type=password`, or `autocomplete` `current-password`/`new-password`) and the username field paired with it (`autocomplete=username`, or a unique text, email or phone candidate paired across all password controls in the composed form; ambiguous or unreadable controls refuse declared inputs) from the page's markup alone. Automatic withholding requires that observation seam; a missing or noncallable seam refuses before capture or actor entry. Screen-only native backends use the existing explicit person-secret handoff instead of this automatic path. Their inputs become secret parameters: the recording, program, run records, receipts and publish upload keep the name and never the value, the observed field regions are blacked out in recording frames (arbitrary field movement or echoes are not proven redacted), a credential field given text that matches no declared input is refused before typing, a form with exactly a username and current password is classified as sign-in without lowering independent keyword risk, and replay run screenshots contain black frames while checks use the original pixels in memory, and no compiled pixel check covers a withheld field's black box (it is clipped clear of it or dropped). Secret environment/vault aliases must be unambiguous, and managed params files cannot supply secret values. The canary and cached runs type them from `OPENADAPT_FLOW_SECRET_`, set from memory for one run; `publish` lists them as `secret_parameters`, outside the call's inputs | On main ([#2352](https://github.com/OpenAdaptAI/OpenAdapt/pull/2352), [#2367](https://github.com/OpenAdaptAI/OpenAdapt/pull/2367)) | Synthetic (a sign-in notes app in headless Chromium through the real wrap path: first run, canary, admission, publish staging, and a cached run under mcp 2, with a byte scan for the values in every file; unit tests with a fake backend for detection, frame redaction, refusals and the sign-in submit rule). Genuine RDP/Citrix backends refuse automatic withholding before input; explicit person-secret handoff remains tested. Hosted runs need an endpoint vault set (openadapt-cloud); on staging, hosted runs signed in from the vault set with neither value in any stored table, object, log or receipt, but stop at an irreversible Save that waits for a per-item approval the managed path cannot deliver yet, so none is VERIFIED | `openadapt_flow.recorder` (`withhold_credentials`), `openadapt_flow.secret_inputs`, [WRAP_PUBLISH.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/WRAP_PUBLISH.md#tasks-that-sign-in), `packages/flow/tests/test_wrap_sign_in.py`, `packages/flow/tests/e2e/test_wrap_sign_in_e2e.py` | | Verified write tools for agent frameworks: `verified(tool, contract=...)` wraps a Claude Agent SDK, OpenAI Agents SDK, LangGraph or CrewAI write tool in one line. The contract and any values the operator pins come from the operator, never the agent's arguments; the store is read before and after; the agent gets a receipt or a refusal, and a refused write is held instead of retried | Released | Synthetic (each framework's own agent loop with a scripted model, writing through the example app's order form over real HTTP: verified save, a save the app drops, a save it keeps twice); one real-model run per framework, opt-in | `openadapt_flow.integrations.agents`, extras `claude-agent-sdk`, `openai-agents`, `langgraph` (CrewAI: install `crewai` beside it); [AGENT_FRAMEWORKS.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/AGENT_FRAMEWORKS.md) | | Teach a browser write as a verified tool: with write contracts and a person's signed teach authorization (`serve --teach-browser --contracts DIR --teach-authorization STATEMENT`), the agent teaches a save once. Run 1 starts only when the statement covers the write (origin, contract, write adapter, the record's fields and values) and runs under it; it is verified in the system of record before the `taught_` tool exists. Every call checks the statement and the tool's signature again, makes the write and returns a verified receipt or a refusal. Sign-in values come from the server's environment and never reach the agent or the program. Controls in named iframes are found through their frame | On main ([#1589](https://github.com/OpenAdaptAI/OpenAdapt/pull/1589), [#1763](https://github.com/OpenAdaptAI/OpenAdapt/pull/1763)) | Synthetic (the example app's sign-in and order form in headless Chromium over MCP: verified save, a save the app drops, a save it keeps twice, a page that swaps the record during run 1; refusals for a missing, uncovering, expired, edited or wrongly signed statement) | `openadapt-agent serve --teach-browser --contracts --teach-authorization`, [VERIFY_WRITES.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/VERIFY_WRITES.md#teach-a-write-as-a-tool) | | Guard an agent you already run: attach to its own Chromium over CDP (one added line), hold each save until the record on screen is the one the task names, block it and tell the agent why when it isn't, read the save back; a run that reads back correctly becomes a draft program with a record check from scaffold-verifier, which a person confirms and admits, then a `taught_*` tool with no model calls. `--observe-only` never blocks | Released ([#1357](https://github.com/OpenAdaptAI/OpenAdapt/pull/1357), stacked on [#1335](https://github.com/OpenAdaptAI/OpenAdapt/pull/1335)) | Synthetic (MockMed, scripted Playwright agent, `effect_e2e` faults) | `openadapt-flow guard`, [GUARD_AN_AGENT.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/GUARD_AN_AGENT.md) | @@ -2426,6 +2426,16 @@ automation into an independently certified transaction system. ### Fixes +- A wrapped sign-in no longer compiles a pixel check that freezes a withheld + credential field. The recorder blacks out a withheld field in every frame + that still shows it, so a `REGION_STABLE` crop that overlapped one held a + black box that no live screen shows. That refuted the step on every hosted + run, for example the click into the password field. Such a check is now + clipped to the part of its region clear of the box and re-cropped from the + same frame. When no usable part is left, it is dropped and recorded in + `param_hygiene.json`. This applies to mined checks and to the + focused-field pass. + - Choice labels, values, shape metadata and browser-dialog messages are checked against declared secrets before capture. A matching or opaque secret boundary stops recording before that text reaches its artifacts. From 653e6db59334178a43f53b2feaa1f2580bfac022 Mon Sep 17 00:00:00 2001 From: abrichr Date: Fri, 20 Nov 2026 20:33:49 -0500 Subject: [PATCH 3/7] test(flow): unit tests for clipping pixel checks off withheld fields --- CAPABILITIES.md | 2 +- llms-full.txt | 2 +- .../tests/test_compile_withheld_fields.py | 111 ++++++++++++++++++ 3 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 packages/flow/tests/test_compile_withheld_fields.py diff --git a/CAPABILITIES.md b/CAPABILITIES.md index d9ca22c33b..d1ff3829c6 100644 --- a/CAPABILITIES.md +++ b/CAPABILITIES.md @@ -319,7 +319,7 @@ improvising or retrying when something is off. | See what your own agent gets wrong, with no risk: `openadapt shadow` is a loopback pass-through proxy beside the agent. It checks each write against the system of record (FHIR through `ensure_record`; SQL through the verifier's whole-database frame), checks each `CONFIRMED` again later, and writes `report.html` and `report.json`. It never blocks, changes or resends a write; the only delay is the read before a write (at most `hold_ms`) | [#1678](https://github.com/OpenAdaptAI/OpenAdapt/pull/1678) | Real app (Medplum 5.2.8, 37 cases through a fault proxy: scripted agent 18 of 18 harms caught, 0 correct writes refuted; Claude Sonnet 5.5 9 of 9 caught, 4 correct but corrected writes refuted; 0 writes by the shadow; 15 to 25 ms median added per write; setup 76.5 s machine time, 3 decisions); real app, SQL mode (Dolibarr 21 on MariaDB 11.4, 13 cases: 8 of 8 harms caught, 5 of 5 correct writes confirmed, 292 ms median added); synthetic (SQLite) | `openadapt shadow`, [SHADOW_MODE.md](packages/flow/docs/SHADOW_MODE.md), [SHADOW_RESULTS.md](packages/flow/benchmark/fhir_medplum/public/SHADOW_RESULTS.md) | | Skill cache for framework agents: an agent in any framework does a browser task through compile-agent's harness as plain tools (`BrowserTools`); when the system of record shows exactly the task's record and the operator confirms the checks, the run is canaried, admitted and emitted as an MCP server. A repeat of the same task (instruction, record, app, contract, environment) calls that tool instead of the agent: no model calls, the program's checks and this task's record check on every run, eviction after a failed run | Released | Synthetic (MockMed, LangGraph on `claude-sonnet-5-5`, 3 trials, repeats on the same record: run 1 6 model calls and $0.022; runs 2 to 10 27/27 VERIFIED, 0 model calls, 7.8 s median); Trac 1.6: run 1 verified, not admitted | `openadapt_flow.integrations.agents.skills`, [benchmark/skill_cache](packages/flow/benchmark/skill_cache/README.md) | | Publish a wrapped task as a hosted endpoint with one credential: `openadapt wrap publish --task TASK` uses only `OPENADAPT_API_KEY`. It finds the task's admitted program, re-verifies its admission signature, refuses a held task, a program without a read-back check (no saving step, a save with no effect contract, or no confirmed `verify.yaml`), symbolic links and a non-public app URL, and stages the bundle with its read-back configuration. It sanitizes the bundle and the recording it was compiled from (the generated wrap files declare each field as content, always scrubbed, or structural, kept only with its machine shape, so schema ids, step ids, digests and the signed admission survive the scrub byte-for-byte), shows one summary and asks once (`--yes` for scripts), finds the key's organization (`GET /api/v1/whoami`, or `--org`), registers the local admission public key with it once, attests the program from the wrap run's own signed recording and attended canary (strict lint with no warn or error finding, certification, VERIFIED replay) against a challenge from the organization's API-key route, uploads it through the governed bundle push to `POST /api/v1/org/{org}/workflow` (or `PUT .../workflow/{id}/definition`), then reads the Cloud workflow definition and prints the endpoint URL and `curl` examples from the acknowledged `execute_path` and `qualification_id`. Each refusal is one line with a code. The upload carries the program's value-free Standard run shape. A managed run of the program rests on its signed admission: `openadapt-flow run --managed-dispatch-file` checks the admission against the registered admission key, requires the authorization to name that admission and match the shape, and reads back through the bundled `verify.yaml`. The CLI, public runtime and deployment API carry one-use verification bound to that dispatch's admission, bundle, inputs, policy, run, session and current trust registry; resume verifies a fresh proof. Each input checks that scope again after preparation and requires a signed v3 permit with a receiver-checked exclusive start deadline. API sequences acknowledge every request separately. Missing receipts or late completion evidence halt further input and require reconciliation. Publish refuses, before anything is uploaded, an admission mode a hosted run cannot verify (only a person's admission or a registered CI admitter key), and an admitter-key admission whose key the organization has not registered (`GET /api/v1/org/{org}/admitter-keys`). The recording stays on the machine; only its sanitized hash is attested. Regulated is refused (`openadapt_flow.jit.hosted_authority`) | On main | Unit tests (real bundle, record check, staging, local sanitization and signed wrap evidence; the attestation's recording binding checked on real derivatives; the whoami, admission-key, challenge, workflow upload and definition routes mocked at the HTTP boundary); no run against a live Cloud deployment. Relies on the API-key workflow routes in openadapt-cloud#430 (draft), which accept this v2 attestation only behind a flag that is off by default; the whoami route is not in #430 yet | `openadapt_flow.wrap.publish`, [WRAP_PUBLISH.md](packages/flow/docs/WRAP_PUBLISH.md), `packages/flow/tests/test_wrap_publish.py`, `packages/flow/tests/test_jit_hosted_authority.py`, `packages/flow/tests/test_jit_hosted_managed_replay.py` | -| Wrapped tasks that sign in: during `openadapt wrap`'s first run the recorder finds a password field (`type=password`, or `autocomplete` `current-password`/`new-password`) and the username field paired with it (`autocomplete=username`, or a unique text, email or phone candidate paired across all password controls in the composed form; ambiguous or unreadable controls refuse declared inputs) from the page's markup alone. Automatic withholding requires that observation seam; a missing or noncallable seam refuses before capture or actor entry. Screen-only native backends use the existing explicit person-secret handoff instead of this automatic path. Their inputs become secret parameters: the recording, program, run records, receipts and publish upload keep the name and never the value, the observed field regions are blacked out in recording frames (arbitrary field movement or echoes are not proven redacted), a credential field given text that matches no declared input is refused before typing, a form with exactly a username and current password is classified as sign-in without lowering independent keyword risk, and replay run screenshots contain black frames while checks use the original pixels in memory, and no compiled pixel check covers a withheld field's black box (it is clipped clear of it or dropped). Secret environment/vault aliases must be unambiguous, and managed params files cannot supply secret values. The canary and cached runs type them from `OPENADAPT_FLOW_SECRET_`, set from memory for one run; `publish` lists them as `secret_parameters`, outside the call's inputs | On main ([#2352](https://github.com/OpenAdaptAI/OpenAdapt/pull/2352), [#2367](https://github.com/OpenAdaptAI/OpenAdapt/pull/2367)) | Synthetic (a sign-in notes app in headless Chromium through the real wrap path: first run, canary, admission, publish staging, and a cached run under mcp 2, with a byte scan for the values in every file; unit tests with a fake backend for detection, frame redaction, refusals and the sign-in submit rule). Genuine RDP/Citrix backends refuse automatic withholding before input; explicit person-secret handoff remains tested. Hosted runs need an endpoint vault set (openadapt-cloud); on staging, hosted runs signed in from the vault set with neither value in any stored table, object, log or receipt, but stop at an irreversible Save that waits for a per-item approval the managed path cannot deliver yet, so none is VERIFIED | `openadapt_flow.recorder` (`withhold_credentials`), `openadapt_flow.secret_inputs`, [WRAP_PUBLISH.md](packages/flow/docs/WRAP_PUBLISH.md#tasks-that-sign-in), `packages/flow/tests/test_wrap_sign_in.py`, `packages/flow/tests/e2e/test_wrap_sign_in_e2e.py` | +| Wrapped tasks that sign in: during `openadapt wrap`'s first run the recorder finds a password field (`type=password`, or `autocomplete` `current-password`/`new-password`) and the username field paired with it (`autocomplete=username`, or a unique text, email or phone candidate paired across all password controls in the composed form; ambiguous or unreadable controls refuse declared inputs) from the page's markup alone. Automatic withholding requires that observation seam; a missing or noncallable seam refuses before capture or actor entry. Screen-only native backends use the existing explicit person-secret handoff instead of this automatic path. Their inputs become secret parameters: the recording, program, run records, receipts and publish upload keep the name and never the value, the observed field regions are blacked out in recording frames (arbitrary field movement or echoes are not proven redacted), a credential field given text that matches no declared input is refused before typing, a form with exactly a username and current password is classified as sign-in without lowering independent keyword risk, and replay run screenshots contain black frames while checks use the original pixels in memory, and no compiled pixel check covers a withheld field's black box (it is clipped clear of it or dropped). Secret environment/vault aliases must be unambiguous, and managed params files cannot supply secret values. The canary and cached runs type them from `OPENADAPT_FLOW_SECRET_`, set from memory for one run; `publish` lists them as `secret_parameters`, outside the call's inputs | On main ([#2352](https://github.com/OpenAdaptAI/OpenAdapt/pull/2352), [#2367](https://github.com/OpenAdaptAI/OpenAdapt/pull/2367)) | Synthetic (a sign-in notes app in headless Chromium through the real wrap path: first run, canary, admission, publish staging, and a cached run under mcp 2, with a byte scan for the values in every file; unit tests with a fake backend for detection, frame redaction, refusals and the sign-in submit rule). Genuine RDP/Citrix backends refuse automatic withholding before input; explicit person-secret handoff remains tested. Hosted runs need an endpoint vault set (openadapt-cloud); on staging, hosted runs signed in from the vault set with neither value in any stored table, object, log or receipt, and stop at an irreversible Save that requires a per-item approval, which the managed path does not deliver, so none is VERIFIED | `openadapt_flow.recorder` (`withhold_credentials`), `openadapt_flow.secret_inputs`, [WRAP_PUBLISH.md](packages/flow/docs/WRAP_PUBLISH.md#tasks-that-sign-in), `packages/flow/tests/test_wrap_sign_in.py`, `packages/flow/tests/e2e/test_wrap_sign_in_e2e.py` | | Verified write tools for agent frameworks: `verified(tool, contract=...)` wraps a Claude Agent SDK, OpenAI Agents SDK, LangGraph or CrewAI write tool in one line. The contract and any values the operator pins come from the operator, never the agent's arguments; the store is read before and after; the agent gets a receipt or a refusal, and a refused write is held instead of retried | Released | Synthetic (each framework's own agent loop with a scripted model, writing through the example app's order form over real HTTP: verified save, a save the app drops, a save it keeps twice); one real-model run per framework, opt-in | `openadapt_flow.integrations.agents`, extras `claude-agent-sdk`, `openai-agents`, `langgraph` (CrewAI: install `crewai` beside it); [AGENT_FRAMEWORKS.md](packages/flow/docs/AGENT_FRAMEWORKS.md) | | Teach a browser write as a verified tool: with write contracts and a person's signed teach authorization (`serve --teach-browser --contracts DIR --teach-authorization STATEMENT`), the agent teaches a save once. Run 1 starts only when the statement covers the write (origin, contract, write adapter, the record's fields and values) and runs under it; it is verified in the system of record before the `taught_` tool exists. Every call checks the statement and the tool's signature again, makes the write and returns a verified receipt or a refusal. Sign-in values come from the server's environment and never reach the agent or the program. Controls in named iframes are found through their frame | On main ([#1589](https://github.com/OpenAdaptAI/OpenAdapt/pull/1589), [#1763](https://github.com/OpenAdaptAI/OpenAdapt/pull/1763)) | Synthetic (the example app's sign-in and order form in headless Chromium over MCP: verified save, a save the app drops, a save it keeps twice, a page that swaps the record during run 1; refusals for a missing, uncovering, expired, edited or wrongly signed statement) | `openadapt-agent serve --teach-browser --contracts --teach-authorization`, [VERIFY_WRITES.md](packages/flow/docs/VERIFY_WRITES.md#teach-a-write-as-a-tool) | | Guard an agent you already run: attach to its own Chromium over CDP (one added line), hold each save until the record on screen is the one the task names, block it and tell the agent why when it isn't, read the save back; a run that reads back correctly becomes a draft program with a record check from scaffold-verifier, which a person confirms and admits, then a `taught_*` tool with no model calls. `--observe-only` never blocks | Released ([#1357](https://github.com/OpenAdaptAI/OpenAdapt/pull/1357), stacked on [#1335](https://github.com/OpenAdaptAI/OpenAdapt/pull/1335)) | Synthetic (MockMed, scripted Playwright agent, `effect_e2e` faults) | `openadapt-flow guard`, [GUARD_AN_AGENT.md](packages/flow/docs/GUARD_AN_AGENT.md) | diff --git a/llms-full.txt b/llms-full.txt index 4c80146910..a7580ff064 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -753,7 +753,7 @@ improvising or retrying when something is off. | See what your own agent gets wrong, with no risk: `openadapt shadow` is a loopback pass-through proxy beside the agent. It checks each write against the system of record (FHIR through `ensure_record`; SQL through the verifier's whole-database frame), checks each `CONFIRMED` again later, and writes `report.html` and `report.json`. It never blocks, changes or resends a write; the only delay is the read before a write (at most `hold_ms`) | [#1678](https://github.com/OpenAdaptAI/OpenAdapt/pull/1678) | Real app (Medplum 5.2.8, 37 cases through a fault proxy: scripted agent 18 of 18 harms caught, 0 correct writes refuted; Claude Sonnet 5.5 9 of 9 caught, 4 correct but corrected writes refuted; 0 writes by the shadow; 15 to 25 ms median added per write; setup 76.5 s machine time, 3 decisions); real app, SQL mode (Dolibarr 21 on MariaDB 11.4, 13 cases: 8 of 8 harms caught, 5 of 5 correct writes confirmed, 292 ms median added); synthetic (SQLite) | `openadapt shadow`, [SHADOW_MODE.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/SHADOW_MODE.md), [SHADOW_RESULTS.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/benchmark/fhir_medplum/public/SHADOW_RESULTS.md) | | Skill cache for framework agents: an agent in any framework does a browser task through compile-agent's harness as plain tools (`BrowserTools`); when the system of record shows exactly the task's record and the operator confirms the checks, the run is canaried, admitted and emitted as an MCP server. A repeat of the same task (instruction, record, app, contract, environment) calls that tool instead of the agent: no model calls, the program's checks and this task's record check on every run, eviction after a failed run | Released | Synthetic (MockMed, LangGraph on `claude-sonnet-5-5`, 3 trials, repeats on the same record: run 1 6 model calls and $0.022; runs 2 to 10 27/27 VERIFIED, 0 model calls, 7.8 s median); Trac 1.6: run 1 verified, not admitted | `openadapt_flow.integrations.agents.skills`, [benchmark/skill_cache](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/benchmark/skill_cache/README.md) | | Publish a wrapped task as a hosted endpoint with one credential: `openadapt wrap publish --task TASK` uses only `OPENADAPT_API_KEY`. It finds the task's admitted program, re-verifies its admission signature, refuses a held task, a program without a read-back check (no saving step, a save with no effect contract, or no confirmed `verify.yaml`), symbolic links and a non-public app URL, and stages the bundle with its read-back configuration. It sanitizes the bundle and the recording it was compiled from (the generated wrap files declare each field as content, always scrubbed, or structural, kept only with its machine shape, so schema ids, step ids, digests and the signed admission survive the scrub byte-for-byte), shows one summary and asks once (`--yes` for scripts), finds the key's organization (`GET /api/v1/whoami`, or `--org`), registers the local admission public key with it once, attests the program from the wrap run's own signed recording and attended canary (strict lint with no warn or error finding, certification, VERIFIED replay) against a challenge from the organization's API-key route, uploads it through the governed bundle push to `POST /api/v1/org/{org}/workflow` (or `PUT .../workflow/{id}/definition`), then reads the Cloud workflow definition and prints the endpoint URL and `curl` examples from the acknowledged `execute_path` and `qualification_id`. Each refusal is one line with a code. The upload carries the program's value-free Standard run shape. A managed run of the program rests on its signed admission: `openadapt-flow run --managed-dispatch-file` checks the admission against the registered admission key, requires the authorization to name that admission and match the shape, and reads back through the bundled `verify.yaml`. The CLI, public runtime and deployment API carry one-use verification bound to that dispatch's admission, bundle, inputs, policy, run, session and current trust registry; resume verifies a fresh proof. Each input checks that scope again after preparation and requires a signed v3 permit with a receiver-checked exclusive start deadline. API sequences acknowledge every request separately. Missing receipts or late completion evidence halt further input and require reconciliation. Publish refuses, before anything is uploaded, an admission mode a hosted run cannot verify (only a person's admission or a registered CI admitter key), and an admitter-key admission whose key the organization has not registered (`GET /api/v1/org/{org}/admitter-keys`). The recording stays on the machine; only its sanitized hash is attested. Regulated is refused (`openadapt_flow.jit.hosted_authority`) | On main | Unit tests (real bundle, record check, staging, local sanitization and signed wrap evidence; the attestation's recording binding checked on real derivatives; the whoami, admission-key, challenge, workflow upload and definition routes mocked at the HTTP boundary); no run against a live Cloud deployment. Relies on the API-key workflow routes in openadapt-cloud#430 (draft), which accept this v2 attestation only behind a flag that is off by default; the whoami route is not in #430 yet | `openadapt_flow.wrap.publish`, [WRAP_PUBLISH.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/WRAP_PUBLISH.md), `packages/flow/tests/test_wrap_publish.py`, `packages/flow/tests/test_jit_hosted_authority.py`, `packages/flow/tests/test_jit_hosted_managed_replay.py` | -| Wrapped tasks that sign in: during `openadapt wrap`'s first run the recorder finds a password field (`type=password`, or `autocomplete` `current-password`/`new-password`) and the username field paired with it (`autocomplete=username`, or a unique text, email or phone candidate paired across all password controls in the composed form; ambiguous or unreadable controls refuse declared inputs) from the page's markup alone. Automatic withholding requires that observation seam; a missing or noncallable seam refuses before capture or actor entry. Screen-only native backends use the existing explicit person-secret handoff instead of this automatic path. Their inputs become secret parameters: the recording, program, run records, receipts and publish upload keep the name and never the value, the observed field regions are blacked out in recording frames (arbitrary field movement or echoes are not proven redacted), a credential field given text that matches no declared input is refused before typing, a form with exactly a username and current password is classified as sign-in without lowering independent keyword risk, and replay run screenshots contain black frames while checks use the original pixels in memory, and no compiled pixel check covers a withheld field's black box (it is clipped clear of it or dropped). Secret environment/vault aliases must be unambiguous, and managed params files cannot supply secret values. The canary and cached runs type them from `OPENADAPT_FLOW_SECRET_`, set from memory for one run; `publish` lists them as `secret_parameters`, outside the call's inputs | On main ([#2352](https://github.com/OpenAdaptAI/OpenAdapt/pull/2352), [#2367](https://github.com/OpenAdaptAI/OpenAdapt/pull/2367)) | Synthetic (a sign-in notes app in headless Chromium through the real wrap path: first run, canary, admission, publish staging, and a cached run under mcp 2, with a byte scan for the values in every file; unit tests with a fake backend for detection, frame redaction, refusals and the sign-in submit rule). Genuine RDP/Citrix backends refuse automatic withholding before input; explicit person-secret handoff remains tested. Hosted runs need an endpoint vault set (openadapt-cloud); on staging, hosted runs signed in from the vault set with neither value in any stored table, object, log or receipt, but stop at an irreversible Save that waits for a per-item approval the managed path cannot deliver yet, so none is VERIFIED | `openadapt_flow.recorder` (`withhold_credentials`), `openadapt_flow.secret_inputs`, [WRAP_PUBLISH.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/WRAP_PUBLISH.md#tasks-that-sign-in), `packages/flow/tests/test_wrap_sign_in.py`, `packages/flow/tests/e2e/test_wrap_sign_in_e2e.py` | +| Wrapped tasks that sign in: during `openadapt wrap`'s first run the recorder finds a password field (`type=password`, or `autocomplete` `current-password`/`new-password`) and the username field paired with it (`autocomplete=username`, or a unique text, email or phone candidate paired across all password controls in the composed form; ambiguous or unreadable controls refuse declared inputs) from the page's markup alone. Automatic withholding requires that observation seam; a missing or noncallable seam refuses before capture or actor entry. Screen-only native backends use the existing explicit person-secret handoff instead of this automatic path. Their inputs become secret parameters: the recording, program, run records, receipts and publish upload keep the name and never the value, the observed field regions are blacked out in recording frames (arbitrary field movement or echoes are not proven redacted), a credential field given text that matches no declared input is refused before typing, a form with exactly a username and current password is classified as sign-in without lowering independent keyword risk, and replay run screenshots contain black frames while checks use the original pixels in memory, and no compiled pixel check covers a withheld field's black box (it is clipped clear of it or dropped). Secret environment/vault aliases must be unambiguous, and managed params files cannot supply secret values. The canary and cached runs type them from `OPENADAPT_FLOW_SECRET_`, set from memory for one run; `publish` lists them as `secret_parameters`, outside the call's inputs | On main ([#2352](https://github.com/OpenAdaptAI/OpenAdapt/pull/2352), [#2367](https://github.com/OpenAdaptAI/OpenAdapt/pull/2367)) | Synthetic (a sign-in notes app in headless Chromium through the real wrap path: first run, canary, admission, publish staging, and a cached run under mcp 2, with a byte scan for the values in every file; unit tests with a fake backend for detection, frame redaction, refusals and the sign-in submit rule). Genuine RDP/Citrix backends refuse automatic withholding before input; explicit person-secret handoff remains tested. Hosted runs need an endpoint vault set (openadapt-cloud); on staging, hosted runs signed in from the vault set with neither value in any stored table, object, log or receipt, and stop at an irreversible Save that requires a per-item approval, which the managed path does not deliver, so none is VERIFIED | `openadapt_flow.recorder` (`withhold_credentials`), `openadapt_flow.secret_inputs`, [WRAP_PUBLISH.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/WRAP_PUBLISH.md#tasks-that-sign-in), `packages/flow/tests/test_wrap_sign_in.py`, `packages/flow/tests/e2e/test_wrap_sign_in_e2e.py` | | Verified write tools for agent frameworks: `verified(tool, contract=...)` wraps a Claude Agent SDK, OpenAI Agents SDK, LangGraph or CrewAI write tool in one line. The contract and any values the operator pins come from the operator, never the agent's arguments; the store is read before and after; the agent gets a receipt or a refusal, and a refused write is held instead of retried | Released | Synthetic (each framework's own agent loop with a scripted model, writing through the example app's order form over real HTTP: verified save, a save the app drops, a save it keeps twice); one real-model run per framework, opt-in | `openadapt_flow.integrations.agents`, extras `claude-agent-sdk`, `openai-agents`, `langgraph` (CrewAI: install `crewai` beside it); [AGENT_FRAMEWORKS.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/AGENT_FRAMEWORKS.md) | | Teach a browser write as a verified tool: with write contracts and a person's signed teach authorization (`serve --teach-browser --contracts DIR --teach-authorization STATEMENT`), the agent teaches a save once. Run 1 starts only when the statement covers the write (origin, contract, write adapter, the record's fields and values) and runs under it; it is verified in the system of record before the `taught_` tool exists. Every call checks the statement and the tool's signature again, makes the write and returns a verified receipt or a refusal. Sign-in values come from the server's environment and never reach the agent or the program. Controls in named iframes are found through their frame | On main ([#1589](https://github.com/OpenAdaptAI/OpenAdapt/pull/1589), [#1763](https://github.com/OpenAdaptAI/OpenAdapt/pull/1763)) | Synthetic (the example app's sign-in and order form in headless Chromium over MCP: verified save, a save the app drops, a save it keeps twice, a page that swaps the record during run 1; refusals for a missing, uncovering, expired, edited or wrongly signed statement) | `openadapt-agent serve --teach-browser --contracts --teach-authorization`, [VERIFY_WRITES.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/VERIFY_WRITES.md#teach-a-write-as-a-tool) | | Guard an agent you already run: attach to its own Chromium over CDP (one added line), hold each save until the record on screen is the one the task names, block it and tell the agent why when it isn't, read the save back; a run that reads back correctly becomes a draft program with a record check from scaffold-verifier, which a person confirms and admits, then a `taught_*` tool with no model calls. `--observe-only` never blocks | Released ([#1357](https://github.com/OpenAdaptAI/OpenAdapt/pull/1357), stacked on [#1335](https://github.com/OpenAdaptAI/OpenAdapt/pull/1335)) | Synthetic (MockMed, scripted Playwright agent, `effect_e2e` faults) | `openadapt-flow guard`, [GUARD_AN_AGENT.md](https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/GUARD_AN_AGENT.md) | diff --git a/packages/flow/tests/test_compile_withheld_fields.py b/packages/flow/tests/test_compile_withheld_fields.py new file mode 100644 index 0000000000..87a97ab985 --- /dev/null +++ b/packages/flow/tests/test_compile_withheld_fields.py @@ -0,0 +1,111 @@ +"""Pixel checks never freeze a withheld credential field's black box. + +The recorder fills a withheld field with black in every frame that still +shows it, so a REGION_STABLE crop over one would refute every live run. +""" + +from __future__ import annotations + +import io +from pathlib import Path + +from PIL import Image, ImageDraw + +from openadapt_flow.compiler.compile import ( + _checks_without_withheld_fields, + _clip_away, + _record_withheld_field_changes, + _shows_blackout, +) +from openadapt_flow.ir import ActionKind, Postcondition, PostconditionKind, Step + +USERNAME_BOX = (20, 10, 120, 20) # withheld, blacked out by the recorder +PASSWORD_BOX = (20, 45, 120, 20) + + +def _frame(*, black: tuple[int, int, int, int] | None = None, whole: bool = False) -> bytes: + image = Image.new("RGB", (200, 100), "white") + draw = ImageDraw.Draw(image) + draw.rectangle((20, 45, 140, 65), outline=(30, 90, 200), width=2) + if whole: + draw.rectangle((0, 0, 199, 99), fill="black") + elif black is not None: + x, y, w, h = black + draw.rectangle((x, y, x + w - 1, y + h - 1), fill="black") + buf = io.BytesIO() + image.save(buf, format="PNG") + return buf.getvalue() + + +def _step(region: tuple[int, int, int, int]) -> Step: + return Step( + id="step_002", + intent="click recorded visual target", + action=ActionKind.CLICK, + expect=[ + Postcondition( + kind=PostconditionKind.REGION_STABLE, + region=region, + phash="0" * 16, + template="templates/step_002_expect.png", + ), + Postcondition(kind=PostconditionKind.TEXT_PRESENT, text="Sign in"), + ], + ) + + +def test_blackout_is_read_from_the_frame_not_assumed(): + assert _shows_blackout(_frame(black=USERNAME_BOX), USERNAME_BOX) + assert not _shows_blackout(_frame(), USERNAME_BOX) + assert _shows_blackout(_frame(whole=True), USERNAME_BOX) + assert not _shows_blackout(None, USERNAME_BOX) + + +def test_clip_keeps_the_largest_part_clear_of_the_box(): + assert _clip_away((10, 0, 160, 80), USERNAME_BOX) == (10, 30, 160, 50) + # Nothing of 8 x 8 or more survives inside the box itself. + assert _clip_away(USERNAME_BOX, USERNAME_BOX) is None + + +def test_a_check_over_the_black_box_is_clipped_and_recropped(tmp_path: Path): + (tmp_path / "templates").mkdir() + step = _step((10, 0, 160, 80)) + changes = _checks_without_withheld_fields( + step, _frame(black=USERNAME_BOX), [USERNAME_BOX], tmp_path + ) + region_checks = [pc for pc in step.expect if pc.kind is PostconditionKind.REGION_STABLE] + assert [pc.region for pc in region_checks] == [(10, 30, 160, 50)] + assert region_checks[0].phash != "0" * 16 + template = Image.open(tmp_path / "templates/step_002_expect.png").convert("L") + assert template.size == (160, 50) + pixels = list(template.getdata()) + assert sum(p <= 8 for p in pixels) / len(pixels) < 0.05 + assert [c["change"] for c in changes] == ["clip_region_stable_off_withheld_field"] + # The other check on the step is untouched. + assert any(pc.kind is PostconditionKind.TEXT_PRESENT for pc in step.expect) + + +def test_a_check_inside_the_black_box_is_dropped_and_recorded(tmp_path: Path): + step = _step(USERNAME_BOX) + changes = _checks_without_withheld_fields( + step, _frame(black=USERNAME_BOX), [USERNAME_BOX], tmp_path + ) + assert [pc.kind for pc in step.expect] == [PostconditionKind.TEXT_PRESENT] + drops: list = [] + _record_withheld_field_changes(changes, drops) + assert drops == [("step_002", USERNAME_BOX, "")] + + +def test_a_frame_from_before_the_field_was_typed_keeps_its_check(tmp_path: Path): + step = _step((10, 0, 160, 80)) + assert _checks_without_withheld_fields(step, _frame(), [USERNAME_BOX], tmp_path) == [] + assert step.expect[0].region == (10, 0, 160, 80) + + +def test_a_check_clear_of_every_box_is_untouched(tmp_path: Path): + step = _step(PASSWORD_BOX) + before = step.model_copy(deep=True) + assert _checks_without_withheld_fields( + step, _frame(black=USERNAME_BOX), [USERNAME_BOX], tmp_path + ) == [] + assert step == before From 24f5d2eabe14ab50a611f4d7ad70ea5b3b314810 Mon Sep 17 00:00:00 2001 From: abrichr Date: Fri, 20 Nov 2026 20:35:07 -0500 Subject: [PATCH 4/7] docs(flow): move the withheld-field note to Unreleased --- packages/flow/CHANGELOG.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/flow/CHANGELOG.md b/packages/flow/CHANGELOG.md index 7ed2c13a01..89ebcc7ade 100644 --- a/packages/flow/CHANGELOG.md +++ b/packages/flow/CHANGELOG.md @@ -15,6 +15,20 @@ +## Unreleased + +### Fixes + +- A wrapped sign-in no longer compiles a pixel check that freezes a withheld + credential field. The recorder blacks out a withheld field in every frame + that still shows it, so a `REGION_STABLE` crop that overlapped one held a + black box that no live screen shows. That refuted the step on every hosted + run, for example the click into the password field. Such a check is now + clipped to the part of its region clear of the box and re-cropped from the + same frame. When no usable part is left, it is dropped and recorded in + `param_hygiene.json`. This applies to mined checks and to the + focused-field pass. + ## v3.4.0 (2026-11-20) ### Features @@ -67,16 +81,6 @@ ### Fixes -- A wrapped sign-in no longer compiles a pixel check that freezes a withheld - credential field. The recorder blacks out a withheld field in every frame - that still shows it, so a `REGION_STABLE` crop that overlapped one held a - black box that no live screen shows. That refuted the step on every hosted - run, for example the click into the password field. Such a check is now - clipped to the part of its region clear of the box and re-cropped from the - same frame. When no usable part is left, it is dropped and recorded in - `param_hygiene.json`. This applies to mined checks and to the - focused-field pass. - - Choice labels, values, shape metadata and browser-dialog messages are checked against declared secrets before capture. A matching or opaque secret boundary stops recording before that text reaches its artifacts. From e8cd81be42a8ead970919446cc14f106cc6536bf Mon Sep 17 00:00:00 2001 From: abrichr Date: Fri, 20 Nov 2026 21:32:43 -0500 Subject: [PATCH 5/7] style(flow): ruff format; regenerate llms-full after the changelog move --- llms-full.txt | 10 ------ .../flow/openadapt_flow/compiler/compile.py | 34 +++++++++++++------ .../tests/test_compile_withheld_fields.py | 21 ++++++++---- 3 files changed, 39 insertions(+), 26 deletions(-) diff --git a/llms-full.txt b/llms-full.txt index a7580ff064..d5d29eac57 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -2426,16 +2426,6 @@ automation into an independently certified transaction system. ### Fixes -- A wrapped sign-in no longer compiles a pixel check that freezes a withheld - credential field. The recorder blacks out a withheld field in every frame - that still shows it, so a `REGION_STABLE` crop that overlapped one held a - black box that no live screen shows. That refuted the step on every hosted - run, for example the click into the password field. Such a check is now - clipped to the part of its region clear of the box and re-cropped from the - same frame. When no usable part is left, it is dropped and recorded in - `param_hygiene.json`. This applies to mined checks and to the - focused-field pass. - - Choice labels, values, shape metadata and browser-dialog messages are checked against declared secrets before capture. A matching or opaque secret boundary stops recording before that text reaches its artifacts. diff --git a/packages/flow/openadapt_flow/compiler/compile.py b/packages/flow/openadapt_flow/compiler/compile.py index 40cff6de22..5066fad3e9 100644 --- a/packages/flow/openadapt_flow/compiler/compile.py +++ b/packages/flow/openadapt_flow/compiler/compile.py @@ -992,19 +992,33 @@ def _checks_without_withheld_fields( region = None note = {"step": step.id, "region": list(pc.region or ())} if region is None: - notes.append({**note, "change": "drop_region_stable_over_withheld_field", - "evidence": "the recorded crop holds a withheld field's black box"}) + notes.append( + { + **note, + "change": "drop_region_stable_over_withheld_field", + "evidence": "the recorded crop holds a withheld field's black box", + } + ) continue rel = pc.template or f"templates/{step.id}_expect.png" _sealed.write_bytes(bundle / rel, _crop_png(after_png, region)) - kept.append(pc.model_copy(update={ - "region": region, - "phash": phash_png(after_png, region=region), - "template": rel, - })) - notes.append({**note, "change": "clip_region_stable_off_withheld_field", - "evidence": "the recorded crop held a withheld field's black box", - "clipped_region": list(region)}) + kept.append( + pc.model_copy( + update={ + "region": region, + "phash": phash_png(after_png, region=region), + "template": rel, + } + ) + ) + notes.append( + { + **note, + "change": "clip_region_stable_off_withheld_field", + "evidence": "the recorded crop held a withheld field's black box", + "clipped_region": list(region), + } + ) step.expect = kept return notes diff --git a/packages/flow/tests/test_compile_withheld_fields.py b/packages/flow/tests/test_compile_withheld_fields.py index 87a97ab985..785c8429b0 100644 --- a/packages/flow/tests/test_compile_withheld_fields.py +++ b/packages/flow/tests/test_compile_withheld_fields.py @@ -23,7 +23,9 @@ PASSWORD_BOX = (20, 45, 120, 20) -def _frame(*, black: tuple[int, int, int, int] | None = None, whole: bool = False) -> bytes: +def _frame( + *, black: tuple[int, int, int, int] | None = None, whole: bool = False +) -> bytes: image = Image.new("RGB", (200, 100), "white") draw = ImageDraw.Draw(image) draw.rectangle((20, 45, 140, 65), outline=(30, 90, 200), width=2) @@ -73,7 +75,9 @@ def test_a_check_over_the_black_box_is_clipped_and_recropped(tmp_path: Path): changes = _checks_without_withheld_fields( step, _frame(black=USERNAME_BOX), [USERNAME_BOX], tmp_path ) - region_checks = [pc for pc in step.expect if pc.kind is PostconditionKind.REGION_STABLE] + region_checks = [ + pc for pc in step.expect if pc.kind is PostconditionKind.REGION_STABLE + ] assert [pc.region for pc in region_checks] == [(10, 30, 160, 50)] assert region_checks[0].phash != "0" * 16 template = Image.open(tmp_path / "templates/step_002_expect.png").convert("L") @@ -98,14 +102,19 @@ def test_a_check_inside_the_black_box_is_dropped_and_recorded(tmp_path: Path): def test_a_frame_from_before_the_field_was_typed_keeps_its_check(tmp_path: Path): step = _step((10, 0, 160, 80)) - assert _checks_without_withheld_fields(step, _frame(), [USERNAME_BOX], tmp_path) == [] + assert ( + _checks_without_withheld_fields(step, _frame(), [USERNAME_BOX], tmp_path) == [] + ) assert step.expect[0].region == (10, 0, 160, 80) def test_a_check_clear_of_every_box_is_untouched(tmp_path: Path): step = _step(PASSWORD_BOX) before = step.model_copy(deep=True) - assert _checks_without_withheld_fields( - step, _frame(black=USERNAME_BOX), [USERNAME_BOX], tmp_path - ) == [] + assert ( + _checks_without_withheld_fields( + step, _frame(black=USERNAME_BOX), [USERNAME_BOX], tmp_path + ) + == [] + ) assert step == before From 571d62a1f4eb49bdd54a6d453fb367a7a5d22fe7 Mon Sep 17 00:00:00 2001 From: abrichr Date: Sat, 21 Nov 2026 12:47:09 -0500 Subject: [PATCH 6/7] fix(compile): type the withheld-field boxes as four-int regions; don't reuse the label loop's name --- packages/flow/openadapt_flow/compiler/compile.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/flow/openadapt_flow/compiler/compile.py b/packages/flow/openadapt_flow/compiler/compile.py index 82d7d8117b..c00c2c719d 100644 --- a/packages/flow/openadapt_flow/compiler/compile.py +++ b/packages/flow/openadapt_flow/compiler/compile.py @@ -4060,7 +4060,8 @@ def cached_lines(i: int, suffix: str, png: bytes) -> list[OcrLine]: # recorded frame; keep pixel checks off it (_checks_without_withheld_fields). redacted = event.get("redacted_region") if isinstance(redacted, (list, tuple)) and len(redacted) == 4: - secret_field_regions.append(tuple(int(v) for v in redacted)) + x0, y0, x1, y1 = (int(v) for v in redacted) + secret_field_regions.append((x0, y0, x1, y1)) _record_withheld_field_changes( _checks_without_withheld_fields( step, step_after, secret_field_regions, bundle @@ -4437,11 +4438,12 @@ def cached_lines(i: int, suffix: str, png: bytes) -> list[OcrLine]: # field as the recorder's black box. Apply the same rule as mining. withheld_boxes: list[Region] = [] after_by_step: dict[str, tuple[Optional[bytes], list[Region]]] = {} - for step, _sb, sa, event in pending: + for step, _sb, after_png, event in pending: redacted = event.get("redacted_region") if isinstance(redacted, (list, tuple)) and len(redacted) == 4: - withheld_boxes.append(tuple(int(v) for v in redacted)) - after_by_step[step.id] = (sa, list(withheld_boxes)) + x0, y0, x1, y1 = (int(v) for v in redacted) + withheld_boxes.append((x0, y0, x1, y1)) + after_by_step[step.id] = (after_png, list(withheld_boxes)) for step in steps: after, boxes = after_by_step.get(step.id, (None, [])) _record_withheld_field_changes( From 2fc2e14d8ba0db226e821c8189f223f50b1a0d7c Mon Sep 17 00:00:00 2001 From: abrichr Date: Sun, 22 Nov 2026 19:40:09 -0500 Subject: [PATCH 7/7] docs(flow): restore backticked identifiers in CHANGELOG.md --- packages/flow/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/flow/CHANGELOG.md b/packages/flow/CHANGELOG.md index e7b2fe4787..81f311ae7e 100644 --- a/packages/flow/CHANGELOG.md +++ b/packages/flow/CHANGELOG.md @@ -69,13 +69,13 @@ - A wrapped sign-in no longer compiles a pixel check that freezes a withheld credential field. The recorder blacks out a withheld field in every frame - that still shows it, so a crop that overlapped one held a + that still shows it, so a `REGION_STABLE` crop that overlapped one held a black rectangle that never matched the unredacted screenshot at replay time, failing a step whose region overlapped a credential box during the run, for example the click into the password field. Such a check is now clipped to the part of its region clear of the box and re-cropped from the same frame. When no usable part is left, it is dropped and recorded in - . This applies to mined checks and to the + `param_hygiene.json`. This applies to mined checks and to the focused-field pass. - File, document, document-hash and email checks no longer claim `system_of_record` (tier 1) for every file. Their strength now follows who