Skip to content

Add .agnignore support for agent path access #6

@manojsinghnegiwd

Description

@manojsinghnegiwd

Summary

Add support for ignoring paths while the agent is executing so it does not read or modify ignored files. By default, the agent should respect paths listed in .gitignore. If an .agnignore file is present, it should override .gitignore for agent execution and be used as the source of ignored paths instead.

Task

Implement agent-side path ignore behavior with the following expected behavior:

  • During agent execution, prevent reading from or modifying paths matched by the active ignore file.
  • Use .gitignore as the default ignore source when no .agnignore file exists.
  • If an .agnignore file is found, use it instead of .gitignore for agent path filtering.
  • Clearly define where .agnignore is discovered from, such as the repository root/current workspace root.
  • Ensure ignored paths are enforced consistently across file reads, writes, edits, and other file-system operations performed by the agent.
  • Add tests covering:
    • .gitignore paths are ignored by default.
    • .agnignore overrides .gitignore when present.
    • Ignored paths cannot be read or modified by the agent.
    • Non-ignored paths remain accessible.

Notes

This feature is intended to let projects control which files the agent may inspect or change, while allowing a dedicated agent-specific ignore file to override normal Git ignore behavior when needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions