Skip to content

fix(runner): preflight extra_info staging against basename and personal-info collisions - #412

Open
phatloi0010 wants to merge 1 commit into
TIGER-AI-Lab:mainfrom
phatloi0010:fix/native-extra-info-collision-safety-409
Open

phatloi0010 wants to merge 1 commit into
TIGER-AI-Lab:mainfrom
phatloi0010:fix/native-extra-info-collision-safety-409

Conversation

@phatloi0010

Copy link
Copy Markdown

Summary

Fixes #409.

Native copy_extra_info and build_instruction previously flattened extra_info[].path entries by basename (src.name) without preflight collision checks, allowing duplicate basenames across subdirectories (e.g. a/reference.txt and b/reference.txt) or reserved personal-info filenames (alex_green_personal_info.json, email_credentials.json, alex_green_resume.pdf) to silently overwrite earlier staged attachments or generated disposable credentials.

Changes

  • Add RESERVED_PERSONAL_INFO_FILES and validate_extra_info_entries() in src/clawbench/runner/run_support/task.py to preflight all extra_info destination names before any file is copied.
  • Reject duplicate attachment basenames (extra_info basename collision: ...), reserved personal-info filenames, and collisions with existing files in personal_info_dir with a ValueError before performing any shutil.copy2 writes, leaving generated personal-info files and previously staged attachments untouched.
  • Validate extra_info entries in validate_task_data(), build_instruction(), and copy_extra_info(), and classify ValueError during preparing_personal_info in src/clawbench/runner/run.py as task_data.
  • Add unit and native-runner tests in tests/test_extra_info_staging.py covering the Native extra_info staging silently overwrites same-name attachments and generated personal files #409 reproduction, duplicate basenames, reserved personal-info collisions, existing staged file collisions, task_data classification in run.py, and ordinary distinct attachments.

Testing

  • pytest tests/test_extra_info_staging.py tests/test_host_resources.py -v (20 passed)
  • ruff check & ruff format --check

…al-info collisions

Reject duplicate extra_info attachment basenames and collisions with reserved
or existing personal-info files before staging any files or building the task
instruction, and classify native extra_info validation failures as task_data.

Fixes TIGER-AI-Lab#409

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native extra_info staging silently overwrites same-name attachments and generated personal files

1 participant