feat: implement secure filesystem tools for g4f models#3372
feat: implement secure filesystem tools for g4f models#3372imanpr33trai wants to merge 1 commit intoxtekky:mainfrom
Conversation
Adds a secure, audited filesystem tool suite allowing AI models to read, write, list, and search files within whitelisted directories. Includes path traversal protection, resource limits, and forbidden pattern blocking to ensure safe execution of file operations through tool calling.
|
This is my first contribution in my dev career, and I really wanted to contribute to this project. Because I am making a small agent using gpt4free, and the models can't create, delete, edit, list, or access files properly, I added these features to help with those problems. If you think some more things should be added, please make sure to notify me. I would really appreciate your feedback. If you think something needs to be improved or changed, please let me know. I’d be happy to work on it and continue contributing. |
|
Hey @imanpr33trai, thanks! I've got a few questions: Why aren't you using an MCP server? The tool calls in the body aren't OpenAI compatible. Can it read/write all user files? Did you add verification for a specific directory? Is it enabled for all requests, or can I enable it with a config? I don't want it used on my demo server for security reasons. |
|
thank you for reviewing, i am now adding the mcp server to use the tool calls through it should i add the config.json type like configuration for the g4f about the permissions of the tool calls and human interaction before model using the tool i am customizing or adding some new few things now like :
**If you have any suggestions ! ** |
Adds a secure, audited filesystem tool suite allowing AI models to read, write, list, and search files within whitelisted directories. Includes path traversal protection, resource limits, and forbidden pattern blocking to ensure safe execution of file operations through tool calling.