mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-23 21:05:08 +00:00
Treat `.agents/skills/` (project-local) and `~/.agents/skills/` (global) as **sensitive paths**, on par with `.zed/` and the global config directory. The agent's built-in editing tools (`edit_file`, `write_file`, `create_directory`, `delete_path`, `move_path`, `copy_path`) now require explicit user authorization before modifying anything inside those paths, because the contents of skill files control agent behavior. This protection is worth landing on its own, ahead of Zed adding its own skills support: other agents (e.g. Claude Code) already write skill files into these locations, so a Zed installation may already have skills on disk that should not be silently editable by the agent. Also tightens the **pre-existing `.zed/` check** to compare path components case-insensitively. macOS and Windows use case-insensitive filesystems by default, so without this fix a malicious settings author could bypass the local-settings classifier with `.ZED/settings.json` (the canonicalized inode would match, but the path-component comparison would miss it). The new `.agents/skills/` check has the same hazard and now shares a single `component_matches_ignore_ascii_case` helper with the `.zed/` check. Introduces the `agent_skills` crate, scoped for now to just the path constants and helpers (`global_skills_dir`, `project_skills_relative_path`, `SKILL_FILE_NAME`) so the tool-permission machinery can recognize the agent skills tree without depending on a skill discovery / parsing / loading layer. Those will land in follow-up PRs. Closes AI-217 Release Notes: - Agent: Require user confirmation before letting tools modify files inside `.agents/skills/` (per-project) or `~/.agents/skills/` (global), so skills installed by any agent are protected from unsolicited edits --------- Co-authored-by: MartinYe1234 <52641447+MartinYe1234@users.noreply.github.com> Co-authored-by: Martin Ye <martinye022@gmail.com> Co-authored-by: Danilo Leal <daniloleal09@gmail.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE-APACHE | ||