Project setup
Set up a project
phax init writes phax.json at the root of your repository, with the JSON Schemas your editor uses to check it (phax.schema.json, phax.user.schema.json). In a terminal it asks a few questions, pre-filled from your package.json: the project's name, its gate commands, whether to review and publish runs automatically, and whether to keep records. Elsewhere it takes the detected defaults.
A phax.json looks like this:
nameis the namespace of your runs: a run is<name>.<run name>.commands.setupruns in each phase's fresh worktree before the agent starts;commands.cleanupruns in it once the phase has committed, to free space (node_modules, build output).gateProfilesholds your checks. Each step has acommand, afiring(every-phase, orterminalfor the last phase only) and asurfacethat says what it verifies (local,structuralorproduct). phax records each step's surface and result, and the run's summary lists the surfaces it verified. A step can also return structured findings instead of a log — see Extend phax. An optionalinputkey,"gate-request"(the only value), has phax write the phase's facts on the step's stdin — see Gate request.review.complianceandpublishrun a compliance review and open a pull request when a run reaches review — see Review and land.review.codesets the model forphax review-code, andreview.code.enabledturns the headless code review on at run end.authoring.specandauthoring.planset the model for headless authoring.security.profilesets the default security mode (secureunless you say otherwise) — see Providers and security.agent.maxFixAttemptsis how many times a failing gate goes back to the agent (1 by default).fileReconciliation.modeisreport_only(default) orwarn, to also log each deviation from the planned files.recordsis written byphax initorphax records init— see Records.protectedPathslists the files whose change is the operator's decision: no phase may create, change, delete or rename them. Thephax.jsonphax loads is protected too. It is accepted inphax.jsononly, andphax validatelists the protected paths.
Layers. phax.json is the team's baseline. Two more files can add to it: config.json in the phax home (~/.phax/config.json unless PHAX_HOME is set) for your machine, and phax.local.json (gitignored) for you in this repository. A scalar takes the most personal value. An allowlist (security.filesystem.allowRead|allowWrite, security.agentCommands, security.mcp.allow) is the union of all layers, so a personal layer can add to the project's security baseline but never remove from it. Gate profiles merge by name.
Check and upgrade.