helix.mcp: Skill for Claude Code

.copilot/skills/path-boundary-comparison/SKILL.md

path-boundary-comparison is a skill for Claude Code, Codex from lewing/helix.mcp. It costs 21 tokens per session (400 once invoked), scanned A, original, MIT.

A security guide for checking whether a file path stays inside a trusted folder. It covers path normalization, exact folder boundaries, case-sensitive comparisons, and regression tests.

In plain words
What is it for?
Reviewing or implementing containment checks in caches, download helpers, archive extraction, and other file-handling code.
Why use it?
It helps prevent path traversal, where crafted input makes software read or write files outside the allowed folder.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

This is lewing/helix.mcp's own configuration. It tells Claude Code and Codex how to work on helix.mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything helix.mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to lewing/helix.mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/lewing/helix.mcp/main/.copilot/skills/path-boundary-comparison/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/lewing/helix.mcp

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for path-boundary-comparison

README.md
[![agentmods](https://agentmods.dev/badge/skills/lewing/helix.mcp/path-boundary-comparison/github.svg)](https://agentmods.dev/skills/lewing/helix.mcp/path-boundary-comparison)
Your own site
<a href="https://agentmods.dev/skills/lewing/helix.mcp/path-boundary-comparison"><img src="https://agentmods.dev/badge/skills/lewing/helix.mcp/path-boundary-comparison/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for path-boundary-comparison

Your own site · 80×15
<a href="https://agentmods.dev/skills/lewing/helix.mcp/path-boundary-comparison"><img src="https://agentmods.dev/badge/skills/lewing/helix.mcp/path-boundary-comparison.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 400 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00021 $0.00400
Opus 5 $0.00010 $0.00200
Sonnet 5 $0.00004 $0.00080
Haiku 4.5 $0.00002 $0.00040

Measured 8d ago against content hash c1da10477271, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

path-boundary-comparison scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.copilot/skills/path-boundary-comparison/SKILL.md · 37 lines

What it actually says

Context

Use this when code must verify that a computed file path stays inside a trusted root directory. This commonly appears in cache stores, download helpers, extraction code, and any path traversal defense.

Patterns

  • Normalize both the candidate path and the root with Path.GetFullPath(...) before comparing.
  • Preserve the root directory boundary explicitly by trimming trailing separators from the root and then adding exactly one Path.DirectorySeparatorChar for child-path checks.
  • Compare security boundaries with StringComparison.Ordinal, not ignore-case comparisons. Case folding can make a sibling path appear to be under the trusted root on case-sensitive filesystems.
  • Allow the exact root path as a special case in addition to child paths.
  • Add a regression test for a sibling path that differs only by casing (for example root vs ROOT) so the security fix stays pinned if someone later reintroduces ignore-case comparisons.

Examples

var fullPath = Path.GetFullPath(path);
var fullRoot = Path.GetFullPath(root);
var rootWithoutSeparator = Path.TrimEndingDirectorySeparator(fullRoot);
var rootedPrefix = rootWithoutSeparator + Path.DirectorySeparatorChar;

if (!fullPath.StartsWith(rootedPrefix, StringComparison.Ordinal) &&
    !string.Equals(fullPath, rootWithoutSeparator, StringComparison.Ordinal))
{
    throw new ArgumentException("Resolved path escapes the trusted root.");
}

Anti-Patterns

  • Using StartsWith(..., StringComparison.OrdinalIgnoreCase) for a security boundary check.
  • Comparing against a root string without enforcing a separator boundary, which can make /tmp/root2 look like it is inside /tmp/root.
  • Comparing raw user input paths before canonicalizing them with Path.GetFullPath(...).
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 37 lines · 21 tokens per session scan A c1da10477271

Subscribe to this mod's changes

path-boundary-comparison is a skill published in the GitHub repository lewing/helix.mcp (4 stars, last pushed yesterday), licensed MIT. It adds 21 tokens to every session and 400 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.