Skip to content

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, stop phiward broker and start it again)
  • [ ] With [network] limit on: 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; doctor warns below 2.1.299)
  • [ ] phiward doctor in each project: fix each WARNING

What changes for you

Do these once, in your own terminal, in this order.

  1. Install the new version: uv tool install --force --python-preference only-managed phiward==0.2.0b2.
  2. 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, stop phiward broker and start it again. phiward doctor now warns while the running broker's version differs from its own, and doctor --headless is not ready.
  3. Re-run (cd ~ && phiward install claude --user --write). It is required.
    • It adds the prompt check (a UserPromptSubmit hook), the setting that turns @ mentions off, and ~/.phiward/profiles to the hidden list. It rewrites the hooks in the new form.
    • Until you run it, doctor warns, and doctor --headless is 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] limit on, install now sets sandbox.network.allowedDomains to exactly your [network] allowed_domains. It prints each host it removes. Move each host you added to the settings by hand into [network] allowed_domains first, or git push and pip install to it fail.
    • Run it again after any upgrade that moves phiward's Python. Until then every tool call is refused, and doctor names the cause.
  4. A project you wired with phiward install claude --project --write: run that command again in the project. Its committed hooks have no prompt check, so doctor --headless reports the project as not ready. Projects set up with phiward init only are not affected.
  5. 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.
  6. Run phiward doctor and fix each WARNING. Each one names its step. doctor does not check the plugin's version: plugin users check step 5 by hand, in /plugin in Claude Code. The plugin's version must match phiward --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] roots entry that is not absolute (~/data, data) makes the config unusable. Then every guarded action refuses: the hook, the gateway and launch. Write the remote's absolute path.
  • A push with no [remote] roots. phiward copy to 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. doctor warns about a copy remote without one.
  • An empty or relative PATH entry (a leading or trailing :, ::, ., bin) stops launch, and every MCP server wrapped by phiward mcp wrap: such a server then "failed to connect". phiward doctor names the entry. Remove it from PATH (often a trailing : in your shell startup file).
  • A [broker] commands program the broker does not find. doctor now warns about each one (setup's @genomics lists several, such as samtools). 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 claude and 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 its package.json. Run Claude Code's own binary, or use --tool generic.
  • launch --tool claude and 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 file install writes, from this release or the earlier one. Any other --settings stops the start. If it is phiward's file, run (cd ~ && phiward install claude --user --write).
  • hook claude answers PreToolUse only. A hook claude entry you wired by hand under another event (PostToolUse, ...) now exits 2 there, with a refusal that names phiward doctor. What Claude Code does with exit 2 depends on the event. Remove the entry; phiward's hooks go under PreToolUse and, for the prompt check, UserPromptSubmit.
  • The masking check. launch refuses to start, and the broker refuses every request, when a root, a protected pattern, a [remote] roots entry or a [sanitize] examples value does not come out fully masked. Run phiward doctor: it names the entry, the rule or the root by number.
  • The project scan. launch refuses a project whose files or file names hold subject or sample IDs. Run phiward doctor --show-paths to see the files. Move the data under a protected root, or list made-up files in [sanitize] scan_allow.
  • launch network. 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, launch needs network namespaces.
  • Linux: launch refuses /tmp itself as the project or the spool. A folder below /tmp works.
  • Files that run later are read-only under launch. In Mode A the hook now asks before a file tool writes .cursor, .gemini, .codex, .Rprofile or .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 setup asks.

Changed defaults and new options (user config only):

  • [launch] keep_transcripts is on by default. launch --tool claude now keeps each project's transcripts in ~/.phiward/carryover/claude/transcripts/, so --resume and -c work. To keep nothing, set it to false.
  • [no_phi] folders: exact folders you are sure hold no PHI. There, in Mode A, a shell that only a sandbox opener such as allowLocalBinding (macOS) leaves unconfined gets the text check, not the refusal. Nothing to do unless you need it.
  • [launch] write_to: more folders a launch session 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_allow and id_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; doctor says 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.