inin-zou/codex-privacy-hud
حول
OpenAI Privacy hackathon - Paris, 🏆 winning project
الأمان والخصوصيةالنمو المقاس للنجوم
- خلال 24 ساعة
- ٠
- خلال 7 أيام
- ٠
- خلال 15 يومًا
- ٠
- خلال شهر
- ٠
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصلCodex Privacy HUD

Historical screenshot from the snapshot-v1 HUD. Its percentage uses legacy accounting; the image predates the explicit legacy label.
English | 简体中文
Trace your privacy disclosure the same way you already trace your token usage — live, in every conversation.
See what your agent knows. Control where it goes.
A local-first Codex plugin that records hook observations in a session ledger and can return denials or rewritten input before tool execution.
New sessions observed from a genuine SessionStart use evidence-based accounting: confirmed points, distinct disclosures, confirmed recipients, and denials issued. A percentage is shown only when the recorded evidence supports it. Current hooks do not confirm model-context admission, transmission, or host application of a denial or rewrite, so a session may show zero confirmed points alongside unresolved actions and an unavailable percentage. Zero confirmed points does not mean no disclosure occurred.
Existing sessions and sessions attached after their start retain their legacy permitted-crossing score and its limitations. Historical rows are preserved without backfill or rescoring. An unrecorded session has no percentage or numeric counts.
Recipient identity is separate from boundary category. Supported, unambiguous MCP names and simple network commands can identify intended recipients; ambiguous identities remain unresolved. This does not establish delivery, downstream forwarding, or what a subagent inherited.
Detection runs locally; the plugin sends no prompt, file, or secret to a remote scanner. Runtime communication is limited to Unix-domain sockets and the local browser UI on 127.0.0.1.
Version 0.10.0 activates evidence-based accounting for new sessions observed from a genuine SessionStart, using the selected runtime and fenced ledger introduced in 0.8.0. Existing and late-attached sessions retain legacy accounting; historical records are not backfilled or rescored.
Version 0.9.2 adds a default-on lexical network guard. Recognized network commands containing known-sensitive-path references receive a denial independently of the local read guard. No file contents are opened or rewritten. Shell-derived file identities and host enforcement remain unresolved; see known limit 6.
Token HUD: How much context has been consumed?
Privacy HUD: What is confirmed, and what remains unresolved?

Design-intent illustration. It predates the explicit legacy labels; its bar and intervention imagery are not the current display or evidence contract.
Before you rely on it: the start of a session is not monitored while the model loads, hosted tools bypass hooks, and detection is heuristic. The HUD marks a session whose record has a known hole rather than showing it as a clean 0%, but it cannot tell you what it missed. Read the known limits.
- News
- Install
- What you see
- How it works
- Known limits
- Configuration
- Troubleshooting
- Uninstall
- Installing by hand
- Documentation
- License
News
- 2026-09-15: patched Codex 0.154.0 builds for
aarch64-apple-darwinandx86_64-apple-darwinare published on the GitHub releasecodex-0.154.0-hudand on the rollinglatest.install.shfinds them. - 2026-09-15: the
privacystatus-line item now renders inside a patched Codex, and the macOS install is one command. - 2026-09-21: the self-audit claim was withdrawn and replaced. Three read-only source-review sessions measured 88%, 100% and 100% of budget, against an invariant that said zero. What replaces it is a committed corpus with both controls — see
docs/self-audit.md, which also records the four entries it does not satisfy — two clean strings the model reports personal data in, and two addresses it misses or fragments. - 2026-09-05: verified by hand against Codex CLI 0.153.0 that one session reading
src/privacy_hud/budget.pyrecorded zero events, budget 0.0/120.0. That run was real; the general claim drawn from it was not.
Install
After a plugin update, runtime repair is explicit. Codex may delete the old bundle while its daemon or MCP servers remain running. If the new hooks do not match the recorded runtime selection, ingress continues unverified and recognized B3/B4 outbound calls receive a denial. Supported B2 delegation calls remain exempt from that denial, including when their text contains a URL; they receive an unverified warning with the repair command. The hook warning or denial includes the exact repair command to run in another terminal. $privacy repair also prints that command; it does not perform the repair. The command may download dependencies and model weights. After successful repair, restart the Codex app, CLI, or IDE integration that loaded the plugin. Repair preserves ledger records but cannot reconstruct monitoring gaps or lost in-memory state. See the upgrade limits.
Explicit repair and the shared stop-only operation can recognize MCP and daemon ledger holders naming any canonical N.N.N sibling path under the same existing canonical plugin parent, whether the version directory is present or absent. Each N is an ASCII nonnegative integer without leading zeros except zero itself. Absent version directories need never have existed or been installed; no record of prior selection is required. Existing version directories must contain a canonical scripts/runtime.py file; incomplete existing bundles and aliases remain refused. Recognition still requires the same UID, exact supported launch form, recorded interpreter and resolved plugin-data directory. Process identity and ledger ownership are rechecked before signalling. This follows the same-user trust model and does not authenticate the Python code a process loaded. Unverified holders cause refusal; there is no SIGKILL escalation.
Privacy HUD 0.10.0 retains snapshot version 2. New sessions observed from a genuine SessionStart use version-2 accounting; existing sessions and late attachments retain legacy accounting. Snapshot-v2 readers accept version 1 as explicitly legacy and version 2 with nullable accounting fields. Older snapshot-v1-only readers reject version 2 and show no Privacy item. Matching Codex version numbers do not establish snapshot compatibility.
The snapshot-v2 patched Codex builds for 0.154.0, 0.155.0, and 0.155.1 were re-released on 2026-09-22. An earlier installation of one of those versions may still contain the older reader. Updating the plugin does not replace that binary. No additional patched-Codex release is required solely for Privacy HUD 0.10.0.
The native Privacy item displays accounting snapshots; it does not verify runtime alignment. Before repair, an old daemon may continue refreshing a legacy reading. Use the bundled doctor command to check alignment. The bundled ambient launcher reports runtime failure instead of displaying a percentage.
Privacy HUD loads Python code from the selected plugin bundle. The recorded Python environment supplies dependencies. Run $privacy repair to obtain the exact recovery command for another terminal. Explicit installation may download dependencies and model weights; runtime checks and offline repair do not.
The active ledger is $PLUGIN_DATA/ledger/active.db after repair. $PLUGIN_DATA/ledger.db is a directory that fences the historical pathname. Do not replace it with a file or symlink. Repair preserves the accounting generation and recorded values; it does not activate version-2 accounting. The selected daemon activates accounting only when it receives a genuine SessionStart for an absent session.
Generation 5402 requires the activated-accounting implementation introduced in Privacy HUD 0.9.0. A live client must also match the selected runtime build and activation epoch. Unsupported or altered schemas are preserved and refused. No downgrade migration is provided.
Runtime mismatches produce an unverified warning on ingress and a denial for outbound calls the hook cannot verify. These are plugin decisions, not confirmation of host enforcement. Monitoring gaps and lost in-memory detection state cannot be reconstructed. Open version-2 sessions whose accounting keys were lost remain unavailable for the rest of those sessions.
PRIVACY_HUD_BUNDLE='/absolute/path/to/installed/plugin'
PRIVACY_HUD_DATA='/absolute/path/to/plugin/data'
python3 "$PRIVACY_HUD_BUNDLE/scripts/runtime.py" \
--plugin-data "$PRIVACY_HUD_DATA" doctor
python3 "$PRIVACY_HUD_BUNDLE/scripts/runtime.py" \
--plugin-data "$PRIVACY_HUD_DATA" repair --print-command
python3 "$PRIVACY_HUD_BUNDLE/scripts/runtime.py" \
--plugin-data "$PRIVACY_HUD_DATA" ambient --watch
Privacy HUD 0.7.1 does not alter the schema of a valid prepared generation-5401 ledger during initialization: events already contains source_kind. It can nevertheless open the historical ledger pathname without participating in the selected runtime's handshake or writer lease. On a prepared ledger, historical session and coverage writes can succeed even though legacy event recording fails against the new events layout. On a generation-0 ledger, historical event writes remain possible, and initialization adds source_kind only when that column is absent. Explicit repair therefore quiesces legacy users, preserves the ledger at $PLUGIN_DATA/ledger/active.db, and replaces $PLUGIN_DATA/ledger.db with a directory fence that prevents subsequent historical-path opens. The fence does not revoke already-open connections or protect against same-user code deliberately opening the active pathname.
Verified end-to-end against a real Codex CLI install on 0.145.0 and 0.153.0.
Before you start
- macOS on Apple Silicon or Intel. (Linux and Windows are not packaged; see Installing by hand for the fallback pane.)
- Codex CLI already installed and signed in —
codex --versionprints something likecodex-cli 0.154.0. The installer needs that number to pick the matching patched build. - Python 3.11 or newer on your
PATH(python3 --version). On a Mac without one:brew install [email protected]. - About 3 GB of disk if you want name and address detection (that is the size of the
openai/privacy-filterweights), and a few minutes.
Run it
curl -fsSL https://raw.githubusercontent.com/inin-zou/codex-privacy-hud/main/install.sh | sh
When run through a pipe or without an adjacent plugin bundle, the installer downloads the complete bundle for the release pinned inside the script and verifies its SHA-256 against that release’s checksum file. Download, checksum, archive, or bundle-version failures stop before the installer creates its manifest, dependency environment, wrappers, or Codex configuration. The temporary bundle is removed when the installer exits. SHA-256 detects a corrupted download; the script and checksum still trust this repository’s publisher.
Version bumps merged to main automatically start tagging and publishing the matching plugin release. Until that release is published and its downloads are available, the one-command installer can fail before persistent installation writes. Retry after publication completes; a failed release workflow can extend this window.
Upgrading an existing installation: rerun the one-command installer above. Starting with Privacy HUD 0.10.8, normal installation adds the marketplace if needed, refreshes only the configured codex-privacy-hud Git marketplace, and then installs the plugin. It uses the official Codex binary found during prerequisite checks, bypassing Privacy HUD forwarders for these commands. If marketplace setup or refresh fails, installation stops before plugin installation and prints the Codex error; earlier dependency-installation steps may already have changed the installation.
If the installed bundle still does not match the installer's pinned release, run codex plugin marketplace upgrade codex-privacy-hud, then rerun the one-command installer. If codex selects an old Privacy HUD forwarder, use your official Codex binary's absolute path for the refresh command. If the mismatch persists, report the error without deleting plugin data. A marketplace configured from a local path must use the local-checkout instructions, not this Git-marketplace upgrade path. --repair-runtime repairs the explicitly selected bundle; it does not refresh the marketplace or install a newer plugin.
If a terminal is available, the script asks whether to download the detection model. Without a terminal, it skips the model unless --yes is supplied. Later installation failures can leave a partial installation recorded by the uninstall manifest.
This is what it does, in the order it prints:
| step | what happens | where it lands |
|---|---|---|
| 1 | Establishes a complete installer bundle, downloading and checking the pinned release when needed; checks Codex and Python prerequisites | temporary directory when downloaded |
| 2 | Creates a private virtualenv and installs dependencies declared by the bundle, including torch, transformers, and MCP dependencies; application code runs from the selected plugin bundle |
~/.local/share/codex-privacy-hud/venv/ |
| 3 | Asks before downloading the openai/privacy-filter weights (~2.8 GB, from Hugging Face, once). Answer y for full detection. Answer n and you still get credential and path detection, but names and addresses go undetected — privacy-hud-doctor will say so. |
~/.cache/huggingface/hub/ |
| 4 | Adds the marketplace if needed, refreshes only codex-privacy-hud (codex plugin marketplace upgrade codex-privacy-hud), then installs the plugin using the official Codex binary |
Codex's marketplace and plugin directories |
| 5 | Validates the installed release, generates wrappers for that installed bundle, and records its runtime selection and Python interpreter | ~/.codex/plugins/data/codex-privacy-hud-…/runtime.json |
| 6 | Downloads the patched Codex build for your exact version, verifies its SHA-256, unpacks it, and links your official codex-code-mode-host beside it (the tarball carries only codex; Code Mode needs that sibling, and the official one of the same version is the right one) |
~/.local/share/codex-privacy-hud/<version>/ |
| 7 | Writes a small forwarder named codex and, if needed, adds ~/.local/bin to your shell PATH |
~/.local/bin/codex |
| 8 | Adds privacy to [tui].status_line in your Codex config, creating the key with Codex's defaults if you never set one |
~/.codex/config.toml |
| 9 | Runs privacy-hud-doctor and prints its table — every line should read OK or WARN, never FAIL |
— |
The binary CI publishes is unsigned and unnotarized; the installer removes the quarantine attribute itself, and the SHA-256 it verifies protects against a corrupted download, not against a compromised release.
--yes enables the model download without prompting. --no-model skips it. Pass installer arguments through sh -s --, for example:
curl -fsSL https://raw.githubusercontent.com/inin-zou/codex-privacy-hud/main/install.sh | sh -s -- --no-model
Installation downloads packages and the patched Codex build; model weights are downloaded only through the explicit model-download step. Runtime, setup probes and doctor checks enforce offline mode regardless of inherited environment values and never download missing weights. Missing or incomplete model weights leave tier 3 unavailable; the plugin does not fetch replacements. A process that already imported the ML stack in online mode also leaves tier 3 unavailable and must be restarted to load it offline.
Privacy HUD 0.10.7 updates the Codex forwarder to identify itself independently of HOME and skip other Privacy HUD forwarders. Updating the plugin or running --repair-runtime does not replace an existing forwarder. Re-run the normal installer from version 0.10.7 or newer with HOME set to the home that owns the installation. Normal installation refreshes an existing marked forwarder even when no matching patched build is available. If doctor reports forwarders from several homes, update each installation separately. Run the installer through sh; do not use an old forwarder to perform the update.
# Point this at the downloaded or checked-out 0.10.7-or-newer bundle.
PRIVACY_HUD_BUNDLE='/absolute/path/to/codex-privacy-hud'
sh "$PRIVACY_HUD_BUNDLE/install.sh" --yes --no-model
Plugin only, from the Codex CLI
The plugin itself installs like any other Codex plugin, with nothing to clone:
codex plugin marketplace add inin-zou/codex-privacy-hud
codex plugin marketplace upgrade codex-privacy-hud
codex plugin add codex-privacy-hud@codex-privacy-hud
The first command configures this repository as a Git marketplace; if it is already configured, that alone does not refresh its snapshot. The second refreshes this marketplace's configured Git revision. The third copies the plugin into the cache,
~/.codex/plugins/cache/codex-privacy-hud/codex-privacy-hud/<version>/.
That gives Codex the $privacy skill, the hooks, and the MCP server, and
it puts install.sh on your machine, but it does not run it: the daemon's
Python environment, the detection model, and the patched Codex build are
still missing, so every hook answers
Privacy HUD unavailable — disclosure unverified and $privacy reports no
daemon.
From here:
- Run
codex. Codex 0.154 opens with Hooks need review for the plugin's eight hooks; choose Trust all and continue. Nothing from the plugin runs before that. - Send any message. The first turn shows a one-line reminder. Type
$privacy setup: Codex runs the installer from the plugin cache (sh ~/.codex/plugins/cache/codex-privacy-hud/codex-privacy-hud/<version>/install.sh --yes) and asks once for permission to run it outside the sandbox, since it writes to your home directory and downloads. Approve, and wait; the model download takes a few minutes. The reminder prints the same path, so you can also run it in another terminal. The cached script is pinned to that plugin release. To upgrade an existing installation, use the current one-liner above;--yesdownloads the model without asking,--no-modelskips it. - Restart Codex so the patched build and the status item are picked up.
docs/installing-by-hand.md has every step the script performs, if you would rather do them yourself.
First launch
Open a new terminal (so the PATH change is picked up) and run codex.
The status line looks unchanged at first: Codex fires its SessionStart
hook with the first turn, not at boot, so nothing reaches the daemon until
you send a message. After your first prompt the item appears under the
composer next to the usual ones, as in the screenshot below:
Privacy legacy 0% · gpt-5.4 · ~/proj · Context 96% left
A recorded legacy session starts at legacy 0%; its number follows the
existing score arithmetic. Zero does not establish that nothing was disclosed. (On a machine where the
daemon is not yet running, that first prompt also starts it, which takes
about seven seconds to load the model — the reply to that first hook says
Privacy HUD unavailable — disclosure unverified, the item shows up a
moment later, and that load window is unmonitored: see
Known limits.) Then:
/statusline— Codex's own picker; tick or untickprivacyto add or remove the item for good. It is saved inconfig.toml.$privacy hud off/$privacy hud on— hide or show it for now, without touching your config.$privacy hud statustells you which ofabsent | stale | hidden | shownit is in.$privacy— the full session audit (Level 2).
What you see
For a new session whose outcomes remain unresolved:
Privacy —% · 3 unresolved · 2 denials issued
The native Privacy item is available only in a snapshot-v2-compatible patched Codex build. The ambient pane provides the fallback.
The audit shows confirmed points, distinct disclosures, confirmed recipients, and denials issued. It also shows unresolved actions and why a percentage is unavailable. The compact HUD omits points; open $privacy for the full accounting explanation.
Tabs are Confirmed crossings, Interventions, and All finding events. Rows describe evidence at one observation point. Repeated exposure events can share one charged disclosure. Actions without findings are included in the summary.
Detail shows the subject, intended or evidenced recipient, outcome evidence, occurrences, and contribution charged at that event. Opaque file labels distinguish subject records without storing sensitive path components. For shell reads, these records have unresolved file identities: different IDs do not prove different files, and repeated observations of one path can receive different IDs. The audit shows local file and file <opaque-id>, without the filename or a suffix. These labels cannot be used as source-rule selectors.
Version 0.10.0 adds separate guard-target metadata for newly recorded, keyed version-2 local shell read-guard denials. A random session-scoped target ID and fixed rule ID describe the path representation evaluated by Privacy HUD. "Same evaluated target as event #N" means exact equality of that evaluated representation, including existing home collapse; it does not mean the same filesystem object. The matching HMAC map exists only in daemon memory. SessionEnd discards it, and key loss disables new target correlation for that session. Stored IDs, rule metadata and prior links remain. No candidate path, command, basename or suffix is stored. Execution file subjects and accounting counts are unchanged. Guard-target writes are optional. When an ordinary write failure is contained by its savepoint, the observation and denial evidence still commit, but that row has no guard-target metadata and seeds no new link. Delivery retries do not backfill it. No failure text or extra coverage/scan-gap record is persisted. Failure of the core transaction or its commit remains outside this guarantee.
Legacy sessions retain their explicit legacy labels and tab meanings. Unrecorded sessions have no numeric accounting.
Level 1 — Ambient. One item in Codex's own status line, under the composer:
gpt-5.4 · ~/proj · Privacy legacy 28% · 2 prevented rows
Historical screenshot from the snapshot-v1 HUD. Its percentage uses legacy accounting; the image predates the explicit legacy label.

Stock Codex has no plugin-owned status item, so this needs a Codex build
with a small patch (patches/privacy-status-line.patch, one added item,
nothing else). install.sh fetches that build for your exact Codex version
and places it beside your official binary — it never modifies the official
one — and codex then resolves to the patched build only while the versions
match. Toggle the item with /statusline inside Codex, or hide it for now
with $privacy hud off. Without a matching build, the fallback is a
companion pane: ~/.local/share/codex-privacy-hud/bin/privacy-hud-ambient --watch in a second terminal.
The companion pane uses the same accounting labels:
Privacy legacy 30%
Privacy legacy 0% ⚠unverified
Privacy —% · No session on record
Privacy —% · unattributed hook gaps
These distinguish legacy accounting, incomplete legacy coverage, an explicitly unrecorded session, and daemon-reported gaps without a resolved session. The pane selects a complete width candidate, retaining legacy beside any legacy percentage and a warning for incomplete coverage. If no candidate fits, it renders nothing. Missing, malformed, stale, or hidden snapshots also render nothing.
Level 2 — Session audit ($privacy). Four tiles show legacy permitted-crossing score, legacy permitted-crossing rows, legacy boundary kinds, and legacy prevented rows, with the accounting caveat. An unrecorded session shows unavailable quantities.
Tabs: Legacy permitted crossings · Legacy prevented rows · All legacy events. Rows show stored classifications, repetition counts, and recorded source/destination associations; they do not establish delivery or host enforcement.
Level 3 — Exposure detail. One public legacy row, its masked exemplar, and its legacy intervention label. The terminal detail view does not save policy rules. The local audit browser has buttons that POST to /api/policy; the MCP privacy.update_policy tool is a separate policy-writing surface. Report a rule as saved only after that surface returns success, and include its returned conditions. Host application of a later denial or rewritten input is not confirmed.
A mask rule is scoped to the session and selects a detected data type across sources. If it selects an otherwise eligible outbound call, rewriting uses all findings from that call, including other detected types. Origin-rule denials take precedence, and mask rules do not weaken the built-in handling of hard-blocked types. Detection and host application remain conditional. Already disclosed data cannot be recalled from this session.
$privacy <session_id> selects a session audit. It is not an event or flow deep link. Select a row in the local browser to inspect that event; the terminal detail launcher requires separate session and event IDs. Denial messages contain no event deep link.
No shipped surface offers Allow once, Minimize & retry, a minimization preview or a consent-token-driven tool retry. Internal token primitives do not make those actions available.
The deep detector is local openai/privacy-filter, not Presidio. Installing its dependencies and weights is optional; without them, its detection categories are unavailable. Runtime does not download missing weights. There is no findings cache across reads or sessions: reading unchanged content can repeat scanning even when legacy accounting deduplicates the resulting row.
Compaction does not add timeline events or reverse disclosure. At session end, the plugin returns a text receipt through hook systemMessage; it does not save a Markdown receipt file or confirm that the host displayed the receipt. Transcript retention remains outside this ledger's account.
The MCP tools. Codex also gets five tools the model can call: a session summary, the exposure list, one exposure's detail, the read-guard state, and writing a policy rule. The server registers them as privacy.<name>; Codex presents them to the model with underscores, so what you will see in a transcript is privacy_get_session_summary, privacy_list_exposures, privacy_get_exposure_detail, privacy_read_guard_status and privacy_update_policy. The first four read; the fifth can only tighten, because the engine keeps its one unconditional block — a credential on an outbound call — ahead of every rule you or the model can write: a call carrying a credential is decided by the built-in default, and a mask rule on it is not consulted at all. That holds whatever the rule names, which is the point — a rule written about something innocuous, like a file path, can still land on a call that happens to carry a credential too. A mask rule naming a blocked type outright is refused when written, because it would now decide nothing while looking like protection you applied. Turning the read guard off and hiding the HUD are not among the five at all, because an MCP tool is called by the model, and a switch that loosens protection is not one to hand to the thing being enforced against; those two stay behind $privacy, which you type. Allowing a blocked call once is not among them either, but for a different reason: it has no surface at all — not $privacy, not the audit UI, not an MCP tool — see known limit 13.
Upgrading from 0.7.4 or earlier. With MCP SDK 2.2.0, the four ledger-backed MCP tools fail because their SQLite connection is used from a worker thread. Tool discovery and the read-guard status tool still work, so the old doctor check can pass despite this failure. Version 0.7.5 enables cross-thread connection use, serializes access, and adds a ledger-backed MCP read to the doctor check. Reinstall the plugin at version 0.7.5 or later and start a new Codex session.
How it works
The problem
Coding agents read your filesystem, run shell commands, call MCP servers, and spawn subagents on your behalf, and you cannot find out:
- Which of your files' contents actually entered the model context?
- Did that GitHub MCP call carry a customer email in its arguments?
- Did the subagent inherit the
.envyou read twenty minutes ago? - Did that
curlpipe your support log to an external host?
Secret scanners are pre-commit, not pre-inference. DLP products are server-side and require shipping the very data you want to protect. Permission prompts are about capability, not content.
Detection is not disclosure
The distinction the product is built on:
| Observation | V2 accounting |
|---|---|
| Local scanner finding | Detection; zero points |
| Permission to attempt a crossing | Permission; zero points |
| Privacy HUD issues a denial | Denial issued; zero points |
| Privacy HUD returns rewritten input | Rewrite issued; zero points; application unresolved |
| Evidence identifies a subject crossing to a concrete recipient | First distinct disclosure is charged |
| Evidence identifies a subject excluded by an applied rewrite | Prevention for that subject; zero points |
| Observed persistence | Retention; zero points |
| Supported explicit delegation pre-hook | B2 observation; finding recipients unresolved; no confirmed disclosure charge |
The audit contains finding events with explicit outcome evidence. Observations also record actions with no findings. Disclosure identities and charges are separate from event rows. Source-to-recipient associations do not reconstruct causal multi-hop flows.
Credential prompts
Privacy HUD 0.9.1 can request a hold before a user prompt enters model context when its text matches a supported credential format. To allow a held credential, wait at least 2 seconds, paste or type the message again, and submit it within 5 minutes. Editing the surrounding text is allowed. Every credential must be eligible for confirmation; a new credential holds the whole submission again.
Confirmation is case-sensitive and lasts for this session while the daemon runs. Restarting the daemon loses it. Entropy findings, tier-3 NER findings, and private-key headers do not trigger prompt holds. Images and attachments are not scanned. If the daemon does not answer, including during cold startup, prompts fail open with an unverified warning.
The inspected Codex 0.154.0 and 0.155.1 source clears the composer on submission and does not restore it after a hook hold; this has not been verified in a live TUI. A hold does not prevent Codex from retaining local input history. When recording succeeds, the ledger records a denial issued, not confirmed host enforcement. A recording failure after the hold decision still returns a block, with a warning that the hold may be missing from the audit. The in-memory confirmation window remains usable for a fresh eligible submission while the session and daemon remain active; replaying the same delivery stays held. Confirmation becomes reusable only after its own observation records successfully. If no usable reply reaches the client, ingress still fails open. See limit 22.
The read guard
The read guard can issue a denial on PreToolUse for a recognized shell read of a known-sensitive path, such as .env or deploy/key.pem. It checks the command text before execution; current hooks do not confirm that the host enforced the denial.
The shell is the whole of it, because that is how Codex reads a file: it has no native file-read tool, so the model runs cat. Any other tool is allowed unexamined — limit 14.
It is off by default. As installed, a recognised read of such a path is recorded and the guard mentions itself once per session; nothing is blocked. The commands:
$privacy read on # deny recognised reads of known-sensitive paths
$privacy read off # go back to recording them
$privacy read status # prints `on` or `off`
The setting is written to ~/.codex/plugins/data/codex-privacy-hud-…/settings.json, not config.toml. A change applies to a running session with no restart. That file is not one you see from inside Codex, so $privacy read status and privacy-hud-doctor are how you find out what it says.
The guard remains limited to recognized shell reads and is off by default. Template-file exemptions remain. All shell-derived accounting file identities remain unresolved, including ordinary cat .env reads. Separate observations retain separate unresolved file subjects; they do not establish which files were read. The extracted path remains available to the guard and its immediate denial message, but the audit does not name that file. A denial request is not proof that the host stopped the read.
Version 0.10.0 adds separate guard-target metadata for newly recorded, keyed version-2 local shell read-guard denials. A random session-scoped target ID and fixed rule ID describe the path representation evaluated by Privacy HUD. "Same evaluated target as event #N" means exact equality of that evaluated representation, including existing home collapse; it does not mean the same filesystem object. The matching HMAC map exists only in daemon memory. SessionEnd discards it, and key loss disables new target correlation for that session. Stored IDs, rule metadata and prior links remain. No candidate path, command, basename or suffix is stored. Execution file subjects and accounting counts are unchanged. Guard-target writes are optional. When an ordinary write failure is contained by its savepoint, the observation and denial evidence still commit, but that row has no guard-target metadata and seeds no new link. Delivery retries do not backfill it. No failure text or extra coverage/scan-gap record is persisted. Failure of the core transaction or its commit remains outside this guarantee.
The ledger
flowchart TD
A["Codex lifecycle hooks"] --> B["Local privacy engine"]
B --> C["Session disclosure ledger"]
C --> D["Compact HUD"]
C --> E["Interactive audit UI"]
B --> F["Allow, rewrite, or block"]
The ledger records delivered local hooks; it does not reconstruct the model's complete context. Missing hooks, hosted tools, discarded results, and unconfirmed host outcomes remain outside what those observations establish. Accounting keeps that uncertainty explicit instead of charging an assumed crossing.
There is no second LLM call to audit the first one. That would re-transmit the sensitive data being audited, cost a round trip per turn, and produce a non-deterministic ledger. See architecture.md §3.
Privacy of the privacy tool
- Detection runs entirely locally. No content is sent anywhere for classification.
- New accounting stores allowlisted metadata, opaque identities, and masked examples. Column names alone do not make arbitrary labels safe.
- At session end, new-accounting identity hashes are nulled and the matching in-memory key is discarded. Opaque IDs and accounting joins remain. This is logical erasure, not secure overwriting of SQLite pages, WAL files, backups, swap, or Python memory; other metadata can still correlate records.
- No telemetry or analytics. Plugin runtime makes no outbound network requests, regardless of inherited environment values.
- The self-audit is a committed corpus with both controls, and it is a requirement the tool does not yet meet: four of its entries fail — two ordinary development strings the model reports personal data in, and two addresses it misses or fragments. Each is recorded rather than tolerated.
docs/self-audit.mdhas them, and says what a passing run does not prove. The older, wider promise — that a development session yields zero exposures — was withdrawn when measurement contradicted it.
What the forwarder is, and what it is not
Your official codex binary is never modified, moved, or replaced.
~/.local/bin/codex is a shell script. It resolves its own location from
$0, skips marked Privacy HUD forwarders when searching PATH for the
official binary, and guards the version probe against recursive forwarder
entry. It looks for a matching patched build relative to its resolved
installation, independently of the caller's HOME. If no usable matching
build is installed, it runs the official binary unchanged. Failure to
resolve itself, find the official binary, or query its version produces
a diagnostic and exits.
After an upgrade through brew or npm, the forwarder uses the new
official binary if no usable matching patched build is installed.
The official binary does not provide the privacy status-line item.
If the installer prints a block starting with !! PATH:, PATH selects
another codex instead of this installation's forwarder. Copy the
export PATH=... line it prints into the named shell rc file after other
PATH assignments, then open a new shell. The line uses this installation's
bin path, even if the new shell has a different HOME. This changes PATH
selection; the privacy status-line item still requires a matching
patched Codex build.
Known limits
Stated up front, because a privacy tool that overclaims is worse than none:
- The start of a session is unmonitored. Whatever is disclosed in those first seconds is not in the ledger, and no later reading can say what it was. (details)
- "Unverified" marks the gaps it can see, and there are gaps it cannot. So
⚠unverifiedmeans "the ledger holds evidence of a hole"; its absence means "nothing on record contradicts a complete account", which is a weaker claim than "complete" and must not be read as the stronger one. (details) - Hosted tools bypass hooks. WebSearch and similar do not trigger local function-tool hook paths. (details)
- No
askdecision in Codex hooks, and no interactive tool-call consent surface. Internal token primitives exist, but no browser button,$privacybranch or exposed MCP tool issues consent tokens or offers a consent-driven retry. Prompt resubmission is separate; see limit 22. (details) - The status-line item lives in a separately built Codex — never in your official one. The plugin never modifies your official Codex binary. (details)
- Network-file contents are not inspected. A default-on lexical guard denies recognized network commands containing known-sensitive-path references. It can overblock unrelated references and misses paths hidden by expansion or configuration. Ordinary non-sensitive uploads remain eligible. (details)
- Detection is heuristic. A determined adversary can encode around regex and NER. (details)
- Which session is being shown is inferred, not read — and the skill's terminal audit says so when it cannot be sure. The browser labels the selected session as
Session <full ID>. The fallback pane carries no such marker; pin it with--session-idwhen it matters. (details) - Nothing recalls disclosed data. Ever. (details)
- A source rule matches the whole value, normalised. A model that summarizes or rewrites what it read defeats it. The value must be detected on ingress and again on egress. When either detection depends on the deep scan, a scan gap can prevent this rule from matching (known limit 21). Detection is heuristic and can miss values, and hosted tools never reach this plugin at all. Matching keys on an HMAC of
value.strip().lower(), so it is not a byte comparison either. (details) - Origin extraction is best-effort.
cat .envis recognised;python -c "open('.env')"is not. A row with no origin offers no rule, rather than one that would not work. (details) - The taint map dies with the daemon. A daemon replaced mid-session loses it, and source rules stop matching with no error. (details)
- No policy rule can be removed within the session that wrote it. True of the mask action since long before source rules existed. A new Codex conversation is the only clean slate. (details)
- The optional local read guard recognizes only some shell reads. Its origin-extraction limits remain; the independent default-on network guard is described in limit 6. (details)
- Template suffixes exempt path-based denial. Other findings, including literal credentials in command arguments, can still cause denial. Referenced file contents are not inspected. (details)
- The optional read guard is off by default. This setting controls recognized shell reads. Credential prompt holds, the default-on network guard, and existing credential-based egress policy operate independently of it. Returned holds and denials do not confirm host enforcement. (details)
- Legacy rows can still collapse different outcomes. New accounting appends independent outcome evidence and counts denials issued by action. Historical rows are not reconstructed, and issued denials do not establish host enforcement. (details)
- Legacy rows can still merge files matching one pattern. Newly recorded, keyed version-2 local shell read-guard denials carry separate opaque guard-target IDs, fixed rules and same-evaluated-target links. These identify the path representation evaluated by Privacy HUD, not a filesystem object or historical filename. Matching ends with SessionEnd or key loss; existing links remain. Shell execution file identities and host enforcement remain unresolved, and accounting counts are unchanged. #44 remains open for filesystem identity and independently recognizable historical filenames. Guard-target writes are optional. When an ordinary write failure is contained by its savepoint, the observation and denial evidence still commit, but that row has no guard-target metadata and seeds no new link. Delivery retries do not backfill it. No failure text or extra coverage/scan-gap record is persisted. Failure of the core transaction or its commit remains outside this guarantee. (details)
- Encrypted delegation text and inherited content are unobservable. In the inspected Codex 0.154.0 and 0.159.3 sources, V2 spawn, message, and follow-up calls can carry encrypted
messagevalues through both tool hooks. Privacy HUD cannot inspect the underlying plaintext. Recognized encrypted message fields are excluded from detection and record incomplete B2 scan coverage, with an explicit hook warning; they do not create credential findings. Plaintext messages and supported V1 text items continue to be scanned. Supported names includespawn_agent,multi_agent_v1send_input,send_message,followup_task, and the flattenedcollaborationvariants of the three V2 tools. Recognition checks the envelope and token format; it does not authenticate ciphertext or cover every future format. New accounting records B2 observations and findings with unresolved intended recipients; legacy findings are zero-cost detections. This path does not deny or rewrite delegation, even when a mask rule exists. It does not confirm delivery or charge confirmed disclosure.SubagentStartstill supplies no delegated or inherited text. Fork-mode storage, child accounting activation and identity correlation, stop-message scanning, attachments, inherited history, model admission, parent receipt of child output, internal agents, and missing-hook intervals remain outside this coverage. (details) - Concrete recipients are identified only where the hook and supported parser provide an unambiguous identity. Other recipients remain unresolved. Identity alone does not establish delivery or forwarding. (details)
- On an outbound call, the deep scan is best-effort. The model is serial, and a missed hook deadline on an outbound call becomes a deny (I6). Egress uses a requested timeout based on the remaining budget and an inclusive completion cutoff; neither guarantees elapsed time. See
engine.TIER3_EGRESS_BUDGET. Measured: a call under the 1.0 s budget returned at 1.25 s. At most one egress scan worker is admitted at a time. Admission is nonblocking; the worker retains its slot until it exits, including after caller abandonment. A scan gap means an applicable deep scan supplied no accepted result; the call then proceeds on the fast tiers, the same as every outbound call before this existed. A scan gap can omit findings that would otherwise cause blocking or masking. Each observed scan gap is recorded per observation and counted per session, including observations with no event row, so the session stops reading as fully verified — but the audit cannot tell you which calls they were. (details) - Credential prompt holds have a narrow scope. Only supported credential formats in prompt text can hold a submission. Confirm by resubmitting after 2 seconds and within 5 minutes. Images, attachments, entropy findings, private-key headers, and tier-3 NER findings do not trigger this hold. No daemon reply means ingress fails open. (details)
Configuration
| knob | what it does |
|---|---|
/statusline inside Codex |
Ticks or unticks the privacy item for good. The choice is saved in config.toml. |
$privacy hud on|off|status |
Hides or shows the item for now, without touching your config. status prints absent, stale, hidden, or shown. |
$privacy read on|off|status |
Turns the read guard on or off — see The read guard. On, Privacy HUD issues denial requests for recognised matching reads; off (the default), this guard does not request a denial. Neither setting confirms host enforcement or complete observation. status prints on or off. Saved in settings.json under ~/.codex/plugins/data/codex-privacy-hud-…/, and applies to a running session immediately. |
$privacy setup |
Runs the installer that came with the plugin, for an install made with codex plugin add alone. Asks once to run outside the sandbox. |
[tui].status_line in ~/.codex/config.toml |
The list of status-line items Codex renders. The installer adds "privacy" to it. |
install.sh --yes / --no-model / --release-base-url URL / --uninstall / --purge |
--yes answers the model question with yes, --no-model skips the download, --release-base-url changes the release-download base URL for both the plugin bundle and patched Codex assets (an alternate source supplies both the archive and its checksum and must be trusted), --uninstall removes what the installer created, --purge also removes the ledger and the weights. |
PRIVACY_HUD_NO_SPAWN=1 |
Turns daemon auto-start off entirely, for a sandbox where the spawn cannot succeed. |
~/.local/share/codex-privacy-hud/bin/privacy-hud-ambient --watch [N] / --once / --session-id <id> |
Runs the fallback pane: redraw every N seconds, print one line and exit, or pin the pane to one session. |
Troubleshooting
no patched build published for codex <ver> yet— there is no release for your Codex version. Everything else installed; the status item will appear once a build for that version is published (rerun the installer then). Until then the fallback pane works:~/.local/share/codex-privacy-hud/bin/privacy-hud-ambient --watchin a second terminal.- The status line shows no
privacyitem after upgrading Codex — the forwarder found no patched build for the new version and ran your official binary unchanged, so nothing broke and the item is simply gone for now. A workflow checks for new Codex releases every six hours and publishes a build when the patch still applies, so a version that has been out for a day usually has one; rerun the installer (or$privacy setup) to pick it up. If there is none, an issue says why:patch needs rebasing for Codex <version>when the patch no longer applies, orrelease build failed for Codex <version>when it applied but the build did not finish. !! config.toml: …— yourconfig.tomlhas a[tui]table or astatus_linekey in a shape the installer will not edit blind. It changed nothing; add"privacy"to[tui].status_lineyourself, using the line it prints.- Doctor shows
FAIL— read its fix line; it names the exact command. the bundleddoctor --load-modelgoes further and loads the detector for real. Every command runs through the selected bundle's bootstrap:python3 "$PRIVACY_HUD_BUNDLE/scripts/runtime.py" --plugin-data "$PRIVACY_HUD_DATA" doctor. - To start over: run the uninstaller, then install again.
Piped --repair-runtime and --uninstall are refused without downloading a bundle or changing the installation. Run the installer from the current installed plugin bundle. Replace both placeholder paths below with the actual absolute directories before running these commands.
PRIVACY_HUD_BUNDLE='/absolute/path/to/installed/plugin'
PRIVACY_HUD_DATA='/absolute/path/to/plugin/data'
sh "$PRIVACY_HUD_BUNDLE/install.sh" \
--repair-runtime --plugin-data "$PRIVACY_HUD_DATA" --yes
Uninstall
Run the script from the current installed plugin bundle. Replace the
placeholder below with that bundle's absolute directory, containing both
install.sh and scripts/runtime.py.
PRIVACY_HUD_BUNDLE='/absolute/path/to/installed/plugin'
sh "$PRIVACY_HUD_BUNDLE/install.sh" --uninstall
A piped uninstall is refused before any download or change to the installation. The stop operation needs the rest of the current installed plugin bundle.
Successful uninstall removes installer-managed files recorded in
~/.local/share/codex-privacy-hud/manifest.json and restores codex to
the official binary. Your disclosure ledger and model weights stay unless
you add --purge.
Uninstall requires a usable Python 3.11+ interpreter to run the bundled
stop operation. It checks the recorded interpreter, the installer-owned
environments, and a host interpreter on PATH. A host with none cannot
complete uninstall until a usable interpreter is available again. There
is no Python-free uninstall or force override.
If shutdown cannot be confirmed, uninstall exits 1, preserves the runtime environment and uninstall manifest, and skips both data and model purge. The forwarder and some installer-managed shell or Codex configuration may already have been removed. Once a usable interpreter is available, rerun the same bundle-local command; the stop checks still apply.
After successful uninstall, remove the plugin separately with
codex plugin remove codex-privacy-hud.
Installing by hand
You want this if there is no install.sh for your platform, if you are on Linux, or if you are repairing a broken install. Every step the installer performs is written out in docs/installing-by-hand.md.
Documentation
| doc | what it covers | read it when |
|---|---|---|
docs/installing-by-hand.md |
Each install step run by hand, the privacy-hud-setup and privacy-hud-doctor commands, and the fallback pane. |
You cannot use install.sh, or you want to control each step. |
docs/known-limits.md |
All twenty-two limits in full, with the measurements behind them. | You are deciding how far to trust a number the HUD shows. |
patches/README.md |
The one-item Codex status-line patch and how to regenerate it against a new tag. | You want to audit or rebuild the patched Codex binary. |
.claude/docs/architecture.md |
Component map, process model, ledger schema, hook dispatch, and the limits of the unshipped consent workflow. | You are working on the plugin itself. |
License
MIT.
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…