---
title: "mirror set"
summary: "Edit mirror.yaml and agent files."
read_when: "the arguments or options of mirror set are needed"
url: https://mirrordimensions.com/docs/reference/set/
---

# mirror set

Edit mirror.yaml and agent files.

Its commands: `rule`, `visibility`, `grant`.

```sh
mirror set <command>
```

## mirror set rule

Add or replace a rule in mirror.yaml. Takes effect on the next run; no rebuild.

```sh
mirror set rule <app_id> [options]
```

| Argument | Needed | What it is |
| --- | --- | --- |
| `app_id` | Yes |   |

| Option | Takes | What it does |
| --- | --- | --- |
| `--file` | path | A YAML file with one rule. |

## mirror set visibility

Set what every agent sees of a system. Between granted, denied and present it applies at the next run; to or from absent, after a rebuild. Nothing is rebuilt now.

```sh
mirror set visibility <app_id> <state>
```

| Argument | Needed | What it is |
| --- | --- | --- |
| `app_id` | Yes | A system id from mirror system list. |
| `state` | Yes | granted, denied, present or absent. |

## mirror set grant

Set one grant in an agent file. Grants are exact; it applies at the agent's next run.

```sh
mirror set grant <agent> <resource> <grant>
```

| Argument | Needed | What it is |
| --- | --- | --- |
| `agent` | Yes | An agent from mirror agent list. |
| `resource` | Yes | &lt;system&gt;/&lt;name&gt;, such as code/billing-service or chat/incidents; or a system alone. |
| `grant` | Yes | read, write or admin for a repository; member for a channel; allowed for a tool; granted for a whole system; none to take it away. |

## The same, from an AI agent

The operator MCP server offers these tools for it:

- [`set_visibility`](https://mirrordimensions.com/docs/reference/mcp-tools/#set_visibility): Set what every agent sees of a system: granted, denied, present or absent.
- [`set_grant`](https://mirrordimensions.com/docs/reference/mcp-tools/#set_grant): Set one grant in an agent file: resource is &lt;system&gt;/&lt;name&gt; (code/billing-service, chat/incidents) or a system alone; grant is read, write, admin, member, allowed, granted, or none to take it away.
- [`set_rule`](https://mirrordimensions.com/docs/reference/mcp-tools/#set_rule): Add or replace a rule on a system: {name, match: {surface}, input?, output?, when?}. See show_system for the surfaces.
