360 Secure SkillHub
360 安全技能中心

Hallucinated Paths

该 Skill 是一份排障指南,说明智能体回复中虚构文件、目录或模块位置的症状,并给出处理方式:引用路径前用文件存在性检查核实、先搜索再作答、找不到时明确说明、新建文件时说明其为新增并给出路径理由、编辑后确认文件真实存在。

mvogt99
mvogt99
热度 44.11
最近更新 2026-05-11 17:46:01
分类:开发依赖:读写文件应用场景:代码审查 / 调试排错

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add hallucinated-paths
Metadata
name
hallucinated-paths
description
Reply cites file paths, directories, or module locations that do not exist in the current project.
emoji
🗺️
metadata
{"clawdis":{"os":["macos","linux","windows"]}}

hallucinated-paths

The reply references files or directories that aren't on disk. The agent invented a plausible-sounding location (e.g., src/utils/helpers.ts) because similar paths usually exist in projects like this one.

Symptoms

  • A quoted path doesn't exist when you check the filesystem.
  • The reply uses a path structure that matches convention but the specific file is absent (e.g., src/components/Button.tsx in a project that actually puts components elsewhere).
  • Imports reference modules that cannot be resolved.
  • "Edit X file at path Y" instructions fail because Y is not there.

What to do

  • Before quoting a path, verify it with a real file-existence check (ls, stat, a glob search). Do not rely on memory or convention.
  • When unsure where something lives, search first: grep for the symbol, glob for the filename, read the repo layout.
  • If the answer requires a path that doesn't exist, say so explicitly — don't fabricate. "I couldn't find a file for X" is correct; inventing one is not.
  • When proposing to create a new file, state clearly that it is new, and justify why it belongs at that path given the repo's actual conventions.
  • After editing, verify the edited file is the one that exists, not a hallucinated sibling.