Macro Security And Trust Model

ProtoML macros are still the highest-trust extension surface in the system, but the trust workflow is now formalized so teams can inspect, sign, and classify them without building a heavy PKI layer into every document.

Three separate concepts

ProtoML combines these into one effective trust value instead of mixing the concepts together.

Effective trust levels

Important simplification

Plain HTML by itself is not treated as an automatic trust failure anymore. Macros are HTML-oriented by design, so HTML is only tracked as a capability flag. The hard downgrade conditions are JavaScript and external URLs.

Bundled built-in macros are identified by their real file location and a shipped hash manifest, not just by writing {{macro_dir}} in the document. That prevents newly dropped files in the built-in directory from becoming trusted automatically.

How to read common trust outcomes

Detached signatures instead of inline syntax

Macros and .pml files are signed via detached sidecars such as warning.pml.sig.json. This keeps ProtoML syntax clean and lets the same signing flow work for macros and full documents.

protoparser sign macro "./macros/warn_box.pml" "./keys/alice-private.pem" "Alice" alice-main
protoparser verify macro "./macros/warn_box.pml" -trustRegistry="./my-registry"

Detached sidecars outside a registry

The detached *.sig.json format also works without any registry at all.

Author side:

User side:

Without a registry, signed content can still be verified, but it typically remains unknown rather than trusted.

Registry author model

The registry is used as an author trust directory, not as a sandbox. It can declare authors and their public keys, plus package metadata for discovery.

{
  "version": 1,
  "authors": [
    {
      "name": "Alice",
      "trust": "trusted",
      "keys": [
        {
          "id": "alice-main",
          "public_key": "-----BEGIN PUBLIC KEY----- ..."
        }
      ]
    }
  ]
}

What validation enforces

What was intentionally left out

Those ideas create substantial overhead and unclear semantics. Detached signatures plus author registries give most of the practical value with much less maintenance cost.

Recommended team policy

  1. Keep signed production macros in version-controlled repositories
  2. Publish trusted authors in one internal registry
  3. Run protoparser trust and validate -trust=strict in CI for sensitive documents
  4. Review any macro that contains JavaScript or external URLs manually
  5. Prefer bundled built-in macros for common safe defaults before introducing new custom packs

Related guides