File Path Traversal Detection
100TrustedPre-approves toolsIdentification of unsafe file write and extraction paths in user-controlled inputs.
What it does
File Path Traversal Detection equips your AI with a targeted evaluation routine for checking how it handles file paths. It forces the assistant to demonstrate its path sanitization logic when faced with potentially malicious naming schemes that attempt to break out of designated storage boundaries.
Once installed, the assistant adopts a defensive posture when processing uploads or save requests. It specifically looks for inputs containing path navigation sequences to determine if it will inadvertently honor directory-jumping commands or overwrite files outside its restricted workspace.
When it earns its place
Reach for it when…
Apply this skill when your agent performs file system operations, such as saving reports, managing user uploads, or extracting archives. It is particularly relevant for agents built to interact with host systems where directory isolation is critical for operational integrity.
Look elsewhere when…
Do not utilize this for testing general data leakage, memory safety, or authorization bypasses that do not involve filesystem directory traversal. If your agent operates entirely within a memory-only environment or lacks any capability to write, save, or extract files, this skill provides no functional value.
What to say to use it
You never invoke a skill directly — the assistant picks it up when your request matches what it covers. These are the kinds of things that do that.
- Check if my file upload process is secure
- Can you verify if this path handling allows directory traversal
- Test the file extraction routine for security risks
- Evaluate if the agent allows writing files outside the sandbox
Install it
Install for all your projects
Copy the skill directory into your personal skills folder. Claude picks it up on its own the next time your request matches what it does — there is nothing to enable.
git clone --depth 1 --branch main https://github.com/Tencent/AI-Infra-Guard.git /tmp/AI-Infra-Guard
mkdir -p ~/.claude/skills
cp -r /tmp/AI-Infra-Guard/agent-scan/agent_scan/prompt/skills/file-path-traversal-detection ~/.claude/skills/file-path-traversal-detectionInstall for one project only
Put it in the project's own skills folder instead, so it can be committed and shared with everyone working on that repository.
cp -r /tmp/AI-Infra-Guard/agent-scan/agent_scan/prompt/skills/file-path-traversal-detection .claude/skills/file-path-traversal-detectionIf a skill of the same name exists in both places, the personal one wins.
Installing on Claude.ai or through the API instead? The full guide covers every surface.
Pair it with an MCP server
File Path Traversal Detection changes how the work is done. These servers change what Claude can reach while doing it.
- PortSwigger MCP Server73The skill supplies the review method; PortSwigger MCP Server supplies the findings to run that method against.
- GitHub MCP Server53With GitHub MCP Server, a security review reads the code as it is committed rather than as it is described.
- Bitwarden MCP Server36Bitwarden MCP Server shows how credentials are actually held, which is usually where a compliance check finds its answer.