> For the complete documentation index, see [llms.txt](https://docs.metamynd.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metamynd.ai/get-started/govern-non-financial-actions.md). Agents can also search and read this documentation through its [MCP server](https://docs.metamynd.ai/~gitbook/mcp).

# Govern Non-Financial Actions

Most agent actions move no money: reading a record, updating a ticket, deleting a file, sending a message. This page explains how the gate decides when such an action needs a human, and how you make that decision depend on **what the agent is doing** rather than on what the agent says about itself.

{% embed url="<https://youtu.be/Adq3PCgAZqM>" %}

Normative text: MAGP spec §6.3 (context provenance), §6.3.8 (owner-keyed operations) and Appendix C (the atom catalog).

#### Read this first: risk is the agent's word unless you configure otherwise <a href="#user-content-read-this-first-risk-is-the-agents-word-unless-you-configure-otherwise" id="user-content-read-this-first-risk-is-the-agents-word-unless-you-configure-otherwise"></a>

For a payment, MetaMynd derives risk from facts the agent cannot fake: the signed amount against your per-transaction cap, or a first payment to an unvetted merchant. A non-financial action has no amount. With nothing else configured, whether it escalates depends on the `riskLevel` **the agent declares in its own context**.

So, out of the box, an agent that sends this runs without review:

```
{ "riskLevel": "low", "target": "record-B", "op": "delete-all" }
```

The starter "High-risk review" rule escalates on `riskLevel` `high` or above. It refuses a **missing** or **garbled** `riskLevel` (`CONTEXT_UNVERIFIABLE`), but it cannot tell an honest `low` from a dishonest one.

There are three ways to take that decision away from the agent:

| You know\...                                          | Use                                     | Effect                                                                       |
| ----------------------------------------------------- | --------------------------------------- | ---------------------------------------------------------------------------- |
| This whole action is always risky                     | the mandate's `riskTier` for the action | Every call is at least that risk. The agent can raise it but never lower it. |
| Which **operations** are risky (`delete`, `purge`...) | a `context-value-in` rule               | Those operations are reviewed or blocked, whatever `riskLevel` says.         |
| Which operations are **safe** (`read`, `list`)        | a `context-value-not-in` rule           | Everything else is reviewed or blocked. This is the stronger form.           |

#### Key a rule on the operation <a href="#user-content-key-a-rule-on-the-operation" id="user-content-key-a-rule-on-the-operation"></a>

Add a molecule to an SOP (dashboard: **Authority & Controls → SOPs (Rules)**, edit the SOP, add a rule, and pick **Context value is on a list (owner-marked operation)**). As JSON it looks like this:

```
{  "id": "deletes-need-approval",  "name": "Deleting records needs approval",  "combinator": "any",  "atoms": [    {      "id": "op",      "predicate": "context-value-in",      "config": {        "field": "op",        "values": ["delete", "purge"],        "match": "contains",        "missing": "fire",        "actions": ["records"]      }    }  ],  "decision": "escalate",  "reasonCode": "OPERATION_NEEDS_APPROVAL"}
```

| Config    | Required | Meaning                                                                                                                                                                                                                                   |
| --------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `field`   | yes      | Dot path of the context field to read: `op`, or `params.op` for a nested one. A key that itself contains a dot cannot be addressed, so an agent cannot send two copies and choose which one the rule reads.                               |
| `values`  | yes      | For `context-value-in`, the values that make the rule fire. For `context-value-not-in`, the allowed values.                                                                                                                               |
| `match`   | no       | `exact` (default), or `contains`: the value contains a listed entry, so `delete` also catches `delete-all` and `bulk_delete`.                                                                                                             |
| `missing` | no       | `pass` (default) or `fire`. With `fire`, a request that leaves the field out fires the rule, so an agent cannot skip it by not sending the field. Use it together with `actions`, so actions that never carry the field are not affected. |
| `actions` | no       | Judge only these actions (your mandate targets). Every other action is out of the rule's scope.                                                                                                                                           |

Use `"decision": "block"` with `OPERATION_NOT_ALLOWED` to refuse the operation outright.

The allow-list form reviews everything that is **not** a known-safe operation:

```
{ "id": "op", "predicate": "context-value-not-in", "config": { "field": "op", "values": ["read", "list"], "missing": "fire", "actions": ["records"] } }
```

#### How values are compared <a href="#user-content-how-values-are-compared" id="user-content-how-values-are-compared"></a>

Both sides are normalised before comparing, so these all count as `delete-all`:

* `DELETE-ALL`, `delete_all`, `delete all`: case, surrounding whitespace, and hyphens, underscores and spaces are ignored.
* `ｄｅｌｅｔｅ－ａｌｌ`: full-width and other compatibility forms (Unicode NFKC).
* `delete​-all`: invisible characters (zero-width, soft hyphen, bidi controls) are removed.
* `dеlete-all` with a Cyrillic `е`: common Cyrillic and Greek look-alikes of Latin letters are folded. NFKC alone does not do this, because a Cyrillic `е` is a different letter, not a variant.

Some shapes always fire, in either form, because they cannot be compared: an object (`{"verb": "delete"}`) or a nested list. A list of values (`["read", "delete"]`) fires if **any** element would. An empty string or an empty list counts as absent.

**A deny-list cannot foresee every spelling.** `remove`, `drop`, `destroy_all` and `wipe` are not `delete`. The look-alike table is deliberately small: it is not the full Unicode confusables list. If you can name the safe operations, use `context-value-not-in`. Then a spelling you did not foresee fires instead of passing.

#### What the reviewer and the agent see <a href="#user-content-what-the-reviewer-and-the-agent-see" id="user-content-what-the-reviewer-and-the-agent-see"></a>

When an operation rule fires, the decision carries a **derived risk signal**, the same way the financial signals do:

```
"riskSignals": [{ "signal": "context-value", "level": "high", "detail": "op=delete-all is owner-marked for review" }]
```

* **The verdict** returns it to the agent. The SDKs show it on `err.governance.riskSignals` (Node) and `GovernanceRefusal["riskSignals"]` (Python).
* **The escalation card** in the dashboard (**Operations → Escalations**) shows "Derived by MetaMynd · Your operation rule: op=delete-all is owner-marked for review (risk high)", next to the `riskLevel` the agent declared.
* **The decision record** lists it as a `risk` control result, and the refusal record stores the **effective** risk (`high`), not the agent's `low`.

#### Make sure the field is the one that executes <a href="#user-content-make-sure-the-field-is-the-one-that-executes" id="user-content-make-sure-the-field-is-the-one-that-executes"></a>

A rule on `op` is only as good as the binding between `op` and what actually runs:

* Name the field your executor acts on. If the tool reads `params.op`, key the rule on `params.op`.
* Run the action behind the gateway (`agentsafe-mcp-guard`, `agentsafe-http-gateway` or `agentsafe-a2a-guard`). An approved escalation is bound to the exact context it approved: an agent that changes `op` after approval is refused `AUTHORIZATION_CONTEXT_MISMATCH`.
* If the service can derive the operation from the real call itself, have it supply `trustedContext` (see <a href="https://docs.metamynd.ai/core-concepts/context-provenance-and-risk-floors" target="_blank">Context Provenance & Risk Floors</a>). The rule then reads the service's value, not the agent's.

Operation rules are evaluated by the same pure code in the hosted gate and in every guard and gateway bundle, so a gateway judging a request locally reaches the same verdict.

#### When the rule depends on the state of your systems <a href="#user-content-when-the-rule-depends-on-the-state-of-your-systems" id="user-content-when-the-rule-depends-on-the-state-of-your-systems"></a>

Some operations are safe or risky depending on the world, not the request: restart a service only while it is unhealthy, roll back only after a bad release. Don't take that state from the agent's context. Have a monitoring service you register as an **observer** sign it, and write the rule on `env.<fact>` with `requireProvenance`. Then the agent can't supply the fact, and a missing or stale one escalates. See <a href="https://docs.metamynd.ai/guides/govern-operations-with-attested-facts" target="_blank">Govern Operations with Attested Facts</a>.

#### Draft one from your SOP document <a href="#user-content-draft-one-from-your-sop-document" id="user-content-draft-one-from-your-sop-document"></a>

The SOP Compiler's **Draft rules without AI** recognises sentences such as:

* "Deleting records requires approval." → `context-value-in`, `op` contains `delete`, escalate, `OPERATION_NEEDS_APPROVAL`
* "Customer records must not be purged." → `context-value-in`, `op` contains `purge`, block, `OPERATION_NOT_ALLOWED`

It recognises `delete`, `purge`, `erase`, `wipe` and `destroy` acting on data (records, files, accounts...). It does not draft a sentence with a condition it cannot carry ("older than", "in bulk", "if"), a list ("deleting or archiving"), or an obligation to delete ("must be deleted after 30 days"). The drafted field is a guess (`op`), and `missing` is left at `pass`: set both to match your agent before you confirm the rule.

#### Verify it <a href="#user-content-verify-it" id="user-content-verify-it"></a>

Send the request your rule should catch, with `riskLevel: "low"`, and check that you get your `reasonCode` and a `context-value` risk signal. Then send a safe operation and check that it is allowed. The <a href="https://docs.metamynd.ai/guides/scenario-bank" target="_blank">Scenario Bank</a> can dry-run both without an agent running.

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.metamynd.ai/get-started/govern-non-financial-actions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
