Write commands
No safran command performs a write. Agents do, through the MCP server, and only when the profile says so; the CLI's part is to tell you whether that is the case and what happened. This page documents safran writes status, safran writes log, and the two flags that sit next to the profile's writes section: --allow-writes and --no-writes. The model itself, step by step and with its risks, is on writes.
$ safran writes status
✔ Writes are off: Safran only reads.
Why: the profile has `writes.enabled: false` (the default).
→ To allow one kind: safran profile set writes.enabled true writes.allow ticket.comment| Command | Reads | Calls |
|---|---|---|
safran writes status | the profile | nothing; it is offline |
safran writes log | the audit log in safran.db under the data directory | nothing |
Which switch decides
A write is possible only when all of these hold. safran writes status names the first one that does not.
| Switch | Where | Default |
|---|---|---|
writes.enabled: true | the profile | false |
The kind is listed under writes.allow | the profile | []: nothing is allowed |
| The profile is trusted | you named it (--profile, SAFRAN_PROFILE) or passed --allow-writes | a profile that was only found in the current directory is not trusted |
--no-writes was not passed | safran mcp | not passed |
The trust rule
A safran.yaml that merely happens to be in the directory you are standing in does not get to post anywhere. When the CLI finds the profile by itself, it ignores that profile's writes: section until you name the file or pass --allow-writes, for the same reason it does not load that profile's plugins: without --allow-plugins: a repository you cloned must not be able to turn an agent's write access on by shipping a file.
$ safran writes status
✔ Writes are off: Safran only reads.
Why: the profile enables writes, but it was picked up from the current directory, not named by you.
→ If you trust this profile, name it (--profile safran.yaml) or pass --allow-writes.
The profile would permit: ticket.comment, pull_request.reply.--allow-writes is a global option: every command accepts it, and it only matters for the ones that build an instance an agent can write through (safran mcp) or that report the state (writes status, status, doctor, profile check, setup claude). It grants nothing by itself; the profile still has to enable writes and list the kinds.
--no-writes
safran mcp --no-writes serves no write tool, whatever the profile says and however it was found. Use it for a server that must stay read-only on a machine whose profile enables writes. The first line safran mcp prints on stderr says which of the two it is.
Turning writes on
Edit the profile, or let the validator do it:
$ safran profile set writes.enabled true writes.allow ticket.comment,pull_request.reply
✔ Updated safran.yaml
= writes.enabled: true
= writes.allow: [ticket.comment, pull_request.reply]
A running MCP server keeps its old settings until it is restarted → safran writes statusA running MCP server keeps the settings it started with. Restart it (in Claude Code: reconnect the server) for a change to apply. safran setup claude prints a command that names the profile, so a server registered that way applies the profile's writes: section.
safran writes status
safran writes statusSays whether agents may write through Safran with this profile, which kinds, and when not, why and how to change it. It has no options of its own, is offline and reads only the profile.
$ safran writes status --profile /work/acme/safran.yaml
! Writes are ON for safran.yaml: agents using this profile can post under the connector tokens' accounts.
ticket.comment allowed add a comment to a ticket
ticket.create_child not allowed
pull_request.comment not allowed
pull_request.reply allowed reply in a review thread
Every write is previewed first and sent only after it is confirmed.
Marker added to every post: Bir yapay zekâ asistanıyla hazırlandı.
Each preview, commit and failure is logged: safran writes log --profile /work/acme/safran.yamlA kind the profile allows but no configured connector can perform is listed as unavailable, with the reason. safran status, safran doctor and safran profile check carry the same verdict in one line (writes off — … or writes ! ON: …).
JSON
enabled and allowed are what an instance would answer; profile is what the file says, whether or not it is trusted; profile_trusted is the trust rule above; unavailable lists allowed kinds no connector can perform.
{
"enabled": false,
"allowed": [],
"unavailable": [],
"require_confirmation": true,
"reason": "the profile enables writes, but it was picked up from the current directory, not named by you",
"hint": "If you trust this profile, name it (--profile safran.yaml) or pass --allow-writes.",
"profile": {
"enabled": true,
"allow": [
"ticket.comment",
"pull_request.reply"
],
"marker": "Bir yapay zekâ asistanıyla hazırlandı."
},
"profile_trusted": false
}Exit codes
0 whether writes are on or off: both are answers. 1 when the profile cannot be loaded.
safran writes log
safran writes log [options]Prints the audit log, newest first: one row per write that was previewed, with what became of it. It reads the local store only and works while writes are off.
| Flag | Value | Default | Meaning |
|---|---|---|---|
--since <date> | ISO date | none | Only rows changed on or after this date. |
--kind <kind> … | repeatable, comma list | all | Only these kinds: ticket.comment, ticket.create_child, pull_request.comment, pull_request.reply. |
--status <status> … | repeatable, comma list | all | Only previewed, committed or failed. |
--limit <n> | whole number, at least 1 | 20 | Rows to show. |
--bodies | none | off | Also print the text of committed and failed writes. |
$ safran writes log --profile /work/acme/safran.yaml
when status kind target by
2026-03-20 10:57 failed ticket.comment jira:PAY-11 claude-code
✘ UPSTREAM: The tracker did not answer within 30 s
2026-03-20 10:21 previewed pull_request.reply azure:payments-api#7 claude-code
2026-03-20 09:20 committed ticket.comment jira:PAY-10 claude-code
→ https://jira.acme.example/browse/PAY-10?comment=w1
3 rows: 1 committed, 1 failed, 1 previewed only| Status | Meaning |
|---|---|
previewed | A preview was made and never committed: nothing was sent. The row keeps only the SHA-256 of the text. |
committed | The write went through; the next line is the link to what it created. |
failed | The commit was attempted and failed; the next line is the error. For UPSTREAM the write may still have happened: look at the target. |
by is the client that asked, when it said so (an MCP client name). target is <connector id>:<key>. The captured rows above come from Safran's in-memory test connectors with acme's data.
$ safran writes log --profile /work/acme/safran.yaml --status committed --bodies
when status kind target by
2026-03-20 09:20 committed ticket.comment jira:PAY-10 claude-code
→ https://jira.acme.example/browse/PAY-10?comment=w1
2026-03-20 09:20 committed ticket.comment → jira:PAY-10
Yuvarlama testi eklendi: `refundPartial` artık kuruşa yuvarlıyor.
Bir yapay zekâ asistanıyla hazırlandı.
1 row: 1 committed, 0 failed, 0 previewed onlyBefore anything was previewed:
$ safran writes log
The audit log is empty: nothing was previewed or written through this data directory.
Writes are off → safran writes statusJSON
entries are the audit rows with snake_case keys; body is present for committed and failed rows (at most 2,000 characters), result_id and result_url for committed ones, error for failed ones. Titles and bodies are third-party and drafted text.
{
"writes_enabled": true,
"entries": [
{
"id": "d06d1131-4959-4e13-a53a-f80635eec866",
"at": "2026-03-20T10:57:13.000Z",
"kind": "ticket.comment",
"target": {
"source": "jira",
"type": "ticket",
"key": "PAY-11",
"url": "https://jira.acme.example/browse/PAY-11",
"title": "Provider sandbox credentials"
},
"status": "failed",
"body_sha256": "42ef5682ae4a70c34d3d6bdb9969eab7bc23b0ad993a7727eb5561cbc4b19896",
"body": "Sandbox anahtarları yenilendi mi?\n\nBir yapay zekâ asistanıyla hazırlandı.",
"error": {
"code": "UPSTREAM",
"message": "The tracker did not answer within 30 s"
},
"client": "claude-code"
}
],
"limit": 20
}Exit codes and mistakes
0 when the log was printed, also when it is empty; 1 for a Safran error; 2 for a usage error.
$ safran writes log --kind ticket.delete
✘ --kind must be one of ticket.comment, ticket.create_child, pull_request.comment, pull_request.reply; got "ticket.delete"
→ Did you mean ticket.comment?- Reading the log as the tracker's truth. It records what Safran sent and what the connector answered. A
failedrow withUPSTREAMdoes not prove the comment is absent. - Expecting previews to keep their text. A preview that was never committed keeps only the hash, so drafted text that nobody approved is not stored.
- Deleting the data directory to "reset" Safran. The audit log lives in
safran.dbthere and goes with it.
Common mistakes
- Enabling writes and wondering why nothing changed. The server was started before the edit, or the profile is found rather than named.
safran writes statussays which. - Passing
--allow-writesto a profile you did not read. It applies whatever that file allows. Read itswrites:section first. - Looking for a command that posts a comment. There is none, on purpose. A write needs a preview a person confirms; that conversation happens in the agent session.