Repository navigation
refactor(publication): harden credentials and finish the Artifact Site rename - #134
Conversation
…e rename Stop sending host-agnostic tokens to a target, remove the hardcoded default host, compare verification hosts with the bound profile, and read LLM provider credentials only from the repository .env. Rename the Artifact Hub entry points and every caller to Artifact Site without aliases. Stored artifact_hub_* profile keys stay because certificates bind those profile hashes.
There was a problem hiding this comment.
This review found 2 issue(s), including 2 blocking issue(s).
| base = api_base or os.environ.get("OPENAI_BASE_URL") or os.environ.get("OPENAI_API_BASE") | ||
| try: | ||
| # Evaluation credentials come only from the repository .env, never the shell. | ||
| env = repository_env() |
There was a problem hiding this comment.
P2: The new credential source still allows shell values through dotenv interpolation. repository_env() calls dotenv_values(selected) with interpolation enabled, which resolves missing ${...} references against os.environ. For example, a repository .env containing a literal OPENAI_API_KEY and OPENAI_BASE_URL=${OPENAI_BASE_URL} sends that key to the shell-selected endpoint. The same issue affects the public WebArena diagnostics call. To enforce the stated repository-only boundary, disable interpolation in the shared reader (or resolve references exclusively against file values), and add a regression case with a shell-provided interpolation variable.
| selected = ROOT / ".env" | ||
| if not selected.exists(): | ||
| return {} | ||
| return {key: value for key, value in dotenv_values(selected).items() if value} |
There was a problem hiding this comment.
P1: dotenv_values() enables interpolation by default and resolves ${NAME} using the process environment when the name has not already been defined in the file. Consequently, a repository .env containing OPENAI_API_KEY=repository-key and OPENAI_BASE_URL=${OPENAI_BASE_URL} still lets a shell-provided URL receive the repository key through both replay diagnostics. Likewise, an interpolated key can come from the shell. This defeats the isolation this helper is intended to provide. Disable interpolation (interpolate=False), or implement expansion restricted to file-local values, and add a regression case with shell-backed substitutions.
Suggestion:
| return {key: value for key, value in dotenv_values(selected).items() if value} | |
| return {key: value for key, value in dotenv_values(selected, interpolate=False).items() if value} |
There was a problem hiding this comment.
✅ Re-review complete · 5f81312
No findings in this incremental review.
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 1
Reviewed head 5f813124 against base 27401304. CI on this head passes: Tests and static checks, Installation and packaging, and Rendered reference and report checks. No failure is attributable to the PR.
Three findings: one P2 and two P3.
Findings
P2: a legacy host-agnostic environment token outranks the current host-scoped token
src/harness/web_fetch/artifact_auth.py:39-41, with the behavior pinned by tests/test_artifact_auth.py:39-40.
Problem: ARTIFACT_HUB_TOKEN is read before ~/.config/artifact-site/tokens/<host>. A stale ARTIFACT_HUB_TOKEN left in a shell therefore replaces a correct per-host token and is sent to whichever host is selected. I reproduced this with ARTIFACT_HUB_TOKEN=ahp_stale_other_host and a saved ahp_scoped for https://a.example: load_token returned ahp_stale_other_host.
This is the wrong-host failure #95 is meant to close. It also disagrees with three descriptions of the order:
- AGENTS.md calls the old locations migration fallbacks.
- The issue proposal lists
ARTIFACT_SITE_TOKEN, then the current per-host file, then the legacy per-host path. - This PR's own
docs/report-hosting.md:68gives the same order.
The ordering predates this PR, but the PR rewrites this function to harden it and documents a different order.
Suggested fix: read ARTIFACT_SITE_TOKEN, then artifact-site/tokens/<host>, then the legacy fallbacks, with ARTIFACT_HUB_TOKEN after the current host file. Decide its position relative to artifact-hub/tokens/<host> and state that in the doc. Change the test so the saved per-host token wins over ARTIFACT_HUB_TOKEN, and keep a case where ARTIFACT_HUB_TOKEN is used when no current token exists.
P3: --env-file no longer reaches LLM diagnostics, and the remaining-work note does not say so
src/harness/trajectory_replay/public_webarena/diagnostics.py:274-277, src/harness/trajectory_replay/public_webarena/cli.py:82-83,124.
Problem: public_webarena/cli.py still loads --env-file into the process, but diagnose_summary now reads only the repository .env. --env-file other.env --llm-diagnostics therefore silently uses the repository key and endpoint, or records a missing-credentials diagnostic error if the repository has none. Taking credentials only from the repository .env matches AGENTS.md. The issue is that the flag's help text and the PR's "Remaining" note both imply that --env-file is still a credential source for this run.
Suggested fix: state in the --env-file help and the PR body that LLM diagnostics ignore it.
P3: small rename and interpolation leftovers
src/harness/web_fetch/publication_verify.py:101: the docstring still says "a known Hub bootstrap". Theartifact[-_ ]?hubsearch misses it. Change it to "Artifact Site bootstrap".src/harness/web_search/relevance.py:485:dotenv_values(runtime_config.ROOT / ".env")still interpolates. A${NAME}value forSEARCH_JUDGE_BASE_URLwould be resolved from the shell, and that value is the host allowlist for the judge token. This is the same class of problem the PR fixes forOPENAI_BASE_URL. Passinterpolate=False, or list it under remaining work.
Verified with no defect
- Token files: host-agnostic files and other-host files are refused. The legacy per-host key is the same lowercase host string as before.
- Default host: no hardcoded default remains in
srcorscripts.DEFAULT_BASE,current_publication_target,public_report_urlandWEBFETCH_REPORT_PUBLIC_URLhave no references left. - Token destinations: every
load_tokencaller takes its host from a profile or receipt, or from a value checked against one.verify_artifact_site.pyrejects a mismatched--base-urlorARTIFACT_SITE_BASE_URLbefore loading a token, for both flat and nested profiles. - Public WebArena release:
_verification_commandnow passes--profileand--export. The nestedpublication.base_urlresolves throughpublication_document. - Redaction:
browser_use/publication.pyderives its tables fromharness.environments.webarena.topology, so "no change needed" holds. - Credentials:
OPENAI_*is read only from the.envpaths inbrowser_use/runner.pyand the twodiagnostics.pymodules. The tests fail ifinterpolate=Falseis removed fromrepository_envor_load_repo_env. - Rename: the seven scripts were renamed with no aliases, and no old script name or
ARTIFACT_HUB_BASE_URLremains. The survivingArtifact Hubstrings are published URLs, historical records, the two allowed fallbacks and the storedartifact_hub_*profile keys, which the PR lists as remaining. - Receipt rename: a receipt left at an old default path fails closed on update for Web Fetch and Browser Use (
report_publish.py:151-152,browser_use/report_publish.py:264-265), so a missed move cannot create a duplicate site. - Scope claim: "Part of #95" is accurate, and hash-bound evidence and frozen profiles are unchanged.
Local test results
- Lint gate: both
ruff checkcommands pass. tests/test_golden_reports.pyplus the auth, verify, runtime entrypoint, publish, report template, Browser Use runner, diagnostics, release and WebArena publish test files: 267 passed.- Golden changes match the routes the PR body lists:
accounts/index.htmlanden/accounts/index.htmlfor the two Browser Use fixtures, andreport-manifest.jsonforweb-fetch. - I did not run the full suite locally or perform a live publish or device authorization. CI is the full-suite gate.
|
Review round 1: all four findings are fixed, none disputed.
Local checks: both lint commands pass, and the golden, artifact auth, web search and diagnostics tests gave 528 passed with no golden changes. CI on this head is still running. |
There was a problem hiding this comment.
✅ Re-review complete · 67e5e3b
No findings in this incremental review.
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 2
Reviewed head 67e5e3ba. All four round 1 fixes hold. I found no P0, P1 or P2 defects, and two P3 items.
Findings
P3: src/harness/browser_use/runner.py:535: the explicit --env-file read has no interpolation test.
- Problem: the PR body says the runner's dotenv reads disable interpolation and that tests cover
${NAME}references.test_provider_credentials_come_only_from_the_repository_envonly exercises_load_repo_env(line 77). When I removedinterpolate=Falsefrom line 535 alone, all 70 tests intests/browser_use/test_runner.pystill passed, so a regression there would let a${NAME}in that file pull a credential from the shell without any test failing. - Fix: send both reads through one small helper that takes the file path and always disables interpolation, then test that helper. Or add a test that drives the
--env-filebranch ofrun().
P3: src/harness/web_fetch/README.md:461: the credentials paragraph is wrong about exported variables.
- Problem: "Credentials and local executable/repository paths belong in the root
.env... Exported environment variables take precedence." This is false for credentials. I ranload_runtime_env()withOPENAI_API_KEY=exportedin the process andOPENAI_API_KEY=fromfilein.env, and it resolved tofromfile. It also contradicts line 845 of the same README and the rule this PR enforces. The sentence predates the PR, but it is outside the disclosed remaining work and misleads on the subject of #95. - Fix: limit the precedence statement to non-credential paths, for example "Exported variables take precedence for runtime paths; evaluation credentials come only from the repository
.env."
What I verified
- Round 1 fixes:
- Token order is
ARTIFACT_SITE_TOKEN, the current per-host file, the legacy per-host file, thenARTIFACT_HUB_TOKEN. MovingARTIFACT_HUB_TOKENback ahead of the files failstests/test_artifact_auth.py. - The public replay CLI's
--env-filehelp is updated. The curated replay CLI has no--env-file. The other two--env-fileand--credential-env-fileoptions sit in code with no--llm-diagnosticsoption. - The
publication_verify.pydocstring is fixed. SEARCH_JUDGE_BASE_URLnow comes fromrepository_env().
- Token order is
- Mutation checks (each reverted afterwards): each of these made a test fail:
- restoring interpolation in
repository_env(judge and diagnostics tests) - letting verification skip the profile host check
- adding a default host to
authorize_main - adding a default host to
require_publication_site
- restoring interpolation in
- Host binding: every
load_tokencaller gets its host from a bound profile or receipt, apart fromauthorize_main, which takes an explicit--base-urlorARTIFACT_SITE_BASE_URL. The Web Fetch, public replay and WCXB paths usepublication_base. The Browser Use and curated replay publishers read the profile'spublication.base_url, and rename reads the receipt's host. No Artifact Site default host remains insrc,scriptsor the Makefile. - Public replay release: the verification command now passes the
--profileand--exportthatverify_artifact_site.pyneeds. Nestedpublicationprofiles resolve throughpublication_document. - Redaction:
browser_use/publication.pyhas no plaintext passwords and imports fromharness.environments.webarena.topology. - Rename:
- All ten
scripts/*_artifact_site.pyentry points run with--help, and no*_artifact_hub.pyscript remains. - The remaining old-name hits outside
evaluation/andresearch/report-changes.jsonare the allowed migration fallbacks and their tests, a test helper that strips those variables, storedartifact_hub_*keys, published URLs, one translation key for historical release text, andresearch/browser-use-bridge-inputs/trajectory-run-profile.json. ARTIFACT_HUB_BASE_URL,DEFAULT_BASE,current_publication_target,public_report_urlandWEBFETCH_REPORT_PUBLIC_URLare gone. On the base commit, the last three were referenced only by their own module,.env.exampleand tests.
- All ten
- Scope claim: "Part of #95" is accurate. The remaining list covers the stored
artifact_hub_*keys and the explicit non-repository credential sources, and both need an owner decision. - Golden snapshots: only the routes named in the PR changed.
- Local runs: both lint commands pass.
tests/test_golden_reports.pyand the affected publication, runner, diagnostics and judge test files gave 425 passed. I did not run the full suite locally, and I did not run a live publish or device authorization. - CI on
67e5e3ba: "Tests and static checks", "Installation and packaging", "Rendered reference and report checks", "Python 3.11" and the other checks all pass. The PR is mergeable and its base is the current main,27401304.
…elper The explicit --env-file read disabled interpolation on its own line with no test covering it. Both reads now share _read_dotenv, and a test drives the --env-file branch of run(). A blank value in an --env-file now counts as unset, as it already did in the repository .env, so a blank OPENAI_BASE_URL selects the default URL.
|
Review round 2: both findings are fixed, and none are disputed.
Locally, lint passes and |
There was a problem hiding this comment.
✅ Re-review complete · 771f14f
No findings in this incremental review.
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 3
Reviewed head 771f14f1. I found one defect, and CI is green on this head.
Finding
P2: src/harness/environments/webarena/rainbond.py:202 (entry point scripts/manage_webarena_rainbond_pool.py)
Problem: RAINBOND_API_TOKEN is still read only from the process environment, and pool_main never loads the repository .env. This is the same defect #95 describes for the curated replay CLI.
.env.example:97-99tells operators to put the token in.env, and_evaluation_credentialmatches its name.- I constructed
RainbondSlicePoolagainst a temporary repository root, withPoolConfig.loadandRainbondAPIstubbed:- With the token only in
.env, it raisesRainbond API token environment variable is missing. - With the token also exported, it uses the shell value (
fromshell).
- With the token only in
- The PR's "Remaining" list names only
--env-file,--credential-env-fileand thecredentials_envsite passwords, so a reader would conclude this path is done.
Fix: Read the token with repository_env().get(self.config.token_env, "") and add a test that a shell value is ignored. web_fetch/config.py holds repository_env(), and the replay diagnostics already import it from there. If the operator workflow makes that an owner decision, add this path to the PR's "Remaining" list instead.
Verified with no defect
Previous rounds
- All round 1 and round 2 fixes are present, and neither round's findings need raising again.
Token order and host binding
load_tokenreadsARTIFACT_SITE_TOKEN, then the current per-host file, then the legacy per-host file, thenARTIFACT_HUB_TOKEN. The host-agnostic files are no longer read.verify_artifact_site.pycompares the requested host with the profile before any token load, for both flat and nested profiles.require_publication_siterejects a profile with no host.- The public WebArena
--profile --exportcommand matches the verifier's parser.
Credential reads
- The diagnostics callers pass no
api_keyorapi_base. .env.examplehas no$references, so disabling interpolation changes no documented value.
Scope and rename
- The only remaining old names are the disclosed profile keys, the allowed fallbacks, historical records and published URLs.
ARTIFACT_HUB_BASE_URL,WEBFETCH_REPORT_PUBLIC_URLand the removed functions have no remaining references.- All ten
scripts/*artifact_site.pyentry points answer--helpwith no host set. - Redaction uses
topology, and I found no plaintext password copies undersrc,scripts,configsor top-leveltests.
Goldens
- Only the disclosed routes changed.
browser-use-passandbrowser-use-failhashes match for bothaccountsroutes, andweb-fetchchanged onlyreport-manifest.json.
Mutation checks
I reintroduced each regression below, and the listed tests failed each time.
| Regression reintroduced | Failing tests |
|---|---|
| Host-agnostic token file | tests/test_artifact_auth.py |
ARTIFACT_HUB_TOKEN read first |
tests/test_artifact_auth.py |
Interpolation in repository_env |
3 tests in tests/trajectory_replay/test_diagnostics.py and tests/web_search/test_judge_receipts.py |
| Unbound verify host | tests/test_publication_verify.py |
Default host in require_publication_site |
tests/test_runtime_entrypoints.py |
Shell OPENAI_API_KEY in the runner |
tests/browser_use/test_runner.py |
| Optional authorize host | tests/test_artifact_auth.py |
Local test runs
- Lint gate passes.
- The golden, publication, config, runner, judge, diagnostics, replay and public WebArena targets gave 1054 passed, 3 skipped, 1 failed.
- The failure is
tests/test_config.py::ConfigTest::test_migrated_roots_and_worker_paths, a path comparison of/tmpagainst/private/tmpcaused by where my worktree sits on macOS, not by the PR.
CI on 771f14f1
- Tests and static checks, Installation and packaging, Rendered reference and report checks, and Python 3.11 all pass.
Checked and not reported
OXYLABS_PASSWORDandOXYLABS_USERNAMEare not covered by the credential pattern, but no code reads them.HF_TOKENis a documented optional dataset-hub token read from the process. It is not in.env.example.dotenv_valuesinreport_languages.pystill interpolates, but it reads only the report language, not a credential.
I did not run a real publish or device authorization.
|
Review round 3: Fixed:
Operators who only export Disputed: none. |
There was a problem hiding this comment.
✅ Re-review complete · 9dd25f0
No findings in this incremental review.
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 4
Reviewed head 9dd25f08. I found no P0, P1 or P2 defects. Three P3 findings cover documentation and the scope list; none needs a code change.
Findings
P3: src/harness/trajectory_replay/public_webarena/cli.py:83 (also qualification.py:983)
- Problem: since
9dd25f08, a Rainbond slice run also ignores--env-file, but the help text and the PR's Remaining note name only--llm-diagnostics. I reproduced this with the public replayload_runtime_env(other.env)andRainbondSlicePool. With no repository.env, a token that onlyother.envholds raisesSet a nonempty ... in the repository .env. With a repository.env, the repository token is used silently, even though the operator named another file.webarena_environment.py:110builds the pool on this path. This is the same class as the round 1 diagnostics note, and the behavior itself matches the rule. - Fix: state in the
--env-filehelp and the PR's Remaining note that the Rainbond API token is also read only from the repository.env.
P3: examples/trajectory_replay/README.md:129
- Problem: it says
TRAJECTORY_REPLAY_LLM_DIAGNOSTICS=1"requiresOPENAI_API_KEYplusOPENAI_BASE_URL" without saying where they come from.run.shdoes not load.env, so before this PR exported values were the working route for this example. Those exports are now ignored, and the run records the missing-credentials error instead of a diagnosis. The PR updated the equivalent Rainbond sentence but not this one. - Fix: say both values must be in the repository
.envand that exported values are ignored.
P3: src/harness/benchmarks/data.py:163
- Problem:
HF_TOKENis read only from the process environment, and it is absent from.env.example. It is not in the PR's Remaining list, which reads as the complete set of non-repository sources. Whether a dataset-transport token counts as an evaluation credential under AGENTS.md is a fair question, but the PR does not address it. - Fix: add one line to Remaining, either as an owner decision or stating that it is a dataset transport token outside the evaluation-credential rule. No code change is needed in this PR.
What I verified
- Token selection:
load_tokenreadsARTIFACT_SITE_TOKEN, the current host file, the legacy host file, thenARTIFACT_HUB_TOKEN. EveryAuthorizationheader for Artifact Site goes through it. No other reader of the host-agnostictokenfiles remains. - Hosts: there is no default host in
src/orscripts/.verify_artifact_site.pyrejects a host outside the bound profile before it loads a token. - Rename: all seven scripts are pure renames. A repository-wide search finds the old name only in the allowed fallbacks, the stored
artifact_hub_*keys, published URLs and the historical files the PR lists. No caller of*_artifact_hub.py,ARTIFACT_HUB_BASE_URLor the old receipt paths remains. - Evaluation credentials: I went through the
os.environandgetenvreads insrc/andscripts/. Apart fromHF_TOKENabove and the disclosed site-password path, evaluation credentials reach the code throughrepository_env()orload_runtime_env(). - Test strength: I applied five temporary mutations, and each one made at least one test fail:
- restoring dotenv interpolation in
repository_env - letting
--base-urlbypass the profile check inpublication_verify - dropping
--exportfrom the release verification command - restoring the host-agnostic token file
- restoring the shell
OPENAI_API_KEYoverride in the Browser Use runner
- restoring dotenv interpolation in
- Local runs: both ruff gates pass. Golden, auth, verify, privacy, entrypoint, config, publish/package, Browser Use runner, trajectory replay, judge and Rainbond pool tests gave 2379 passed, 5 skipped, 1 failed. The failure is
tests/test_config.py::ConfigTest::test_migrated_roots_and_worker_paths, caused by my worktree path:/tmpversus/private/tmpon macOS. It is not caused by this PR. I did not run the full suite locally. - Goldens: no snapshot changed in this run, and the committed golden changes match the three snapshots and the routes the PR explains.
- CI on this head: all checks pass, including Tests and static checks, Installation and packaging, and Rendered reference and report checks.
I did not run a real publish, device authorization or live Rainbond call.
…om the repository .env
…only from the repository .env
|
Review round 4: all three findings are addressed, none disputed.
Lint passes and the targeted tests pass with no golden changes; the PR's Test plan has the counts. CI on this head is still running. |
There was a problem hiding this comment.
✅ Re-review complete · 21a029a
No findings in this incremental review.
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 5
Head: 21a029ac. CI on this head passes: "Tests and static checks", "Installation and packaging" and "Rendered reference and report checks".
Findings
P2, src/harness/browser_use/report_check.py:272 and :295: the Browser Use release privacy check still hardcodes the site passwords, and the PR says no redaction change is needed.
- Problem: both
forbidden_textregexes containPassword\.123|admin1234|test1234|hello1234. These are plaintext copies of the passwords inenvironments/webarena/topology.json, the same kind of copy #95 asks to remove.sanitize_texttakes its values fromknown_site_secrets(), but the release check that should catch a leak does not. If a password is added or rotated in the registry, the check no longer looks for it. - Reproduced: I patched
DEFAULT_SITE_CREDENTIALSwith a new password, andknown_site_secrets()returned it._check_public_privacystill accepted a report page containing that password, while it rejectedhello1234. - Scope claim: the summary line "Redaction: no change needed. #130 already derives the tables" holds for
browser_use/publication.pyonly, and the Remaining list does not mention this path. - Fix: build one module-level pattern from
re.escapeoverknown_site_secrets(), use it in both functions, and add a test that a registry password not in the old list is rejected. No rendered output or stored evidence changes. If you defer this instead, add it to Remaining and narrow the summary line.
What I verified without finding a defect
- Token order:
load_tokenreadsARTIFACT_SITE_TOKEN, the current per-host file, the legacy per-host file, thenARTIFACT_HUB_TOKEN. Host-agnostictokenfiles are no longer read. - Hosts: no default host remains in
src/orscripts/.verify_artifact_site.pychecks the host against the flat or nested profile before it loads a token. The public WebArena release command now passes--profileand--export, which the parser accepts. - Rename: a repository search finds no old script names,
ARTIFACT_HUB_BASE_URL,WEBFETCH_REPORT_PUBLIC_URLor removed helpers. Everyscripts/*.pypath inconfigs/report-templates.jsonexists. The remaining "Hub" hits are stored profile keys, allowed fallbacks, historical URLs and the historical files listed in the PR. - Evaluation credentials: every process-environment read in
src/is either a non-secret setting, comes afterload_runtime_env(), or is covered by the Remaining list. Publishing entry points do not load.env, and no shell script or Makefile target suppliesOPENAI_*. - Round 4 fixes: the
--env-filehelp, the trajectory replay README and theHF_TOKENnote are present and accurate.
Test results
- Lint: both
ruff checkcommands pass. - Focused tests: 1070 passed, 3 skipped, 1 failed, covering golden reports, publication, auth, config, Browser Use runner, trajectory replay, public WebArena, judge receipts and the Rainbond pool. Golden snapshots are unchanged.
- The one failure:
tests/test_config.py::ConfigTest::test_migrated_roots_and_worker_pathsfails here because my worktree is under/tmp, a symlink to/private/tmpon macOS (/tmp/...versus/private/tmp/...). I attribute it to that location, not the PR, and the test is part of the Linux CI run that passes. - Not run: a real publish, a device authorization or a live Rainbond call.
…rom the registry Both forbidden-text patterns hardcoded a plaintext copy of the passwords in topology.json, so a password added or rotated in the registry was redacted by sanitize_text but not detected by the release check. One module-level pattern now escapes known_site_secrets(), and both checks use it.
|
Fixed the open P2 finding. I verified it first and it was correct:
Lint passes. |
There was a problem hiding this comment.
✅ Re-review complete · ae92aa6
No findings in this incremental review.
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 6
Head: ae92aa66. CI on this head passes, including "Tests and static checks", "Installation and packaging", "Rendered reference and report checks" and "Python 3.11". The PR is mergeable and its base is current main.
I found no P0, P1 or P2 defects, and one P3.
Finding
P3: src/harness/browser_use/report_check.py:56-60: an empty registry or a blank password makes the pattern match everything.
- Problem: the secrets are joined and followed by a literal
|, so with no secrets the pattern starts(?:|-----BEGIN. That empty alternative matches any text, and a blank password produces the same result.topology._loadallows both:topology.py:44only tiescredentialstomutable, and nothing checks that a password is nonblank or that a mutable site exists. - Reproduced: I loaded the real module with
DEFAULT_SITE_CREDENTIALSemptied, then again with one extra blank password. Both times_FORBIDDEN_PUBLIC_TEXT.search("xyz")matched, and_check_public_privacyrejected a clean{"note": "clean"}file with "published report contains sensitive text". - Impact: this cannot happen with the committed
topology.json, which has four nonblank passwords. It also fails closed, so nothing leaks. But the error would send an operator looking for a leak in a clean report. The hardcoded pattern this replaced could not do this. - Fix: reject a blank password in
topology._load, which also protectssanitize_text, wheretext.replace("", "[REDACTED]")would corrupt every string. Inreport_check.py, join the secrets and the fixed alternatives as one list, so no secrets leaves no empty alternative. Add a test that an empty registry accepts clean text.
Verified with no defect
_FORBIDDEN_PUBLIC_TEXT
- Error output: both checks raise with the file path only, never the match or the pattern.
report_check.pyholds no plaintext password. Outside tests andevaluation/, agit grepfinds the four passwords only intopology.json. - Escaping:
re.escapeis applied to each secret, andRotated.Secret+42(xcompiles and matches literally. - Behavior preserved: old and new patterns agree on 12 controls, covering each password in different case, private key, bearer,
sk-and local paths, including the case-sensitive/users/xcontrol. The registry's password set equals the old list. - Module load:
topologyimports only the standard library and has no cycle.report_check.pyalready importedbrowser_use/publication.py, which callsknown_site_secrets()at import, so the new import-time read adds no new way to fail.
Tests really fail without the fix
Each mutation was reverted afterwards.
| Mutation | Failing tests |
|---|---|
Previous report_check.py |
2: the privacy test and the Rotated.Secret+42(x execution-artifact case, as the PR says |
| Hardcoded list in the new pattern | the same 2 |
re.escape removed |
3 |
_check_execution_artifacts skips the scan |
2 |
_check_public_privacy skips the scan |
5 |
Rest of the PR
- Earlier rounds: all fixes from rounds 1 to 5 are present, and I am not raising any accepted point again.
- Tokens and hosts: token order, ignored host-agnostic files and explicit
authorizehost hold. Verification checks the profile host before loading a token, and no default host remains. - Credentials: the
OPENAI_*, Rainbond and judge allowlist reads use the repository.envwithout interpolation. - Public WebArena: the verification command now passes
--profileand--export. - "## Issues" section:
- "Part of #95" is accurate, because the listed items remain open.
- The stored
artifact_hub_*keys are in use, includingartifact_hub_share_url. - The WCXB digest excludes
artifact_hub_expected_versionatwcxb_publication.py:37. - The
--env-filestatements match the code. HF_TOKENis read only atbenchmarks/data.py:163.
- AGENTS.md:
- A repository search finds no old script names,
ARTIFACT_HUB_BASE_URL, old receipt paths or removed helpers, and no compatibility aliases. - Remaining "Hub" hits are the allowed fallbacks, stored keys, published URLs and the historical files the PR lists.
- The PR changes no file under
evaluation/,research/ordeploy/. - New default receipts stay under the ignored
/publish/.
- A repository search finds no old script names,
- Golden snapshots: only the explained routes differ, namely both
accountsroutes in the two Browser Use snapshots andreport-manifest.jsoninweb-fetch. Rerunning them changed nothing. - PR body: exactly one
<!-- pr-picture -->block, and its image link returns a PNG.
Local runs
- Lint: both
ruff checkcommands pass. - Latest commit's targets:
tests/test_golden_reports.py,tests/browser_useandtests/environments/test_webarena_topology.pygave 305 passed, the count the PR states. - Wider targets: adding auth, verify, privacy, entrypoint, publish and package, config,
tests/trajectory_replay, judge and Rainbond pool tests gave 2605 passed, 5 skipped, no failures. - Not run: the full suite locally, where CI is the gate, or a real publish, device authorization or live Rainbond call.
…swords Join the registry secrets and the fixed alternatives as one list, so no secrets leaves no empty alternative that matches any text. Reject a blank or missing site password when loading the topology, which also protects sanitize_text from replacing the empty string.
There was a problem hiding this comment.
✅ Re-review complete · 54e938c
No findings in this incremental review.
|
Round 6: the P3 finding is fixed in
Tests fail without the fix
Local runs: both |
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 7
Head: 54e938c7. I found no defects of any severity. CI on this head passes: "Tests and static checks", "Installation and packaging", "Rendered reference and report checks", "Python 3.11", "Select check scope", "OCR dispatch" and ocr-review.
What I verified
_FORBIDDEN_PUBLIC_TEXT
- Committed registry: the pattern string and flags are identical to the hardcoded pattern this PR removed, so release checks behave the same today.
- Empty registry: there is no empty alternative. Clean text passes and a private key marker is still rejected.
- Isolation: the fixtures execute a private copy of the module, and the real
checkeris unaffected, whichtest_public_privacy_rejects_a_password_only_the_registry_knowsalso asserts.
topology._load
- Rejected on a mutable site:
""," ","\t\n",None,123,True,[],{}, a missing password andcredentials: {}all raise the "nonblank password"ValueErrorwith the site name. - Not newly rejected:
mapandwikipedia, the two immutable sites, carry no credentials and never reach the new check. A registry with no mutable site also still loads._loadhas one production caller, on the committedtopology.json. All four of its passwords load.
- Runtime configs:
deploy/webarena/runtime.example.jsonandexamples/trajectory_replay/public_webarena/webarena.config.example.jsonholdcredentials_envvariable names and never pass through_load.examples/trajectory_replay/public_webarena/rainbond-pool.example.jsonnames onlytoken_envand never passes through_loadeither.verify_deployment_contractpasses against the deploy and example files, with 6 sites.
Tests fail without the fix
Each mutation was reverted afterwards.
| Mutation | Result |
|---|---|
| Remove the password check | 4 topology tests fail |
Drop .strip() |
the whitespace case fails |
Drop isinstance |
the None and missing-password cases fail |
Previous report_check.py |
the empty-registry test fails |
| Hardcoded password list in the pattern | the test_public_privacy_rejects_a_password_only_the_registry_knows test and the Rotated.Secret+42(x execution-artifact case fail |
_check_execution_artifacts skips the scan |
both execution-artifact cases fail |
re.escape removed |
the probe password is not a valid regex, so the pattern fails to compile and the test run reports errors |
These results match the table in the round 6 reply.
Rest of the PR
- Credentials: I reread the source, config and docs diff against the base commit. Token order, host binding,
repository_envand the_read_dotenvhelper hold, and the disclosed Remaining items still match the code. - Rename: a search outside
evaluation/andresearch/report-changes.jsonfinds no old script names,ARTIFACT_HUB_BASE_URL,WEBFETCH_REPORT_PUBLIC_URL,DEFAULT_BASEor old receipt paths. All tenscripts/*_artifact_site.pyentry points answer--help. - Packaging:
python-dotenvis a core dependency, so the new import inweb_fetch/config.pyis safe in a base install. - Plaintext passwords: under
src,scripts,configs,deploy,examplesand the Makefile, the four passwords appear only intopology.json.
Checked and not reported
A non-object credentials value on a mutable site, such as null or a string, raises AttributeError rather than the named ValueError. It still fails at import, and the same loader raises raw KeyError for other malformed fields, so I do not think this is worth changing.
Local runs
- Lint: both
ruff checkcommands pass. - Requested targets:
tests/test_golden_reports.py,tests/browser_useandtests/environmentsgave 385 passed. No golden snapshot changed. - Wider targets: adding auth, verify, privacy, entrypoint, publish and package, config,
tests/trajectory_replay, judge and Rainbond pool tests gave 2685 passed, 5 skipped, no failures. - Not run: the full suite locally, where CI is the gate, or a real publish, device authorization or live Rainbond call.
Issues
Closes #95. Remaining after this PR:
artifact_hub_*profile keys (base_url,site,expected_version,share_url) keep their names. Frozen instance profiles use them, and certificates and receipts bind those profile hashes. The WCXBprofile_digestalso excludesartifact_hub_expected_versionby name. Renaming them would invalidate that evidence, so it needs an owner decision and a coordinated profile revision.--env-fileand--credential-env-fileoptions, and the public replay'scredentials_envsite passwords read through the process environment, still allow a non-repository source. Tightening them changes how runs are launched, so that needs an owner decision. Replay LLM diagnostics and the Rainbond API token of a slice run already ignore--env-fileand read only the repository.env, so with a repository.envan operator-named file does not supply that token; the public replay and qualification CLIs'--env-filehelp says so.HF_TOKENis still read only from the process environment and is not in.env.example. It is optional authentication for dataset downloads and dataset publication, not a provider or evaluated-service credential, so this PR treats it as a dataset transport token outside the evaluation-credential rule. No code changes for it here; the owner can reclassify it.Part of #87.
Summary
Publishing:
load_tokennow reads only, in this order,ARTIFACT_SITE_TOKEN,~/.config/artifact-site/tokens/<host>,~/.config/artifact-hub/tokens/<host>andARTIFACT_HUB_TOKEN. The legacy variable is host-agnostic, so it comes last and a stale value cannot replace a host-scoped token. The host-agnostictokenfiles are ignored, so they can never be sent to whichever host a caller names.artifact-hub.app.lexmount.comdefault is gone.authorize_artifact_site.pyrequires--base-urlorARTIFACT_SITE_BASE_URL.require_publication_siteno longer substitutes a default for a missing profile host.verify_artifact_site.pyused to send the token to any--base-url. It now rejects a host that differs from the bound profile, and it accepts both flat and nested profiles.--profileand--export, soverify_artifact_site.pywould have rejected it. Both are now passed.current_publication_target,public_report_urlandWEBFETCH_REPORT_PUBLIC_URLhad no production caller.ARTIFACT_SITE_TOKENalso leaves.env.example, because publishers never read.env.Evaluation credentials:
repository_env()reads the repository.envwithout changing the process environment. It disables dotenv interpolation, so a${NAME}reference cannot pull a value from the shell. The Browser Use runner's dotenv reads share one helper that disables it too, and a blank value in an--env-filenow counts as unset, as it already did in the repository.env, and the search judge'sSEARCH_JUDGE_BASE_URLhost allowlist now comes fromrepository_env().OPENAI_*only from it. The earlier draft usedload_runtime_env(), but that strips unrelated credentials from a live process and lets a shellOPENAI_BASE_URLreceive the.envkey, so I did not keep it.repository_env(), so an exported value is ignored. The public WebArena README now tells operators to put it in.env, matching.env.example.OPENAI_*override.env.COWAGENT_REPO, which is not a secret, can still come from the process.Redaction: #130 already derives the
sanitize_texttables fromharness.environments.webarena.topology, but the Browser Use release privacy check still hardcoded a plaintext copy of the site passwords.report_check.pynow builds one pattern fromknown_site_secrets()and uses it in both_check_execution_artifactsand_check_public_privacy, so a password added or rotated in the registry is detected as well as redacted.Rename:
scripts/*_artifact_hub.pyentry points become*_artifact_site.py, with every caller, doc andconfigs/report-templates.jsonentry updated and no aliases.ARTIFACT_HUB_BASE_URLis removed.publish/artifact-site-receipt.jsonandpublish/browser-use-artifact-site-receipt.json. A local receipt at an old default path must be moved or passed with--receipt.research/report-changes.json,evaluation/browser-use-public/report-changes.jsonwith its matching translation key, andresearch/browser-use-bridge-inputs/trajectory-run-profile.json.Reports built before this change embed the old script names in their manifest's template block, so they need a rebuild before a new release check. The golden changes below come from the same rename.
Golden changes
browser-use-passandbrowser-use-fail, routesaccounts/index.htmlanden/accounts/index.html: the service row now reads "Artifact Site".web-fetch, routereport-manifest.json: the embedded report template now has the renamed package and publish commands.Test plan
ruff checkcommands pass.tests/test_golden_reports.py: 10 passed afterUPDATE_GOLDEN=1; only the routes above changed.${NAME}references; diagnostics also leave the process environment unchangedtests/test_ci_gate.py: 18795 passed, 60 skipped, 62 failed. I did not triage all 62 or run them on the base commit. The ones I inspected fail withHistorical benchmark source is not recorded in the dataset lockorDataset revision is not recorded in data-lock.jsonfrom the shared local environment, and thetests/test_optional_reports.pytraceback imports the other checkout's source. CI on Linux is the gate for these; see the checks on this PR.tests/test_golden_reports.py,tests/test_artifact_auth.py,tests/web_searchandtests/trajectory_replay/test_diagnostics.pygave 528 passed. The new tests cover the token order and the judge allowlist; the judge test failed before its fix.tests/browser_use/test_runner.py,tests/test_golden_reports.pyandtests/test_config.pygave 92 passed, with no golden changes. The new test drives the--env-filebranch ofrun()and fails if either read re-enables interpolation.tests/trajectory_replay,tests/test_manage_webarena_rainbond_pool.py,tests/test_golden_reports.pyandtests/test_config.pypass with no golden changes. The new test failed before the fix. I did not call a live Rainbond API.tests/trajectory_replay/public_webarena/test_rainbond_slices.py,tests/test_manage_webarena_rainbond_pool.pyandtests/trajectory_replay/public_webarena/test_config.pygave 46 passed;tests/test_golden_reports.py,tests/trajectory_replay/test_diagnostics.pyandtests/test_config.pygave 31 passed, with no golden changes. The new test shows a token only in an operator-named--env-fileis refused. It pins behavior that already existed since the previous round, so it did not fail before this round.tests/test_golden_reports.py,tests/browser_useandtests/environments/test_webarena_topology.pygave 305 passed, with no golden changes. The new tests load the checker against a registry with an extra password and reject it in both checks; the two that use that password failed before the fix. The four existing passwords are still rejected.topology._loadnow rejects a blank or missing site password, and an empty registry no longer makes the privacy check match every file. The new tests failed before the fix.