logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·04.11.26
← Back to news

A way to exclude sensitive files issue still open for OpenAI Codex

Original article
github.com|132 points|90 comments|by pikseladam|Jun 28, 2026

GitHub Issue Report: Request for Sensitive File Exclusion in OpenAI Codex

User Avatar

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:

  1. Repository-specific: A local file, such as .codexignore.
  2. 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:

  • .env and .env.* (Environment variables)
  • .pem (Privacy Enhanced Mail certificates)
  • id_ (Private keys)
  • .aws/ (AWS configuration/credentials)
  • .ssh/ (SSH keys)

Primary Objectives

  • Security: Prevent leakage of sensitive credentials→Model\text{Prevent leakage of sensitive credentials} \rightarrow \text{Model}Prevent leakage of sensitive credentials→Model
  • Efficiency: Exclude large/irrelevant files→Reduced Token Usage\text{Exclude large/irrelevant files} \rightarrow \text{Reduced Token Usage}Exclude large/irrelevant files→Reduced Token Usage

Mathematically, the set of files sent to the model (FsentF_{sent}Fsent​) should be defined as: Fsent=Ftotal∖(Fglobal_ignore∪Frepo_ignore)F_{sent} = F_{total} \setminus (F_{global\_ignore} \cup F_{repo\_ignore})Fsent​=Ftotal​∖(Fglobal_ignore​∪Frepo_ignore​)

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 .codexignore support
  • Implement global ignore configuration
  • Ensure deterministic behavior across environments
  • Integrate with codex-rs

Issue Metadata

FieldValue
AssigneesNone
Labelsenhancement, New feature or request, sandbox
TypeNot specified
MilestoneNone
RelationshipsNone

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.