A way to exclude sensitive files issue still open for OpenAI Codex
GitHub Issue Report: Request for Sensitive File Exclusion in OpenAI Codex
Issue #2847 was opened by user mkusaka on August 28, 2025, regarding a critical missing functionality in the openai/codex repository. The core of the problem is the lack of a formal system to prevent the AI agent from accessing or transmitting private data.
🎯 Feature Request Overview
The author is proposing a robust mechanism to explicitly designate specific files or directory paths that the agent is forbidden from reading or sending to the underlying model.
"A mechanism to explicitly mark files/paths that the agent must not read or send to the model, at both repository and global levels."
Proposed Implementation
The user suggests a dual-layered approach to configuration:
- Repository-specific: A local file, such as
.codexignore. - Global-specific: A system-wide ignore file for user-defined defaults.
This ensures that the configuration is deterministic and shareable across a development team, moving away from a reliance on simple project conventions or manual documentation.
🛠 Technical Details & Use Cases
The primary goal is to balance utility with security. For instance, a developer might want the agent to see node_modules/ to verify implementation details, but strictly forbid the transmission of secrets.
Exclusion Examples
The following patterns should be blocked:
.envand.env.*(Environment variables).pem(Privacy Enhanced Mail certificates)id_(Private keys).aws/(AWS configuration/credentials).ssh/(SSH keys)
Primary Objectives
- Security:
- Efficiency:
Mathematically, the set of files sent to the model () should be defined as:
Logic Flow
📋 Status and Tracking
The original issue was closed in favor of a Rust-based implementation known as codex-rs. However, as of 2025-08-28, the requested functionality is still missing from the codex-rs codebase.
Feature Checklist
- Implement
.codexignoresupport - Implement global ignore configuration
- Ensure deterministic behavior across environments
- Integrate with
codex-rs
Issue Metadata
| Field | Value |
|---|---|
| Assignees | None |
| Labels | enhancement, New feature or request, sandbox |
| Type | Not specified |
| Milestone | None |
| Relationships | None |
Example Configuration Concept
If a .codexignore file were implemented, it might look like this:
# Ignore all environment files
.env*
# Ignore sensitive SSH and AWS folders
.ssh/
.aws/
# Ignore private keys
*.pem
id_rsa
The user emphasizes that this must be a formal feature rather than a suggestion in a README.md, as the agent must programmatically adhere to these boundaries.