# FileManagementToolkit

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/agent_toolkits/file_management/toolkit/FileManagementToolkit)

Toolkit for interacting with local files.

*Security Notice*: This toolkit provides methods to interact with local files.
    If providing this toolkit to an agent on an LLM, ensure you scope
    the agent's permissions to only include the necessary permissions
    to perform the desired operations.

    By **default** the agent will have access to all files within
    the root dir and will be able to Copy, Delete, Move, Read, Write
    and List files in that directory.

    Consider the following:
    - Limit access to particular directories using `root_dir`.
    - Use filesystem permissions to restrict access and permissions to only
      the files and directories required by the agent.
    - Limit the tools available to the agent to only the file operations
      necessary for the agent's intended use.
    - Sandbox the agent by running it in a container.

    See https://python.langchain.com/docs/security for more information.

## Signature

```python
FileManagementToolkit()
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `root_dir` | `unknown` | Yes | Optional. The root directory to perform file operations. If not provided, file operations are performed relative to the current working directory. |
| `selected_tools` | `unknown` | Yes | Optional. The tools to include in the toolkit. If not provided, all tools are included. |

## Extends

- `BaseToolkit`

## Properties

- `root_dir`
- `selected_tools`

## Methods

- [`validate_tools()`](https://reference.langchain.com/python/langchain-community/agent_toolkits/file_management/toolkit/FileManagementToolkit/validate_tools)
- [`get_tools()`](https://reference.langchain.com/python/langchain-community/agent_toolkits/file_management/toolkit/FileManagementToolkit/get_tools)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/agent_toolkits/file_management/toolkit.py#L31)