Skip to content

[BUG] .rooignore exclusions not enforced consistently across tools (read_file bypasses exclusions) #12023

@Zocker1999NET

Description

@Zocker1999NET

Problem (one or two sentences)

The .rooignore file exclusion rules are not consistently enforced - some tools (like read_file) allow reading files that should be excluded, while other tools (like search_files) correctly respect the exclusions.

Context (who is affected and when)

AI agents using Roo Code with a .rooignore file configured to exclude certain files or directories. The exclusion appears to work for some tools but not others, creating an inconsistent security boundary.

Reproduction steps

  1. Create a .rooignore file with exclusion patterns (e.g., database-redesign/*.sql or tasks.txt)
  2. Use the read_file tool to attempt reading an excluded file
  3. Observe that the file content is returned despite being in .rooignore
  4. Use the search_files tool to search for the same pattern
  5. Observe that search_files correctly returns no results

To provide more context of my repo, this is the .rooignore:

# ==SYNC=AI-AGENT-IGNORE-FILE==
# This file is synchronized across multiple names for different AI agents.
# All variants of this file MUST remain identical.
# Edit any variant and ensure all other variants are updated to match.
# The gitlab-ci pipeline validates that all sync marker files are identical.

# files that should be ignored by AI agents

*.ini
!config.template.ini
tasks.txt
database-redesign/*.sql

Relevant Files in Project:

.gitignore
.gitlab-ci.yml
.rooignore          ← exclusion config being tested
config.ini          ← excluded by .rooignore
config.template.ini
tasks.txt           ← excluded by .rooignore
.roo/
database-redesign/  ← *.sql files excluded by .rooignore

Key Files for the Bug Report:

Expected result

Files listed in .rooignore should be blocked from being read by ALL tools, including read_file, search_files, and list_files.

Actual result

read_file: allows reading excluded files (BUG); search_files: correctly blocks excluded files (works as expected); list_files: shows all files regardless of .rooignore (may be intentional for workspace inventory)

Variations tried (optional)

  • Tested with database-redesign/*.sql pattern - blocked by search_files but not by read_file
  • Tested with tasks.txt - blocked by search_files but not by read_file
  • Tested with *.ini - correctly blocked by both tools

App Version

v3.51.1 (7c9722b)

API Provider (optional)

OpenAI Compatible

Model Used (optional)

MiniMax M2.5 229b (self hosted)

Roo Code Task Links (optional)

No response

Relevant logs or errors (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions