> 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/core-concepts/policy-standards-and-sops.md). Agents can also search and read this documentation through its [MCP server](https://docs.metamynd.ai/~gitbook/mcp).

# Policy: Standards & SOPs

Standards are rule packs the platform publishes; SOPs are your own private rules. Both run on the same deterministic engine on every request.

Alongside mandate evaluation, MAGP enforces two parallel governance-document types, sharing the **exact same rule schema** and evaluated by the exact same deterministic engine — they differ only in scope and ownership.

|             | Standard                                                                                                                                           | SOP                                                   |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| Scope       | Platform-wide                                                                                                                                      | Tenant/legal-entity-owned, private to that tenant     |
| Authoring   | Super-admin published                                                                                                                              | Owner-authored                                        |
| Versioning  | Version-controlled — a new version is a new row, the old one is never mutated                                                                      | Not versioned — editing re-hashes/re-anchors in place |
| Enforcement | Optional `enforced` flag — the gate refuses any agent that is not compliant with every enforced Standard at step 3 of 16 (`STANDARD_NONCOMPLIANT`) | Assigned per agent                                    |
| Anchoring   | HCS-anchored, with a `contentHash`                                                                                                                 | HCS-anchored, with a `contentHash`                    |

In the gate, Standard molecules run at step 11 and SOP molecules at step 12 — after identity, containment and freshness, before mandate evaluation. See [The Authorize Gate: 16 Ordered Checks](https://docs.metamynd.ai/agent-protocol/the-authorize-gate-16-ordered-checks).

#### Atoms → molecules → rule packs

Both Standards and SOPs are authored the same way, bottom-up:

* **Atom** — a reference to a code-defined, pure predicate plus config: `{ id, predicate, config? }`. Predicates themselves live in code, not data:

  | Predicate                   | Fires when                                                                                                                     |
  | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
  | `amount-over`               | a single amount exceeds a limit (optionally scoped to currencies)                                                              |
  | `amount-unknown`            | the action carries no usable amount, or a negative one                                                                         |
  | `cumulative-over`           | spend so far plus this action exceeds a budget (optionally scoped to currencies)                                               |
  | `risk-at-or-above`          | the effective risk level is at or above a threshold                                                                            |
  | `data-source-not-approved`  | the action uses a data source not on the approved list                                                                         |
  | `consent-missing`           | explicit consent is absent                                                                                                     |
  | `text-matches`              | the prompt or output contains a configured term                                                                                |
  | `jurisdiction-not-allowed`  | the jurisdiction is not on the allow-list                                                                                      |
  | `data-residency-violation`  | data would be processed outside the allowed regions                                                                            |
  | `model-not-allowed`         | the model is not on the approved list                                                                                          |
  | `tool-not-allowed`          | the tool is not on the approved list                                                                                           |
  | `pii-present`               | the action is flagged as involving personal data                                                                               |
  | `rate-limit-exceeded`       | the rolling call count exceeds a maximum                                                                                       |
  | `hol-trust-below-review`    | the counterparty's MetaMynd Trust Index score is below a review line (use with `escalate`)                                     |
  | `evidence-requirement`      | a required evidence type is missing                                                                                            |
  | `evidence-confidence-below` | attested evidence confidence is below a minimum, or absent                                                                     |
  | `context-value-in`          | a named field of the action's context holds one of the owner's listed values (a deny-list, e.g. "deleting needs approval")     |
  | `context-value-not-in`      | a named field of the action's context holds a value that is not on the owner's list (an allow-list; an unforeseen value fires) |

  The live catalog, with each atom's required context, is `GET /standards/atoms` (spec Appendix C). Every predicate is deliberately pure — no clock, no I/O, no randomness — which is what makes a verdict reproducible and independently verifiable at the edge.
* **Molecule** — atoms combined by `all` / `any` / `none`, firing a decision with a specific `reasonCode` when satisfied: `{ id, combinator, atoms, decision, reasonCode }`. The decision can be `observe` (permit but flag — reported as `STANDARD_OBSERVE` / `SOP_OBSERVE`), `escalate`, `block`, or a containment decision (`suspend` / `quarantine`) that takes the agent out of service.
* **Standard / SOP document** — a set of molecules under a key/title/version.

Across every molecule of every pack bound to an agent, the **most restrictive** decision wins.

This is a deliberate anti-arbitrary-code-execution boundary: tenants and authors compose **which** atoms apply (data), while the platform controls **what an atom is even capable of checking** (code). There's no way to author a rule pack that does something the atom registry doesn't already support.

#### Rules don't take the agent's word for it

Most atom inputs, such as `riskLevel` and `tool`, arrive in the request's unsigned context, which means they are the agent's own claim. `jurisdiction` is the exception. The `jurisdiction-not-allowed` atom reads only the *effective* jurisdiction: the country the owner registered for the payee, otherwise the value the agent **signed**. A jurisdiction in the unsigned context is ignored, and an enforced jurisdiction rule with no effective jurisdiction is refused `JURISDICTION_REQUIRED` (see [Restrict Jurisdictions](https://docs.metamynd.ai/guides/restrict-jurisdictions)). MAGP labels every context field with where its value came from (its **provenance**) and applies three protections:

* **Risk is a floor, never a ceiling.** The effective `riskLevel` is the highest of the agent's claim, the owner's `riskTier` on the mandate, and anything the executing gateway derived from the real request. The agent can raise its risk, never lower it.
* **Risk rules fail closed.** A molecule with a `risk-at-or-above` atom that meets a missing or unrecognised `riskLevel` escalates with `CONTEXT_UNVERIFIABLE` instead of reading silence as "low risk". (If you call the gate directly, send `riskLevel` in the context.)
* **Rules can demand a trusted source.** A molecule may declare `requireProvenance: { riskLevel: 'gateway_derived' }`; if the field doesn't come from at least that source, the molecule escalates.

See [Context Provenance & Risk Floors](https://docs.metamynd.ai/core-concepts/context-provenance-and-risk-floors).

#### Assignment: the "pin"

* A **Standard** is *pinned* to an agent at a specific version (`AgentComplianceStandard`). A new version of an enforced Standard does **not** auto-migrate existing pins — an agent becomes non-compliant against the key until it's explicitly re-assigned. This is deliberate: it makes version changes auditable rather than silently retroactive.
  * **At provisioning**, an agent is pinned to every Standard the platform marks as required (`enforced`, active). This is the same whether you use `npx create-metamynd-agent` or the dashboard's Deploy Agent wizard. When no Standard is required, nothing is pinned: the deploy result shows Standards "—", `agent.metamynd.json` has `standards: []` and the public manifest has `enforced_standards: []`.
  * **Optional Standards** (shown as "Not required fleet-wide" in the agent's **Manage** dialog) are never pinned automatically. The owner assigns them per agent with **Assign**. An agent without the pin is not refused, and while the pin exists the Standard's rules run on that agent's requests. The manifest's `enforced_standards` lists only required Standards, so an optional pin does not appear there.
* An **SOP** is simply assigned (`AgentSop`) with no version pinning — an agent always follows whatever is currently `active` for each SOP assigned to it. An agent holding identities on both testnet and mainnet has its SOP assignments per network. Unassigning is a row delete. In the dashboard, SOPs have their own page, **SOPs (Rules)**, where you pick the legal entity whose agents an SOP can be assigned to.
* A **regulatory profile** can be bound to an agent from **Governance Controls → Bind to agents** (draft profiles can't be bound). Binding adds the profile's Standards to the agent's checks at the gate, so a profile that names no Standards adds no checks. Only the agent's owner or a platform admin can bind, list or unbind an agent's profiles. See [Regulatory Mapping](https://docs.metamynd.ai/regulatory-compliance/regulatory-mapping).

#### Three ways to author

* **Rule packs** — ready-made starting points offered at onboarding and in the Launchpad: spend guardrails, spend plus total budget, approval-first, communications, compliance (jurisdiction and data), EU AI Act human oversight, Malaysia AI Governance Bill risk tiers, SAFR financial-services exposure controls, UK AI Risk Management Toolkit human oversight and data controls, manufacturing quality-evidence, and rate-limit early review.
* **Manual** — the atoms → molecules → rule-pack builder described above, used directly.
* **Compiled from a document** — the SOP compiler ingests a source document (an uploaded procedure, a policy PDF) and drafts atoms and molecules from it:
  * Uploaded documents are scanned for prompt-injection before extraction.
  * Extraction uses an AI provider when one is configured and available; when it is throttled or not configured, a deterministic, no-AI pattern extractor drafts rules instead. Failed extractions go to a retry queue.
  * Each drafted rule keeps its provenance (the sentence it came from) and is checked for conflicts with existing rules.
  * A sentence-level **coverage report** shows which requirements are enforced, **partly enforced** (a rule covers part of the sentence) or **not enforced**, and every ambiguity resolves toward "not enforced".
  * A human reviews every drafted rule — confirm, edit or reject — and can add a manual rule for a clause nothing covered. **Nothing is enforced until it is approved**, and approving with uncovered clauses must be acknowledged explicitly.
  * The approved SOP can be attached to agents at approval time.
  * A compilation you don't want can be **discarded** from its review dialog, as long as it hasn't been approved. An approved compilation can't be discarded, because its rules already live on as an SOP.

#### How policy reaches an edge guard

A guard beside the agent or inside a service evaluates the same rules locally, from a **signed policy bundle**:

* `GET /policy/bundle/{did}` returns the agent's evaluable policy, signed by MetaMynd; `GET /magp/policy/pubkey` publishes the verification key, which a guard should **pin**.
* A guard with a pinned key refuses an unsigned, tampered or stale bundle for every action (`POLICY_BUNDLE_UNSIGNED`, `POLICY_BUNDLE_SIGNATURE_INVALID`, `POLICY_BUNDLE_STALE`); without a pin it refuses them for a value-bearing action; and a guard with no pinned key refuses a bundle that arrived over plain `http://` (`POLICY_BUNDLE_UNVERIFIED`).
* Bundles are re-issued at the moment they are served (`issuedAt` is the serve time; the original `compiledAt` and `compiledSignature` travel inside), so `maxStaleness` (default ten minutes) bounds the age of the copy a guard holds.

See [Policy Bundle Pinning & Freshness](https://docs.metamynd.ai/agent-protocol/policy-bundle-pinning-and-freshness) and [Pin the Policy Key](https://docs.metamynd.ai/guides/pin-the-policy-key).


---

# 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/core-concepts/policy-standards-and-sops.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.
