Skip to content
Discussion options

You must be logged in to vote

Solution

CodexMap enforces atomic file writes and secret redaction through three complementary layers in lib/atomic.js:

  1. Deterministic Secret Scrubbing (redactSecrets):
    Scans buffer streams and text payloads against strict patterns for:
  • OpenAI API keys (sk-proj-..., sk-...)
  • Anthropic API keys (sk-ant-...)
  • Google Gemini keys (AIza...)
  • GitHub Tokens (ghp_..., github_pat_...)
  • AWS credentials (AKIA...)
  • Authorization headers (Bearer ...)
  1. Canonical Filesystem Containment (safeInside):
    Validates that target file descriptors reside strictly within the authorized root path using path.relative.

  2. Crash-Safe Atomic Write:
    Writes to a staging file with a random suffix before performing an atomic…

Replies: 1 comment

Comment options

somuai
Sep 1, 2026
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by somuai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant