Llm Filesystem Tools banner
dansasser dansasser

Llm Filesystem Tools

Security community

Description

Python filesystem tools for AI models and LLMs. Secure directory access, file reading, grep search for Ollama, OpenAI, Anthropic Claude. Built-in path validation and security policies. Framework-agnostic function calling tools. Ideal for AI coding assistants and automated code analysis.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

LLM Filesystem Tools

**Secure filesystem access for Large Language Models with governance-first design.**

[![PyPI version](https://badge.fury.io/py/llm-fs-tools.svg)](https://badge.fury.io/py/llm-fs-tools) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)

Stop reinventing filesystem tools for every LLM project. `llm-fs-tools` provides production-ready, secure file operations that work with any LLM supporting function calling - Ollama, OpenAI, Anthropic, and more.

The Problem

You want your AI assistant to analyze code, search files, or explore directories. You have three bad options:

  1. Inject everything into the prompt - Wastes tokens, hits context limits, can't scale
  2. Use heavy frameworks - LangChain/LlamaIndex lock you into their ecosystem
  3. Roll your own - Reinvent security, path validation, and tool schemas every time

The Solution

pip install llm-fs-tools
from llm_fs_tools import FileSystemTools, SecurityPolicy

# Define security boundaries
policy = SecurityPolicy(
    allowed_roots=["./my-project"],
    max_file_size_mb=5,
    blocked_patterns=["*.env", ".git/*"]
)

# Initialize tools
fs_tools = FileSystemTools(policy)

# Use with any LLM (Ollama example)
import ollama

response = ollama.chat(
    model='qwen2.5-coder',
    messages=[{'role': 'user', 'content': 'Analyze the codebase structure'}],
    tools=fs_tools.get_tool_definitions()  # Auto-generates schemas
)

# Execute tool calls
for tool_call in response.message.tool_calls:
    result = fs_tools.execute(
        tool_call.function.name,
        tool_call.function.arguments
    )

**That's it.** Your model can now safely explore filesystems.


Features

🔒 Security First

  • Path traversal protection - Validates all paths stay within allowed roots
  • Configurable boundaries