filesystem-mcp-guardrails
Skill6 starsChanged 4 months agoApache-2.0View on GitHub
Use when designing or reviewing filesystem MCP access, path boundaries, allowed roots, method allowlists, and safe local file operations.
- Reads credentials
In this repository116 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/graphify/references/CLAUDE.mdCLAUDE.md
- agent-config-security-auditSkill
- agent-harness-designSkill
- agent-readable-docsSkill
- agent-runtime-patternsSkill
- agent-session-forensicsSkill
- ai-regression-testingSkill
- ai-slop-cleanerSkill
- api-doc-reviewSkill
- architecture-decision-recordsSkill
- architecture-simplificationSkill
- ask-claudeSkill
- ask-codexSkill
- ask-geminiSkill
- autonomous-delivery-pipelineSkill
- baseline-comparison-reviewSkill
- bigquery-cost-auditSkill
- brainstormingSkill
- browser-automation-safetySkill
- bug-huntSkill
- build-fix-minimal-diffSkill
- canonical-advisor-routingSkill
- change-impact-checkSkill
- changelog-generatorSkill
- ci-failure-readoutSkill
- codebase-migration-batchesSkill
- context-compressionSkill
- context-docsSkill
- context-minimizationSkill
- context-retrieval-loopSkill
- data-qualitySkill
- dataset-split-reviewSkill
- dbt-incremental-strategy-auditSkill
- dbt-preflightSkill
- dbt-strategySkill
- dead-code-removalSkill
- defuddleSkill
- dependency-cleanupSkill
- deploy-pipeline-runbookSkill
- dispatching-parallel-agentsSkill
- doc-consistency-checkSkill
- environment-doctorSkill
- experiment-tracking-reviewSkill
- failure-triageSkill
- finishing-a-development-branchSkill
- flaky-test-investigationSkill
- gh-address-commentsSkill
- github-ci-failure-triageSkill
- graphifySkill
- handoff-disciplineSkill
- hard-won-skill-extractorSkill
- hook-safety-reviewSkill
- incident-readoutSkill
- incremental-migrationSkill
- json-canvasSkill
- local-rag-mcpSkill
- log-driven-diagnosisSkill
- managed-codebase-contextSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use when configuring, reviewing, or debugging a local filesystem MCP server — particularly when deciding which paths to expose, which …
- Distinctive: line 25
Before starting a filesystem MCP server:
- Distinctive: line 54
Never configure MCP servers with root or wide-ranging access.
- Distinctive: line 55
Do not start a filesystem MCP server without explicit user approval for the scope.
- Distinctive: line 56
Prefer read-only operations until write need is explicit and scoped.
- Distinctive: line 57
Do not log configured roots in a way that exposes sensitive path contents.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Filesystem MCP Guardrails
When to use
Use when configuring, reviewing, or debugging a local filesystem MCP server — particularly when deciding which paths to expose, which methods to allow, and how to enforce workspace boundaries.
Safety Model
The core constraint is strict path bounding: the MCP server must only operate within explicitly declared workspace roots. No exceptions.
| Principle | Rule |
| Scope | Bind to the project workspace directory only — never /, ~, or OS dirs |
| Access | Start read-only; add write methods only when the use case requires them |
| Methods | Use an allowlist — block delete/move/rename by default |
| Secrets | Never expose .env, credential files, SSH keys, or token stores |
| Approval | Always require user approval before starting a new MCP server process |
Configuration Checklist
Before starting a filesystem MCP server:
- Allowed roots list is explicit and scoped to the project directory.
- No root is set to
/,~, or any system-level path. - Method allowlist is defined (e.g.,
read_file,list_directory,search_files). - Destructive methods (
delete_file,move_file,write_file) are explicitly enabled only if required. - Sensitive file patterns are excluded:
*.env,*.key,*.pem,*secrets*,.ssh/. - Server timeout is set (avoid hanging processes).
- Log output does not include file contents — only paths and operation results.
Workflow
- Define scope — identify which directories the agent legitimately needs to access for this task.
- Set roots — configure the server with the narrowest possible root list (usually just the project root).
- Define allowlist — start with read-only methods; add write methods only after explicit use-case review.
- Validate path boundaries — test that requests for paths outside the declared roots are refused with a clear error.
- Verify cleanup — confirm the server process exits cleanly when the session ends; no background processes left running.
Out-of-Root Path Refusal
The server must return a clear error for any request targeting a path outside declared roots:
Error: path '/etc/passwd' is outside allowed workspace root '/home/user/project'Silent failures or fallback to broader access are not acceptable.
Safety Constraints
- Never configure MCP servers with root or wide-ranging access.
- Do not start a filesystem MCP server without explicit user approval for the scope.
- Prefer read-only operations until write need is explicit and scoped.
- Do not log configured roots in a way that exposes sensitive path contents.
- On Windows: validate boundary behavior with both forward-slash and backslash paths.
Validation / Done Criteria
- Allowed roots are listed and scoped to the workspace.
- Out-of-root path requests are refused with a clear error.
- Method allowlist is explicit; destructive methods are not in the default list.
- Server process exits cleanly after session ends.
References
references/path-boundary-checklist.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

