Write File (Gated)
sdlc_write_fileCreate, overwrite, or append UTF-8 text files with approval gating, automatic backups, and audit logging. Use the returned changeId to roll back changes.
Instructions
Create/overwrite/append a UTF-8 text file. Dry-run unless confirm=true; backs up existing content; appends to the audit log; rollback via the returned changeId.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | overwrite | |
| path | No | Target directory. Filesystem roots are rejected; UNC/network paths require an explicit environment override. | |
| dryRun | No | Explicit dry-run switch. Mutation only occurs when dryRun is false AND confirm is true. | |
| confirm | No | Approval gate. Without confirm=true the call is a dry-run and changes nothing. | |
| content | Yes | UTF-8 content (max 1 MiB). | |
| filePath | Yes | File to act on, relative to the target directory (absolute paths contained by it are accepted). | |
| allowSensitive | No | Required to touch .env/key/credential-style paths. | |
| expectedSha256 | No | Optional optimistic-concurrency guard: current file SHA-256. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | ||
| changeId | No |