Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
Tell Task V3 to enter 01/01/<year> for a year-only date of birth, and never invent an address or phone number (#8747)
pedrohsdb0bc5170566c7
diff --git a/skyvern/forge/taskv3/engine.py b/skyvern/forge/taskv3/engine.pyindex 939744fde..749ee1db8 100644--- a/skyvern/forge/taskv3/engine.py+++ b/skyvern/forge/taskv3/engine.py@@ -148,7 +148,7 @@ How to work:- Before calling finish with status=completed, re-check with `observe` that the goal's effect is present in the page's SETTLED, loaded content (no loading indicators or empty panels standing in for it), that every required field holds its intended value, and that the only remaining step is the final submit; fix anything missing first. Call `finish(status, reason, extracted_output)` when the goal is achieved, or when you have established that it cannot be achieved; the finish tool's own description says which status each outcome takes.Rules:-- Fill fields from the task's data and satisfy required fields rather than failing over a missing value: prefer the provided values, and for an ordinary required field with no exact value, enter the most reasonable value you can. Do not invent sensitive or identifying values (government IDs, financial details, or legal/eligibility attestations); if one of those is required and not provided, stop and report it rather than guessing. Leave optional fields blank when you have no basis to fill them.+- Fill fields from the task's data and satisfy required fields rather than failing over a missing value: prefer the provided values, and for an ordinary required field with no exact value, enter the most reasonable value you can. If a required date-of-birth field needs a month and day and the task gives only the birth year, enter 01/01/<year>. Never invent a street address or phone number. Do not invent sensitive or identifying values (government IDs, financial details, or legal/eligibility attestations); if one of those is required and not provided, stop and report it rather than guessing. Leave optional fields blank when you have no basis to fill them.- A page message rejecting your submission and inviting you to try again is not an instruction to loop: retry at most once, and if the outcome is unchanged, finish honestly naming the rejection as the reason.- When a submit is refused, find the page's own message in `observe`: a `text:` line that reads as a rejection or validation message, or a field marked `*invalid`. Fix the named field if the task's data allows; otherwise finish and quote that message as the reason. A captcha widget that is merely present on the page is not evidence that it blocked the submission.- Do not submit forms or take irreversible actions unless the goal explicitly instructs it."""diff --git a/tests/unit/test_taskv3_engine.py b/tests/unit/test_taskv3_engine.pyindex fd03d6ad7..0758d6209 100644--- a/tests/unit/test_taskv3_engine.py+++ b/tests/unit/test_taskv3_engine.py@@ -1961,7 +1961,7 @@ async def _system_prompt_for_run(*, precedence_arm: str | None = None) -> str:_DATE_MARKER = "\n\nToday's date is "-_SYSTEM_PROMPT_SHA256 = "4b1e2c70182196a4a40f8dec1a134496cc6074a02b383ba42d4ef8df39d8937c"+_SYSTEM_PROMPT_SHA256 = "aa708d82a5277e0f6f554345aad8a3a2a5bc672473c4f4331e5547918ce75bc9"_PAGE_FREE_SYSTEM_PROMPT_SHA256 = "f2467a7f82ea2db5e08b6da7576a3e58371295af0569cfe143d59903d2580f37"@@ -2002,6 +2002,13 @@ async def test_prompt_arms_add_no_submit_pressure(precedence_arm: str | None) ->)assert do_not_invent in base_controlassert do_not_invent in treatment+ # Operator ruling 2026-09-30: the one date-of-birth default, and the contact values it never extends to.+ birth_year_only = (+ "If a required date-of-birth field needs a month and day and the task gives only the birth year, "+ "enter 01/01/<year>. Never invent a street address or phone number."+ )+ assert birth_year_only in bullet+ assert birth_year_only in base_control# The precedence paragraph sits beside that guard, so it may name submitting only to exempt that guard.if precedence_arm == "treatment":paragraph = treatment.split(CUSTOMER_PRECEDENCE_ANCHOR)[0].split("\n\n")[-1]