file_create
Create a text file atomically with overwrite guards and undo support, making workspace file creation reversible and protected by policy checks.
Instructions
Create a new text file and return operation_id and undo_available.
Fails with ALREADY_EXISTS while expected_absent is true (the safe
default); set it false to overwrite an existing file, which makes the
call destructive. Writes are atomic. Credential-shaped targets are
refused with SENSITIVE_PATH_REFUSED unless i_accept_secret_write_risk is
true, which records a warning and is itself undoable. dry_run validates
every guard and writes nothing, returning operation_id null. Otherwise
the operation is recorded and undoable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| content | Yes | ||
| dry_run | No | ||
| encoding | No | utf-8 | |
| expected_absent | No | ||
| i_accept_secret_write_risk | No |