Skip to content

Conversation

@edenreich
Copy link
Contributor

@edenreich edenreich commented Aug 12, 2025

Closes #21

This PR implements the excluded paths feature to improve security by preventing the infer CLI from reading sensitive files.

Changes

  • Add exclude_paths field to ToolsConfig with default exclusions for .infer directory
  • Implement path exclusion validation in LocalFileService
  • Add CLI commands for managing excluded paths
  • Update tools list command to show excluded paths
  • Default exclusions prevent access to infer's own configuration files
  • Support for directory patterns with wildcards
  • Update documentation with new commands and configuration options

New Commands

# List excluded paths
infer config tools exclude list

# Add path to exclusion list
infer config tools exclude add ".github/"

# Remove path from exclusion list
infer config tools exclude remove "test.txt"

Generated with Claude Code

claude bot and others added 2 commits August 12, 2025 21:11
- Add exclude_paths field to ToolsConfig with default exclusions for .infer directory
- Implement path exclusion validation in LocalFileService
- Add CLI commands for managing excluded paths:
  - `infer config tools exclude list` - List excluded paths
  - `infer config tools exclude add <path>` - Add path exclusion
  - `infer config tools exclude remove <path>` - Remove path exclusion
- Update tools list command to show excluded paths
- Default exclusions prevent access to infer's own configuration files
- Support for directory patterns with wildcards (e.g., .infer/*)
- Comprehensive pattern matching for exact paths, directories, and prefixes
- Update documentation with new commands and configuration options

Addresses all acceptance criteria:
- Infer CLI cannot modify its own config by default
- Additional excluded paths list under tools configuration  
- Full documentation of the feature

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Eden Reich <[email protected]>
@edenreich edenreich changed the title feat(security): Add excluded paths configuration for enhanced security feat(security): Add excluded paths configuration for improved security Aug 12, 2025
@edenreich
Copy link
Contributor Author

@claude Can you change the sub command to be more explicit infer config tools exclude-path add "<some path>"

@claude
Copy link
Contributor

claude bot commented Aug 12, 2025

Claude finished @edenreich's task —— View job


CLI command structure updated successfully! ✅

I've successfully changed the subcommand from infer config tools exclude to infer config tools exclude-path to make it more explicit as requested.

Completed Tasks:

  • Read current cmd/config.go to understand the command structure
  • Update command structure to use "exclude-path" instead of "exclude"
  • Update CLAUDE.md documentation to reflect new commands
  • Setup development environment and test changes
  • Commit changes to the branch

Changes Made:

  1. Updated command structure in cmd/config.go:

    • Changed configToolsExcludeCmd to configToolsExcludePathCmd
    • Updated all related command variables (configToolsExcludePathListCmd, configToolsExcludePathAddCmd, configToolsExcludePathRemoveCmd)
    • Updated command registration in the init() function
  2. Updated documentation in CLAUDE.md:

    • Changed example commands from infer config tools exclude to infer config tools exclude-path
    • Updated command structure documentation
  3. Verified functionality:

    • Built successfully without errors
    • Linter passed with 0 issues
    • Tests passed
    • Command help text shows the new structure correctly

New Command Structure:

# List excluded paths
infer config tools exclude-path list

# Add path to exclusion list
infer config tools exclude-path add ".github/"

# Remove path from exclusion list
infer config tools exclude-path remove "test.txt"

The changes maintain all existing functionality while providing a more explicit and clear command structure.

claude bot and others added 3 commits August 12, 2025 22:14
- Update CLI command structure from `infer config tools exclude` to `infer config tools exclude-path`
- Rename all related command variables and registrations
- Update CLAUDE.md documentation to reflect new command structure
- Maintain all existing functionality with more explicit command naming

Co-authored-by: Eden Reich <[email protected]>
…or messages

The cat, head and tail are optional, removing those from default whitelisting and the Read command does exactly what those commands are doing, easier to maintain security and useability. Let the user decide if they need cat command.

Signed-off-by: Eden Reich <[email protected]>
@edenreich edenreich merged commit 22c4d72 into main Aug 12, 2025
1 check passed
@edenreich edenreich deleted the claude/issue-21-20250812-2103 branch August 12, 2025 22:51
ig-semantic-release-bot bot pushed a commit that referenced this pull request Aug 12, 2025
## [0.9.0](v0.8.1...v0.9.0) (2025-08-12)

### 🚀 Features

* **security:** Add excluded paths configuration for improved security ([#24](#24)) ([22c4d72](22c4d72)), closes [#21](#21)
@ig-semantic-release-bot
Copy link

🎉 This PR is included in version 0.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Configure excluded paths within the projects directories

2 participants