When two agents reach for the same file, something has gone wrong in the coordination layer — but without Axis, neither agent knows. One finishes, the other overwrites it, and the collision only surfaces at merge time, after both have done duplicate work. Axis file locks fix the information problem: before an agent writes anything, it records its intent and the file’s current content fingerprint. When a second agent asks for the same file, it hears exactly who holds it, what they’re doing with it, when the lock expires, and what to do instead.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/virsanghavi/axis/llms.txt
Use this file to discover all available pages before exploring further.
How advisory locks work
Axis cannot physically intercept a write it doesn’t perform. Instead, it:- Records intent — who holds the lock and what they intend to do with the file.
- Fingerprints the file — captures a content hash at the moment the lock is granted.
- Checks before future writes — any agent can verify whether the file has changed since the fingerprint was taken, catching silent clobbers before they happen.
propose_file_access
The entry point for all lock acquisition. Call this before editing any file.
Path to the file to lock. Directories are rejected — only individual files can be locked.
The requesting agent’s unique identifier for this session.
A plain-language description of what you’re about to do. Used verbatim in denial messages shown to other agents. Write what you’re doing, not that you’re doing it.
GRANTED
Lock recorded. The file’s content hash is fingerprinted at this moment. Safe to proceed with edits.
REQUIRES_ORCHESTRATION
Another agent holds this file. The response includes who, what they’re doing, when the lock expires, and what to do instead.
REJECTED
Invalid path — most commonly a directory rather than a file. Lock an individual file inside the project root.
Batch locking
Pass afilePaths array to propose_file_access to lock multiple files in a single all-or-nothing call. If any file in the batch is denied, all locks acquired earlier in the same batch are automatically released — a partial lock set never silently blocks other agents.
Tamper detection: verify_file_lock
Because locks are advisory, a file can be edited by any process while a lock is held. verify_file_lock compares the file’s current content against the fingerprint captured at grant time, letting an agent confirm nobody rewrote the file out from under them before overwriting it.
guarded_write — enforced writes
guarded_write is the safe write path: the server performs the write itself, but only if the caller holds the lock and the file is unchanged since the lock was granted. If either condition fails, the write is rejected with a structured error before any bytes are written.
Must match the agent that holds the lock for
filePath.The file to write. Must be a file path, not a directory.
The full new content to write to the file.
| Status | Meaning |
|---|---|
NO_LOCK | No active lock for this file — call propose_file_access first. |
DENIED | A different agent holds the lock. |
CONFLICT | File changed since you locked it — re-read and re-lock before writing. |
WRITTEN | Success. Returns filePath and bytes written. |
guarded_write is local-server only. The hosted server has no access to files on your filesystem. When using the hosted MCP endpoint, use verify_file_lock for tamper detection and write through your editor normally after confirming the file is CLEAN.Releasing locks
release_file_access
Release an owned lock early — before the job is completed. Use when you finish editing a file mid-job and want to unblock teammates who may need it.
complete_job
The primary release path. Completing a job releases all file locks held for that job in one call.
force_unlock — admin override
force_unlock removes a lock regardless of who holds it. It is intended for crashed agents whose locks did not get cleaned up automatically.
The file whose lock should be forcibly removed.
A description of why the override was necessary, written to the lock audit log.
force_unlock only for locks that are more than 25 minutes old from an agent that is demonstrably crashed. Unlocking an active agent’s lock mid-work causes the kind of collision that Axis exists to prevent.
Opt-in physical enforcement
SetAXIS_ENFORCE_LOCKS=1 to harden advisory locks into read-only file permissions:
- On grant: the server
chmods the locked file read-only. Any process that tries to write to it directly getsEACCES. - Writing through Axis: the lock holder uses
guarded_write, which briefly restores write permissions for the duration of the write, then sets them back. - On release /
complete_job/finalize_session: the original file permissions are restored automatically.
chmod the file back — no userspace server can prevent that — but it makes inadvertent overwrites impossible.
Best practices
Write a descriptive intent
The
intent string is the most important field. It appears verbatim in denial messages shown to every agent trying to access the same file. “editing file” tells nobody anything. “Refactoring auth to issue JWTs instead of session cookies — changing token payload shape” tells the whole team what’s happening and why they should pick a different task.Prefer guarded_write
Route writes through
guarded_write instead of writing directly. It’s the difference between detecting a collision after the fact and preventing it entirely.Release locks promptly
Complete jobs as soon as the work is done. Every file you hold is blocked for every other agent on the team. Don’t hold locks while working on unrelated code.