Skip to content

[FEATURE] Configure excluded paths within the projects directories #21

Description

@edenreich

Summary

In order to make it more secure there are some files that you might don't want that infer will execute or modify. For example I would not want infer CLI to be able to modify its own configuration. Imagine you allow update tool and infer goes to it's own config and modifies the whitelisted bash commands to something malicious.

In some scenarios for example you also won't wont infer CLI to be able to modify github actions so people would simply add .github to the excluded folders.

Acceptance Criteria

  • Infer CLI should not be able to modify its own config (default)
  • Infer CLI have additional list of excluded paths under tools
  • It's documented

Activity

  1. added
    enhancement
    on Aug 12, 2025
  2. edenreich commented on Aug 12, 2025

    @edenreich
    ContributorAuthor

    @claude can you work on this?

  3. claude commented on Aug 12, 2025

    @claude
    Contributor

    Claude finished @edenreich's task —— View job • claude/issue-21-20250812-2103 • Create PR ➔


    ✅ Completed: Excluded paths feature

    I've successfully implemented the excluded paths feature to enhance security by preventing the infer CLI from modifying sensitive files.

    Todo List

    • Understand current project structure and setup development environment
    • Analyze existing configuration and tool execution system
    • Design excluded paths configuration structure
    • Implement excluded paths in config system
    • Update tool validation logic to respect excluded paths
    • Add CLI commands for managing excluded paths
    • Add default exclusion for infer's own config files
    • Test the implementation
    • Run quality checks and linting
    • Update documentation

    ✨ What was implemented

    Core Changes:

    • Config Structure: Added exclude_paths field to ToolsConfig with default exclusions for .infer/ directory
    • File Validation: Enhanced file service to check excluded paths before file access
    • CLI Commands: Added infer config tools exclude subcommands for managing excluded paths

    New Commands:

    • infer config tools exclude list - List all excluded paths
    • infer config tools exclude add <path> - Add a path to exclusion list
    • infer config tools exclude remove <path> - Remove a path from exclusion list

    Security Features:

    • Default exclusion of .infer/ and .infer/* to protect configuration
    • Pattern matching supports exact paths, directory patterns, and wildcards
    • Integrated with existing tool validation pipeline

    Testing Results:

    • ✅ Correctly blocks access to excluded files
    • ✅ Allows access to non-excluded files
    • ✅ CLI commands working properly
    • ✅ JSON output includes excluded paths
    • ✅ Documentation updated

    All acceptance criteria from the issue have been met:

    • Infer CLI cannot modify its own config (default exclusions)
    • Additional excluded paths list under tools configuration
    • Full documentation of the feature

  4. added a commit that references this issue on Aug 12, 2025
    22c4d72
  5. inference-gateway-releaser commented on Aug 12, 2025

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementreleased

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions