Documentation

Everything you need to protect your code from AI agents.

Phylax sits between your filesystem and any AI agent. This guide covers every command, concept, and configuration option.

Getting Started

Install Phylax with a single PowerShell command. No accounts, no cloud, no telemetry.

PowerShell
irm https://raw.githubusercontent.com/TheUser99-spec/Phylax/main/install.ps1 | iex

Once installed, two commands get you protected:

Terminal
phylax init       # Creates phylax.toml, starts daemon, registers your project
phylax run        # Opens the live terminal dashboard (60fps)

That's it. Phylax is now running. Any AI agent that tries to touch a denied file gets ACCESS_DENIED from the Windows kernel.

Daemon Lifecycle

The daemon runs invisibly in the background - no console window, survives terminal close. It applies and removes Windows ACLs as protections change.

CommandWhat it does
phylax daemon startStart daemon invisibly in the background
phylax stopStop daemon - releases all Windows file locks
phylax runDaemon + TUI dashboard together
phylax uiTUI only (daemon must already be running)
phylax statusLive view: projects, agents, events, blocks
phylax updateAuto-update from GitHub
Understanding file locks

While the daemon runs, files matching [deny] rules are locked by Windows ACLs. You cannot edit them either. To modify .env, phylax.toml, or any denied file:

phylax stop
# edit your files safely...
phylax daemon start

You can also press Q in the TUI dashboard to stop the daemon, or use phylax project off to temporarily disable protection without stopping the daemon.

All Commands

Every command available. Use phylax --help for the full CLI reference.

Project

CommandDescription
phylax initCreate phylax.toml, start daemon, register project
phylax project validateValidate phylax.toml syntax and rules
phylax project check -f <file> -o <op>Dry-run: what would happen if an agent tried <op> on <file>
phylax project verifyAudit: counts effective deny coverage vs expected
phylax project onTurn protection ON for current project
phylax project offTurn protection OFF (files become accessible)

Global Rules

CommandDescription
phylax global add deny "*.env"Add a global deny rule (applies to all projects)
phylax global add ask "Cargo.lock"Add a global ask rule
phylax global listList all active global rules
phylax global remove <id>Remove a global rule by ID

Audit & Monitoring

CommandDescription
phylax statusLive overview: running projects, active agents, blocked events, rules loaded
phylax audit listView recent audit history (blocked/allowed events)
phylax audit tailFollow audit events in real time (like tail -f)

Permission Model

Phylax uses a priority-ordered bucket system. Deny always wins - even if a file matches multiple buckets, the highest priority takes effect.

High
denyNo access
askUser approves
fullAll allowed
deleteRead + Delete
writeRead + Write
readRead only
Low
BucketReadWriteDeleteWhen to use
[deny]NoNoNoSecrets, keys, policy files
[ask]PromptPromptPromptSensitive but legitimate operations
[full]YesYesYesTrusted project directories
[delete]YesNoYesFiles safe to read and delete, not modify
[write]YesYesNoSource code and docs
[read]YesNoNoReference files, README
Conservative default

When no rule matches a file: read is allowed, write asks the user, and delete is denied.

phylax.toml

The configuration file lives at the root of your project. It defines what each bucket protects using glob patterns.

phylax.toml
[project]
name = "my-project"
default = "conservative"

[deny]
files = [".env", ".env.*", "secrets/**", "*.pem", "*.key", "phylax.toml"]

[ask]
files = ["Cargo.lock", "package-lock.json", "migrations/**"]

[write]
files = ["src/**", "tests/**", "docs/**"]

[read]
files = ["README.md", "docs/**"]
Mandatory deny patterns

The daemon always denies these paths, even if they're missing from your config:

phylax.toml · .env · .env.* · .git/** · **/*.key · **/*.pem · **/*.p12 · **/*.pfx

Anti-Bypass Protection

Phylax applies three independent layers of Windows security to each denied file. Even if one layer is bypassed, the others still hold.

LayerMechanismBlocksBypass attempt
1 DENY ACE → Everyone → GENERIC_ALL Read, write, delete None - kernel enforces
2 DENY ACE → Everyone → WRITE_DAC | WRITE_OWNER | DELETE ACL modification, ownership change, file deletion Agent tries to remove ACLs
3 MIC label → High Integrity + NO_WRITE_UP Writes from Medium-integrity processes icacls /remove:d (blocked)

Layer 3 is critical: even if an agent runs icacls /remove:d to strip the DENY ACE, it fails because the agent runs at Medium integrity and the file is labeled High integrity with NO_WRITE_UP. The kernel rejects the write regardless of ownership.

Phase 1 vs Phase 2

Phase 1 (Current)

Protection is active while the daemon runs. phylax stop removes DENY ACEs and files become accessible. ACEs apply to Everyone (including you). There is a ~750ms polling window between agent detection and ACE application. Audit logs in SQLite are user-writable.

Phase 2 (In Development - driver/)

A C++ kernel minifilter driver pauses I/O IRPs inline at the kernel level. Protection survives daemon restart. Per-agent overrides and ask flow enforce in real time. Audit logs are tamper-proof at kernel level. phylax stop no longer removes protection - the driver persists independently.

Phase 1Phase 2
EnforcementWindows ACLsKernel I/O interception
Protection on daemon stopRemovedPersists (driver stays loaded)
Per-operation controlACL-basedIRP-level pause & inspect
Ask flowNot enforceableIRP paused, waits for user
Per-agent rulesStored, not evaluatedPID passed to daemon
Audit integrityUser-writable SQLiteKernel-level, tamper-proof
Bypass via killing daemonPossibleBlocked

The kernel driver lives in driver/phylax.sys. It communicates with the Rust daemon via IOCTLs on a device interface. It is optional - Phase 1 works entirely in user mode.