Automatically selected README commands become local code execution
Source references: 5The deterministic orchestrator extracts commands from the README and up to three linked local documents, selects a high-scoring target, and passes it to a local process when `--run-selected` is enabled. Being documented in a README does not make a command trustworthy.
A malicious or compromised repository could use an apparent setup, evaluation, or inference command to read or modify user files, download content, access network services, or consume substantial resources. Native-shell mode also enables shell features such as redirects and pipelines.
This risk is supported, but only when the user explicitly enables `--run-selected`. The orchestrator extracts commands from the README and up to three linked local documents, selects a target itself, and passes the selected command to the local runtime. Documentation does not make a command trustworthy; it could read or change files, use credentials, or access the network. Users can require review of the final argv and isolate untrusted repositories.
scan_data = run_json(scan_script, ["--repo", str(repo_path), "--json"]) readme_path = scan_data.get("readme_path") command_data: Dict[str, Any] = {"commands": [], "counts": {}, "warnings": []} if readme_path: command_data = run_json(extract_script, ["--readme", readme_path, "--json"]) command_data = delegate_to_docs(readme_path, extract_script, command_data)Show 4 other places
chosen = choose_goal(command_data.get("commands", []), repo_path) dataset_hint = derive_dataset_hint(asset_data) checkpoint_hint = derive_checkpoint_hint(asset_data) run_data: Dict[str, Any] = { ) else: run_data = maybe_run_command( repo_path, chosen["documented_command"], args.timeout, args.user_language, args.shell_mode, runtime_root, model_adapter, args.monitor_gpu, ) creationflags = subprocess.CREATE_NEW_PROCESS_GROUP if os.name == "nt" else 0 process = subprocess.Popen( argv, env=environment, cwd=repo, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, encoding="utf-8", errors="replace", bufsize=1, creationflags=creationflags, start_new_session=os.name != "nt", ) except (FileNotFoundError, ShellSyntaxRequired, OSError, ValueError) as exc: ) elif args.run_selected: if chosen["selected_goal"] == "training": run_data = maybe_run_training( repo_path=repo_path, command=chosen["documented_command"], train_script=train_execute_script, lane=args.lane, user_language=args.user_language, full_training_authorized=args.full_training_authorized, train_timeout=args.train_timeout, dataset_hint=dataset_hint, checkpoint_hint=checkpoint_hint, resume_from=args.resume_from, max_train_steps=args.max_train_steps, shell_mode=args.shell_mode, runtime_root=runtime_root, model_profile_json=args.model_profile_json, required_model_capabilities=args.require_model_capability, gpu_monitor_enabled=not args.no_gpu_monitor, ) else: run_data = maybe_run_command( repo_path, chosen["documented_command"], args.timeout, args.user_language, args.shell_mode, runtime_root, model_adapter, args.monitor_gpu, )