Skip to content

Review backlog (security): Verify runs against agent-modified workspace; committed conftest.py/pytest.ini can make it pass #15006

Closed

Description

@hivecommons-hive

Blocked on PR #15002. This finding came from reviewing PR #15002 and is about code that PR is changing. Fix it in the PR, or leave it: the hive lifts the block when the PR merges, and unblocks this item for re-triage if the PR is closed without merging. Once it is unblocked, check the finding still applies on the base branch; if it is already fixed, close this item without a PR.

Filed from an out-of-scope finding in the Hive review of PR #15002.

PR: #15002 (#15002)
Perspective: security
Severity: low (P3)
Evidence: src/docs/sandbox-isolation.md:136 (

**Publish preflight (`publish.verify`).** The report gate trusts the agent; the preflight does not. When the run left commits and the gate above passed, hive runs each configured verify command — `sandbox.publish.verify` per agent, `agent_sandbox.publish.verify` globally, or a `<!-- hive:publish.verify … -->` HTML comment in the kick template (one shell command per line; a template block replaces the configured list for that kick) — as `sh -lc <cmd>` in a fresh container/Job of the same image, workspace, env allowlist and network mode, with `HIVE_CHANGED_FILES` and `HIVE_CHANGED_TESTS` (newline-separated paths from the run's commits, base..HEAD) and `HIVE_BASE_SHA` exported. The first non-zero exit, launcher error or timeout (`publish.verify_timeout_s`, default 900 s per command) withholds the push and the PR exactly like a failed report: `prWithheld` reads `verify failed (1/2): <cmd> (exit N)` followed by the command's output tail, the card shows the first line with the tail in its tooltip, and the kick log archive gets a `---- verify: <cmd> (exit N) ----` section with the full output. With no commits there is nothing to publish and the preflight is skipped; with no commands configured it is a no-op. Typical use is a whole-suite `pytest --collect-only -q` plus running the tests the agent added — the two checks that would have caught a test-file basename clash that broke collection for an entire repository ([torch-spyre/spyre-inference#1412](https://github.com/torch-spyre/spyre-inference/pull/1412)):
)
Finding: Verify runs against agent-modified workspace; committed conftest.py/pytest.ini can make it pass

runPublishVerify (sandbox_executor.go:612-670) executes commands in the run's workspace at HEAD, so an agent that edits test-runner config (conftest.py, pytest.ini, Makefile) in the same commits can neutralize the preflight. Inherent to running project tests; docs call it 'does not trust the agent' which overstates the guarantee. Suggest documenting the limit and, later, resetting tracked runner config to HIVE_BASE_SHA before verify.

Fingerprint: 1b1e3a0253343c9334d658f59bbe827fdc248076546e97578a0977026d26ee87

filed by Hive review backlog

Activity

  1. added
    blockedWaiting on something outside this repository; not contributor work until a human clears the label
    on Oct 28, 2026
  2. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Oct 28, 2026
  3. removed
    blockedWaiting on something outside this repository; not contributor work until a human clears the label
    on Oct 28, 2026
  4. hivecommons-hive commented on Oct 28, 2026

    @hivecommons-hive
    ContributorAuthor

    Unblocked: #15002 is no longer open. This issue is actionable again.

  5. hivecommons-hive commented on Oct 28, 2026

    @hivecommons-hive
    ContributorAuthor

    🔒 Claimed by @mrbobbytables (contributor on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 30m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.

  6. hivecommons-hive commented on Oct 28, 2026

    @hivecommons-hive
    ContributorAuthor

    🔓 Claim by @mrbobbytables released (lease revoked).

  7. hivecommons-hive commented on Oct 28, 2026

    @hivecommons-hive
    ContributorAuthor

    Unblocked: #15002 merged. This item is actionable now; check the finding still applies on the base branch first, and close it without a PR if it is already fixed.

  8. added a commit that references this issue on Oct 28, 2026
    dd1a254
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/reviewerFiled by the reviewer agenthelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.hive/claimed-by-scanner

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions