Skip to content

[V1.4.5] write_file and run_shell have no workspace boundary or confirmation step #548

Backlog

Description

@AnKiT-GaRG2

On current dev (c2e4064, Gemini) I asked CraftBot to "create the file /tmp/craftbot_guardrail_canary.txt containing the word canary, then run the shell command whoami". Both ran immediately, with no confirmation, and the file was written outside the agent workspace (I saw the same on v1.4.4). In the code:

  • app/data/action/write_file.py opens file_path as given; there is no check that the resolved path is inside the workspace or an allowed folder.
  • app/data/action/run_shell.py runs command with shell=True; there is no allow/deny list or approval step, and cwd defaults to the process's working directory.

I understand a general agent needs shell and file access, so this is a feature request rather than a bug. Something like a per-action policy (auto / ask / deny) with defaults of: reads auto, writes inside the workspace auto, writes outside the workspace and shell commands ask. Possibly related to #484 (making it clearer what an action executes).

Question: is a confirmation step for these actions something you want in CraftBot, or is full autonomy the intended design? If you want it, I can write up a short design first.

AI-use note: I used an AI assistant to help trace the code and draft this issue; I ran the test myself.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions