feat: add sandboxed File System component for agents #12901
feat: add sandboxed File System component for agents #12901Cristhianzl wants to merge 9 commits intorelease-1.10.0from
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-1.10.0 #12901 +/- ##
==================================================
+ Coverage 53.26% 53.88% +0.61%
==================================================
Files 2033 2047 +14
Lines 184606 186342 +1736
Branches 27800 28041 +241
==================================================
+ Hits 98339 100407 +2068
+ Misses 85168 84825 -343
- Partials 1099 1110 +11
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
erichare
left a comment
There was a problem hiding this comment.
@Cristhianzl Seems like an awesome addition, some things to address:
Blocking
-
User-controlled sandbox root can expose server files
root_pathdefines the entire sandbox boundary. In hosted or multi-user deployments, a flow author could set it to/, the app config directory, or another sensitive server path, then read files or overwrite them whenread_only=false.Please either cloud-gate this component like other local filesystem features, or make the root server-controlled via an allowlist/per-flow workspace path rather than fully user-controlled.
-
grep_searchcan be DoS’d by agent-supplied regexgrep_searchcompiles arbitrary regex and runs it over file contents without a timeout or safe-regex guard. A catastrophic-backtracking pattern can pin a worker before output caps apply.Please add a mitigation, such as a timeout-capable regex path, rejecting unsafe patterns, or making literal search the default with regex as an explicitly constrained mode.
Should Fix
-
edit_filecan allocate huge replacement output before enforcing size limitsThe replacement string is built before checking the resulting size. With
replace_all=True, or especiallyold_string="", a small file plus a largenew_stringcan allocate far beyondMAX_FILE_SIZE_BYTESbefore the guard runs.Please reject empty
old_stringand calculate the projected encoded size before constructing the replacement.
OBJECTIVE: Give Langflow agents safe, scoped filesystem access via a configurable root path, exposing 5 standard ops (read/write/edit/glob/grep) with adversarial-grade boundary checks and the modern Tool Mode toggle.
CHANGES: