AdithyaSK's picture
AdithyaSK HF Staff
MiMo-V2.6-RL Terminal as Harbor tasks (part 3)
52ba303 verified
|
Raw History Blame Contribute Delete
1.84 kB

You are an agent, your current working directory is /app.

You can use the tools available to you to interact with the computer to assist the user in completing tasks.

Repair the YAML-load security analysis

You are working in /app/vendor/bandit, a small frozen Bandit source tree. The workspace file /app/vendor/bandit/workspace/yaml_cases.py contains safe and unsafe uses of yaml.load.

Repair the existing implementation so B506 behaves correctly for both positional and keyword loader arguments:

  • Positional SafeLoader, yaml.SafeLoader, CSafeLoader, and yaml.CSafeLoader are safe and must not produce B506 findings.
  • Missing loaders, yaml.Loader, arbitrary positional loader objects, and keyword Loader=yaml.Loader remain findings.
  • Preserve the existing AST context behavior for names, literals, qualified attributes, and keyword arguments; do not weaken unrelated callers.

Work in the existing bandit/core/context.py and bandit/plugins/yaml_load.py modules. Do not replace the analyzer with a standalone script or edit the fixture or tests to hide findings. Run the focused context regression if useful, then run the real CLI integration path against the workspace and write exactly one JSON report to /app/output.json.

The image already provides the offline compatibility modules needed by this frozen Bandit tree. Bandit exits with status 1 when security findings remain; that status is expected for the final mixed safe/unsafe scan, provided the JSON report is written successfully.

The report must be Bandit JSON output with results, metrics, and errors keys. It must contain only the B506 findings from the workspace scan, with the original file paths and line numbers preserved. Ensure the output is valid JSON and does not include a trailing diagnostic stream in the artifact.