Skip to content

feat(tools): snapshot size limit for transactional ShellExecutor #2474

@bug-ops

Description

@bug-ops

Context

Follow-up from PR #2473 (transactional ShellExecutor). Security audit identified that large files are copied without bounds during snapshot, risking disk exhaustion.

Proposed Change

Add max_snapshot_bytes: u64 to ShellConfig (default 0 = unlimited). Before copying each file in TransactionSnapshot::capture(), check cumulative snapshot size; abort with ToolError::SnapshotFailed if limit is exceeded.

[tools.shell]
transactional = true
max_snapshot_bytes = 104857600  # 100 MB

Priority

P3 — useful safety guard, not blocking for typical use cases.

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexityenhancementNew feature or requesttoolsTool execution and MCP integration

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions