phiward v0.2.0b2 (beta)¶
The second beta. It keeps protected data (for example patient data) and your credentials out of what an AI coding agent sends to its model provider.
In short¶
This release checks more of what reaches the provider, and refuses more by default. Prompts are
checked before Claude Code sends them. @ mentions are off (Claude Code 2.1.299 or newer), so
a mention no longer puts a file's text into the prompt without a tool call the hook sees; the
IDE's open-file and selection context is not covered. phiward launch checks the project's own
files for subject and sample IDs, and sends the tool's network through a proxy that refuses
this machine and private addresses. A masking check tests your rules with made-up values at
each start. phiward pseudonymize makes coded copies of tables, VCF, JSON and Markdown files
for the agent. run --table reads tables by column. Two new options give back what the
stricter defaults take: [no_phi] folders and [launch] write_to. Upgrading from 0.2.0b1
needs a few steps in your own terminal: install, restart the broker, re-run the wiring, and
the others in the checklist next. Every change is in the
CHANGELOG.
Upgrade checklist (from 0.2.0b1)¶
In your own terminal, in this order:
- [ ]
uv tool install --force --python-preference only-managed phiward==0.2.0b2 - [ ]
(cd ~ && phiward broker --service --write)(restarts the broker; without the login service, stopphiward brokerand start it again) - [ ] With
[network] limiton: move any host you added to Claude Code's settings by hand into[network] allowed_domains - [ ]
(cd ~ && phiward install claude --user --write)(required) - [ ] In each project you wired with
install claude --project --write: run that command again - [ ] Plugin users, in Claude Code:
/plugin marketplace add msk-access/phiward#v0.2.0b2 - [ ] Claude Code 2.1.299 or newer (2.1.295 is the minimum;
doctorwarns below 2.1.299) - [ ]
phiward doctorin each project: fix each WARNING
What changes for you¶
Do these once, in your own terminal, in this order.
- Install the new version:
uv tool install --force --python-preference only-managed phiward==0.2.0b2. - Restart the broker. A broker that runs keeps the old code until it restarts. Run
(cd ~ && phiward broker --service --write); it restarts the login service. Without the service, stopphiward brokerand start it again.phiward doctornow warns while the running broker's version differs from its own, anddoctor --headlessis not ready. - Re-run
(cd ~ && phiward install claude --user --write). It is required.- It adds the prompt check (a
UserPromptSubmithook), the setting that turns@mentions off, and~/.phiward/profilesto the hidden list. It rewrites the hooks in the new form. - Until you run it,
doctorwarns, anddoctor --headlessis not ready (no prompt check). - On macOS, until you run it, the hook refuses every shell command but a gateway call once
the broker has run: the sandbox does not hide the new
~/.phiward/profiles. - Hosts you added by hand. With
[network] limiton,installnow setssandbox.network.allowedDomainsto exactly your[network] allowed_domains. It prints each host it removes. Move each host you added to the settings by hand into[network] allowed_domainsfirst, orgit pushandpip installto it fail. - Run it again after any upgrade that moves phiward's Python. Until then every tool call is
refused, and
doctornames the cause.
- It adds the prompt check (a
- A project you wired with
phiward install claude --project --write: run that command again in the project. Its committed hooks have no prompt check, sodoctor --headlessreports the project as not ready. Projects set up withphiward initonly are not affected. - Plugin users: add the marketplace again with the new tag,
/plugin marketplace add msk-access/phiward#v0.2.0b2(plugins.md). The plugin stays at the tag you added, with that release's hooks. - Run
phiward doctorand fix each WARNING. Each one names its step.doctordoes not check the plugin's version: plugin users check step 5 by hand, in/pluginin Claude Code. The plugin's version must matchphiward --version.
Claude Code: 2.1.295 or newer, as before. 2.1.299 or newer turns @ mentions off;
doctor warns below it.
Refusals you may meet now. Each refusal names its fix.
- A
[remote] rootsentry that is not absolute (~/data,data) makes the config unusable. Then every guarded action refuses: the hook, the gateway andlaunch. Write the remote's absolute path. - A push with no
[remote] roots.phiward copyto a remote now writes only under[remote] roots; with none, every push is refused. Run(cd ~ && phiward setup), which makes each copy remote's folder a remote root, or add each remote's folder to[remote] roots.doctorwarns about a copy remote without one. - An empty or relative
PATHentry (a leading or trailing:,::,.,bin) stopslaunch, and every MCP server wrapped byphiward mcp wrap: such a server then "failed to connect".phiward doctornames the entry. Remove it fromPATH(often a trailing:in your shell startup file). - A
[broker] commandsprogram the broker does not find.doctornow warns about each one (setup's@genomicslists several, such assamtools). Start the broker from a terminal where the program works, list it by its full path, or remove the ones you do not use. launch --tool claudeand the program it runs. On macOS and Linux it refuses a Claude Code older than 2.1.295, a tool that gives no Claude Code version, a shim or wrapper (npx,env, a script), and an npm build without itspackage.json. Run Claude Code's own binary, or use--tool generic.launch --tool claudeand your own--settings(Linux below 7.1). launch passes its own--settings, and Claude Code keeps only one. Yours is dropped when its content is the same as the fileinstallwrites, from this release or the earlier one. Any other--settingsstops the start. If it is phiward's file, run(cd ~ && phiward install claude --user --write).hook claudeanswersPreToolUseonly. Ahook claudeentry you wired by hand under another event (PostToolUse, ...) now exits 2 there, with a refusal that namesphiward doctor. What Claude Code does with exit 2 depends on the event. Remove the entry; phiward's hooks go underPreToolUseand, for the prompt check,UserPromptSubmit.- The masking check.
launchrefuses to start, and the broker refuses every request, when a root, a protected pattern, a[remote] rootsentry or a[sanitize] examplesvalue does not come out fully masked. Runphiward doctor: it names the entry, the rule or the root by number. - The project scan.
launchrefuses a project whose files or file names hold subject or sample IDs. Runphiward doctor --show-pathsto see the files. Move the data under a protected root, or list made-up files in[sanitize] scan_allow. launchnetwork. The tool reaches the network only through phiward's proxy, which refuses this machine and private addresses. List the private ranges you need in[launch] private_networks. On Linux,launchneeds network namespaces.- Linux:
launchrefuses/tmpitself as the project or the spool. A folder below/tmpworks. - Files that run later are read-only under
launch. In Mode A the hook now asks before a file tool writes.cursor,.gemini,.codex,.Rprofileor.Renviron, and refuses where it cannot ask. - Copies: a local path with
.., a quoted~or an empty one is refused. Give the full path. - Doctor warns until your user config masks subject IDs (a pack, patterns or
names_from) or records[sanitize] subjects = "none".phiward setupasks.
Changed defaults and new options (user config only):
[launch] keep_transcriptsis on by default.launch --tool claudenow keeps each project's transcripts in~/.phiward/carryover/claude/transcripts/, so--resumeand-cwork. To keep nothing, set it tofalse.[no_phi] folders: exact folders you are sure hold no PHI. There, in Mode A, a shell that only a sandbox opener such asallowLocalBinding(macOS) leaves unconfined gets the text check, not the refusal. Nothing to do unless you need it.[launch] write_to: more folders alaunchsession may write, besides the project. launch checks each one at its start. Nothing to do unless you need it.- Also new:
[launch] private_networks,[sanitize] examples,scan_allowandid_columns. - Fixed: on Linux with bubblewrap before 0.5 (RHEL 8), Mode A's shell now starts where the
Kerberos KCM socket exists (before, every Bash call failed with "bwrap: Can't create file at
/run/.heim_org.h5l.kcm-socket"). There the Docker and KCM sockets rest on Claude Code's seccomp
filter alone;
doctorsays so. Run(cd ~ && phiward install claude --user --write)again on the node.
Tested, on made-up data¶
- On Linux, the maintainer's sandbox check with the real Claude Code has passed in Docker since 2026-11-22.
- On a RHEL 8 compute node (kernel 4.18, bubblewrap 0.4.0), every Mode A line of that check passed with the real Claude Code (2026-11-25). The gateway refused there (no Landlock), as documented.
- On macOS, every line of that check passed except Mode B's wrapped MCP server, which cannot start in the check's own home folder; with the account's own home folder, in a macOS virtual machine, it started and could not read the protected file (2026-11-25).
- The quick start's 14 runs of a new user's setup (Linux, in Docker) and its macOS run passed.
- CI runs the full test suite on macOS and Linux for every pull request.
What has passed on each platform, with its source, is in status.md.
Limits¶
All limits are in threat-model.md, with a summary for reviewers at the top. What is not tested yet is in status.md.