[建议 / Feature] Add "Limit External Directory Access" setting to prevent package installs outside the workspace
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
提交前确认 · Pre-submission checklist
- 我已搜索过现有 issue,确认这不是重复提议 / I searched existing issues and confirmed this isn't a duplicate.
- 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category
对话 / Agent 交互 · Agent chat / interaction
涉及的 Agent 框架 · Agent framework
ZCode Agent(自研)
使用场景 · Use case
[建议 / Feature] Add "Limit External Directory Access" setting to prevent package installs outside the workspace
Agent installs packages outside the current project directory — add option to restrict access to workspace only
Currently, the agent is able to install packages and modify files outside the boundaries of the current project/workspace directory. This is unexpected and potentially unsafe behavior, since actions taken during a task should generally be scoped to the project the user is actively working in.
To fix this, this request asks for a new setting — "Limit External Directory Access" (or similarly named) — that, when enabled, restricts the agent to operating only within the current workspace directory. Any attempt to install packages, create files, or modify files outside that boundary would be blocked or require explicit user confirmation.
This gives users control over the blast radius of agent actions and prevents unintended side effects on the wider file system.
Describe the Bug
The agent installs packages outside the current project directory instead of keeping installs scoped to the workspace. There is currently no setting to prevent or restrict this behavior.
Actual Behavior
The agent installs packages outside the current project directory without restriction, and there is no available setting to limit this behavior to the workspace only.
Impact
This behavior can lead to unintended changes to the user's system outside the project scope — such as global package installs, dependency conflicts across unrelated projects, or unexpected file changes. It reduces predictability and safety when running agent tasks, especially for users working across multiple projects on the same machine.
Steps to Reproduce
- Open a project with ZCode v3.11.2..
- Give the agent a task that requires installing a package.
- Observe that the package is installed outside the current project directory (e.g., globally or in an unrelated path) rather than being scoped to the workspace.
- Check settings for any option to restrict this — none is currently available.
建议方案 · Proposal
To fix this, this request asks for a new setting — "Limit External Directory Access" (or similarly named) — that, when enabled, restricts the agent to operating only within the current workspace directory. Any attempt to install packages, create files, or modify files outside that boundary would be blocked or require explicit user confirmation.
预期价值 · Expected value
Expected Behavior
- Package installations and file operations triggered by the agent should stay within the current project/workspace directory by default, or at minimum be restrictable via a setting.
- A new option, such as "Limit External Directory Access," should let users block the agent from installing packages or modifying files outside the workspace.
- If the agent needs to act outside the workspace, it should require explicit user confirmation when this setting is enabled.
你认为的优先级 · Your perceived priority
高 · High
你使用的 ZCode 版本 / 环境 · ZCode version / environment
Windows 11 25H2
补充材料 · Additional context
I use full access mode, it should be applied only to the current project directory.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names CONTRIBUTING.md, ZCode Agent, full access mode, and ZCode v3.11.2, but no implementation files or tests. Start by reviewing CONTRIBUTING.md and locating the settings and agent-operation entry points related to package installs and file changes. Done means workspace boundaries are enforced and out-of-workspace actions are blocked or require confirmation when the setting is enabled.
Written by the indexing model from the issue text.
Assessment
- Domain
- security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100