# Writes and confirmations

ARNscope reads by default. Browsing, previews, logs, metrics and queries that only read need no switch and no confirmation. Anything that changes something (start an instance, delete an object, run a Lambda function or change its settings, redrive a queue, store a new secret value, write a row) sits behind **Writes**, which is off until you turn it on.

Two steps stand between you and a change:

1. **Turn Writes on.** A native dialog, drawn by the app and not by the page, names what you are allowing. The page itself cannot answer it or turn Writes on.
2. **Confirm each write.** Every write then shows its own native dialog with what will change and where. Nothing is sent until you click its button.

Both checks run in the desktop app's backend before any call to AWS or to a database, so a hidden or disabled button on a page is never the only thing in the way.

## Where the Writes switch lives

| Scope | One switch covers | Shared across |
| --- | --- | --- |
| AWS | One **AWS profile and region** | Every AWS page: EC2, ECS, Step Functions, Lambda, SQS, Secrets Manager, S3 deletes, SOPS file deploys |
| SQL | One **database session** (a connection you opened) | That console only. Closing the session forgets it. |
| EC2 Files | One **Files session** on one instance | That session only. See [EC2 Files](https://arnscope.com/docs/ec2-files). |
| Valkey | One **cache connection** | That connection only. See [Valkey](https://arnscope.com/docs/valkey). |

The AWS switch is keyed on profile and region together. Turning it on for `staging` in `us-east-1` does nothing for `staging` in `eu-west-1`, or for another profile. If a page does not choose a region, ARNscope uses the profile's default region from your AWS config (`us-east-1` when it has none).

### Turning it on

The dialog is called **Turn on writes?** It names the profile and region (or the database user, host and database for SQL), says what Writes allow, and says they turn off by themselves. Click **Turn on writes** to continue or **Cancel** to stay read-only. A dialog nobody answers within a minute expires and nothing changes. Only one confirmation can be open at a time in the whole app.

### Turning it off

- **15 minutes without a write.** Each confirmed write restarts the 15 minutes. Reading and browsing do not. After that the switch is off and the next write is refused with a message that says Writes turned off after 15 minutes.
- **When you turn it off**, with the same switch.
- For SQL, also when you disconnect. For Files and Valkey, also when the session or connection is lost or reopened.

Writes also turn off when you quit the app: nothing is remembered between runs.

## What each write shows

Each write's confirmation is a native dialog with a title such as **Stop instance?**, the thing that changes, and a last line naming the profile and region. A few examples of what it adds:

- **Lambda invoke** shows the function (with its version or alias) and the start of the payload (one line, first 120 characters), and says the function runs for real with whatever side effects it has.
- **Lambda settings** (memory, timeout, environment variables, concurrency, aliases and the rest) show each field before and after; environment variables are listed by key name, never by value. See [AWS Lambda](https://arnscope.com/docs/lambda#change-settings).
- **S3 delete** lists the object count and the first five keys, and says whether they can be restored. See [S3](https://arnscope.com/docs/s3).
- **ECS desired count** shows the current and new count, how many tasks are running now, and a warning when you set it to 0. See [ECS](https://arnscope.com/docs/ecs).
- **Step Functions** shows the execution (or state machine) and, for a start, the start of the input. A stop says steps in progress are abandoned.
- **SQS** redrive says how many messages wait, where they go and at what rate; a purge says it deletes every message, in flight and delayed too. See [Amazon SQS](https://arnscope.com/docs/sqs#change-the-queue).
- **Secrets Manager** writes are **Store a new secret value?** (lists only the key names that change, never values), **Rotate secret now?** (names the rotation function) and **Go back to the previous version?** (shows the version IDs `AWSCURRENT` moves between). See [AWS Secrets Manager](https://arnscope.com/docs/secrets).

Dialog text is shortened and stripped of control characters, so a long or odd name cannot push the real target out of view.

### Production profiles

A profile counts as production when either is true:

- its name has a `prod`, `production` or `prd` part (`acme-prod` and `prod_admin` do; `preprod`, `product` and `staging` do not), or
- you marked it **Production** in Settings. You can also unmark a profile the name rule catches.

For a production profile, the **Turn on writes** dialog starts with **PRODUCTION profile.** and its button reads **Turn on writes on production**. Each write dialog is titled with **(PRODUCTION)** and its button says **on production**. EC2 also treats an instance tagged `Environment`, `Env` or `Stage` with the value `prod` or `production` as production, whatever the profile is called. SQL sessions are production when the profile, the connection name or the host reads like it.

Where a change can hurt most, ARNscope asks **twice** on production. Changing an ECS service's desired count is one case: one dialog with the change, then a second, **Change desired count on production?** Deleting a Lambda alias on a production profile (or one that splits traffic or has provisioned concurrency) is another: you type the alias's name before the confirmation. Purging an SQS queue on a production profile is a third: you type the queue's name, and the backend checks it again before it calls SQS.

## What is behind Writes

| Area | Behind the Writes switch |
| --- | --- |
| EC2 | Start, stop (and hibernate) and reboot an instance; opening a shell or a Session Manager terminal |
| ECS | Deploy (force a new deployment, or deploy a revision), register a task definition revision, change a service's desired count |
| Step Functions | Start an execution (including Run again), stop one, redrive one |
| Lambda | Invoke a function (synchronous or asynchronous); change memory, timeout, ephemeral storage, description, environment variables, reserved concurrency, asynchronous invocation settings and tags; publish a version; create, edit and delete aliases; add, change and remove provisioned concurrency |
| SQS | Start and cancel a dead-letter queue redrive, send or replay a message, delete one message, purge a queue |
| Secrets Manager | Store a new value, rotate now, restore the previous version |
| SOPS files ([Labs](https://arnscope.com/docs/labs)) | Applying a deployment to Secrets Manager, Parameter Store or through Terraform |
| S3 | Deletes: objects, a selection, Empty Trash, and deleting a bucket |
| Databases | Any SQL that is not a read, per session; StarRocks **Stop query** and setting the profiling threshold |
| EC2 Files | Saving a file on an instance |
| Valkey | Every write: publish, set, delete, stream add and the rest |

These all use the same dialogs and the same 15-minute rule, except that SQL, Files and Valkey keep a switch of their own per session or connection, as the first table says.

### What is deliberately not behind it

These S3 actions do not need the Writes switch and have no confirmation of their own:

- **Uploads**, including drag and drop.
- **Copies** within or between buckets.
- **Renames and moves.**
- **New folders.**

They add or relocate objects and never remove one without a verified copy. A move is one step: ARNscope refuses if something already exists at the destination, copies the object only if the source has not changed, checks the copy, and only then deletes the original. A rename or move never replaces an existing object. An **upload or a copy to a key that already exists** needs Writes on and one native confirmation that lists what is replaced (key, size change, last modified), and then replaces exactly that version; with Writes off, a batch can skip the existing keys instead. Folder Sync uploads are covered by the job's own approval. In a bucket without versioning, a replaced object's old content is gone, so turn on versioning where that matters. All of them are recorded in the activity log.

### Downloads and the SOPS repository file

Downloads and the copy of a [SOPS file](https://arnscope.com/docs/sops-files) in your repository only write where you choose in a native **Save** or **Open** dialog. The page can suggest a file name but cannot point ARNscope at a path, so a page can never write into the app's data folder or `~/.aws`.

## Folder Sync approvals

A sync job writes to a bucket on a schedule, and a mirror sync also deletes. So it does not use the 15-minute switch. Each job needs its own **approval**, asked once in a native dialog:

- It shows the job name, the local folder in full, the bucket and prefix, the profile, how often it runs, and **MIRROR SYNC** with a warning when the job deletes bucket objects that are not in the folder. Production profiles are named.
- The approval lasts until you revoke it in Folder Sync. It does not expire after 15 minutes.
- It covers exactly what the job syncs: profile, bucket, prefix, folder, direction and the mirror setting. **Change any of them and the job asks again.** Until then it does not run.
- The local folder must be given as its real path, with no `..` and no links.
- Approvals are signed with a key kept in the macOS keychain and stored on this Mac. A copy of the file that someone edited, planted or restored from an older backup is ignored, so a revoked approval cannot come back that way.

Sync runs from a folder to a bucket only. There is no bucket-to-folder sync.

## SQL read sessions

Every database session opens read-only, whichever mode you chose when connecting. Choosing **Write** makes ARNscope ask for the **Turn on writes?** confirmation right after connecting; you can also use the **Allow writes** switch in the console header. With Writes off, ARNscope checks each statement before sending it:

| Engine | What the read session refuses |
| --- | --- |
| **PostgreSQL** | Anything PostgreSQL's own parser says is not a read: `INSERT`, `UPDATE`, `DELETE`, DDL, `COPY`, `SELECT … INTO`, `FOR UPDATE` and `FOR SHARE`, and `EXPLAIN ANALYZE` of a write. Also functions that run SQL given as text, change settings, signal other sessions, take locks or reach outside the database (for example `set_config`, `query_to_xml`, `pg_terminate_backend`, `dblink`, `lo_import`, advisory locks, replication slot functions, the `aws_s3` and `aws_lambda` extensions and `http`), wherever they appear in the statement. A statement that switches the session to read-write is refused too. |
| **MySQL, MariaDB** | Anything that does not start with `SELECT`, `SHOW`, `DESC`, `DESCRIBE`, `EXPLAIN`, `WITH`, `USE`, `HELP` or `TABLE`, and any statement containing `INSERT`, `REPLACE`, `UPDATE`, `DELETE`, `INTO OUTFILE` or `INTO DUMPFILE`. The session also runs `SET SESSION TRANSACTION READ ONLY`. |
| **StarRocks** | The same keyword check, run under both MySQL's and StarRocks' own comment and quoting rules. Only **one statement at a time** is accepted. SQL where the two readings differ, or that uses a `#` comment, is refused rather than guessed at. StarRocks has no server-side read-only setting. |
| **ClickHouse** | Every request carries `readonly=1`, and ClickHouse itself refuses writes and refuses any attempt to lift it from SQL. If the user's server profile is already read-only, ARNscope sends no setting. |

On PostgreSQL and MySQL the server's read-only setting is put back before every statement, so a statement that tried to lift it does not carry over to the next one.

### The honest limit

This check reads the statement you typed. It cannot see inside the database. A **view or a function defined on the server can still act**, with whatever its owner is allowed to do, and a read that calls it looks like a read. For the same reason the PostgreSQL function list is a list of known cases, not every function that could ever do something.

The real boundary is the database user. **Connect with a read-only database user** for read work, and give a user that can write only to the sessions that need it. Where the engine supports it, use [IAM authentication](https://arnscope.com/docs/rds-postgresql#why-iam-authentication) so there is no password to keep, and grant that user only what the work needs.

### When Writes turn off in the middle of a transaction

If Writes turn off (by the 15 minutes or by you) while a transaction you began with Writes on is still open, only `ROLLBACK` runs on that session. ARNscope says so, and you can turn Writes on again to `COMMIT`. A `COMMIT` is not let through while Writes are off.

## The activity log

Every write attempt is recorded in the local activity log on your Mac: the service, the profile and region (or the database host, port and user), what it targeted, and whether it went through, failed or was cancelled. Turning Writes on and off, refused writes and expired confirmations are recorded too.

The log keeps no payloads. It does not store SQL text (a refused statement is logged by its first keyword only), Lambda payloads, execution inputs or file and secret contents. Clearing the log asks for a native confirmation first.

## The command line

Turning on **Allow command-line control** in Settings asks in a native dialog. The command line has no commands that change AWS resources or databases, and it cannot turn Writes on. See [Command line](https://arnscope.com/docs/cli).

## Limitations

- The 15-minute rule counts writes, not time on screen. Leave a page with Writes on and it still turns off.
- The switch is per profile and region. An action that touches a second region (a Lambda function in another region, or an S3 bucket whose region differs from the page) is checked against that region too, and refused with a message that names it.
- Uploads, copies, renames, moves and new folders do not ask (see above).
- The SQL read check is a guard on the statement, not a database permission. See "The honest limit".
- There is one confirmation per write, not per object inside a bulk action. A bulk delete lists its objects once and deletes them all.
- Approvals for Folder Sync are not tied to the 15-minute switch, by design.

Something you want behind Writes, or a confirmation that tells you too little? Write to [hello@arnscope.com](mailto:hello@arnscope.com).

Source: https://arnscope.com/docs/writes
