Files
harness-tools/docs/fast-browser-origin-defaults.md
T
jb fd63b0ccec
fast-browser scenarios / Offline scenario contract tests (push) Failing after 44s
fast-browser scenarios / Local Chromium headless scenarios (push) Failing after 23s
fast-browser-with-jev
2026-09-20 12:24:08 -04:00

37 lines
3.1 KiB
Markdown

# Unrestricted web-origin defaults
## User decision
The user requested no default website restriction. Origin policy is now intended to be optional, not a mandatory permission dialog or fixed test-origin list.
- Omitted `allowedOrigins` defaults to `"*"`: any valid HTTP(S) website.
- Explicit `allowedOrigins: "*"` selects unrestricted web origins at a particular configuration scope.
- A nonempty array retains the existing exact-origin allowlist behavior. Projects and individual runs can opt into restrictions.
- Empty arrays and partial hostname wildcards are not alternate spellings for unrestricted access.
- Internal browser URLs, local file URLs, malformed URLs and credential-bearing URLs remain unsupported.
- A session created with an explicit restricted policy cannot be widened by a later run. An unrestricted session can be narrowed for one call.
Unrestricted origin policy does not authorize unrelated actions: the initiating user's task, bounded steps, mutation verification and no-blind-retry behavior still apply. It also does not add tab management: multiple eligible web tabs remain an explicit ambiguity rather than permission to choose an arbitrary tab.
## Retired demo environment
The active Pi process had inherited four variables from `.pi/fast-browser-demo/start-pi.sh`: a fixed CDP endpoint, the old localhost fixture origin, a pinned Python interpreter and the Luna auxiliary model.
At the user's request:
- Removed the four exports from that ignored helper and explicitly unset inherited copies before its `exec pi`.
- Moved the useful Python interpreter and model settings into global `fast-browser.json`, with reasoning off, preserving existing settings and credential references.
- Did not migrate the fixture origin or fixed CDP endpoint.
- Did not delete browser profiles, the pinned Python environment, or provider credentials.
- Verified the helper with an offline stub Pi executable: all four variables were absent in the new process.
A child shell cannot unset its parent Pi process's environment. A **clean restart through the updated helper**, rather than `/reload` alone, is needed to remove values already inherited by the current process. Deliberately configured environment defaults remain supported after this cleanup.
## Verification
Passed `bun run test:fast-browser` (126 TypeScript tests and 23 Python tests), `bun run typecheck`, `bun run test:packages`, `bun run test`, and `git diff --check`.
Coverage includes missing/unrestricted/restricted policies across config, native settings, session lifecycle, TypeScript bridge and Python worker. Restricted sessions cannot be widened, non-web/credential-bearing/wildcard-host URLs remain unsupported, and the settings view exposes default provenance. Tests isolate agent directories and project paths instead of reading the user's real global configuration or provider keys.
A read-only configuration check with the four legacy variables removed confirmed the actual project resolves origins to `"*"` from defaults, Python/model from global JSON, and retains its `harness-test` profile. No browser was launched or external login attempted.