Skip to content

PRÆTORE v0.3.2

Choose a tag to compare

@github-actions github-actions released this 03 Nov 23:11
· 428 commits to main since this release
8b70d56

Post-hoc ingestion of safety actions that executors of AI-enabled systems
already ran (G1, format 2: #92, #94, #95; migrations 0016 to 0018), the
safety namespace manifest (G2), mission safety classes in policies (G7,
policy format 2), HighAssurance receipts in the Claude Code hook example,
the walkthrough demo, and the v0.3.1 follow-ups. GitHub release with
checksums only; nothing is published to crates.io.

Known limitations (planned for v0.3.3)

  • R7: any role of the database can take a tenant's ingestion lock. The
    per-tenant PostgreSQL advisory lock needs no privilege, so a session of
    another tenant's ingester, of the gateway or of any other login can hold
    it and keep that tenant's praetore-safety-ingest from starting (denial
    of service; it cannot read or write the tenant's records). The refusal
    and praetore-safety-ingest doctor name the holding session
    (docs/operations.md, "Deployment").
  • L95-1: a group-writable socket directory. With
    PRAETORE_SAFETY_SOCKET_GROUP the socket's parent directory may be
    writable by that group. A member of the group can then remove or replace
    the socket (executors would report to another process, and those events
    would be lost; it cannot sign records) or entries the ingester creates
    there at startup (which then fails). By replacing the temporary entry
    the ingester binds in (.bind-<pid>) with a symbolic link, a member can
    also make the chmod/chown of that startup apply to another file of the
    ingester's user, for example its signing key (which would then be
    readable by the group). Give the directory the sticky bit (chmod 1770)
    or keep it writable by the ingester's user only (docs/operations.md,
    "Deployment").

Changes

  • Post-hoc safety ingestion: format 2 and hardening (G1 follow-ups, #94,
    #95).
    Changes the G1 format of #92 before its first release; records
    written by an earlier build of main (format 1) cannot be read and must
    be exported and removed first (docs/operations.md, "Source epochs").

    • Format 2: every event signs source_epoch, the source's run (persisted
      by praetore_safety_client::EpochFile, which fails closed instead of
      starting again from 1); source_seq starts at 1 in each epoch and a
      chain is a sequence of segments, one per epoch. Every record of a source
      chain signs high_water and source_epoch; the ingester resumes from
      the last signed record only (SafetyIngestor::resume_heads, replacing
      set_heads; IngestorConfig::heads is removed), and commit now
      returns an error unless the records extend the current head.
    • New rejected reasons seq_jump_too_large, stale_epoch and
      epoch_jump_too_large (bounded by PRAETORE_SAFETY_MAX_SEQ_JUMP and
      PRAETORE_SAFETY_MAX_EPOCH_JUMP, which also bounds a chain's first
      epoch); an
      event far from the ingester's clock carries clock_skew_seconds
      (PRAETORE_SAFETY_MAX_CLOCK_SKEW_SECONDS). A chain head signed by an
      unregistered ingestion key fails closed; previous keys of a rotation are
      listed in PRAETORE_SAFETY_PREVIOUS_INGEST_PINS_FILE.
    • Rate limits per source (spent only by events that can advance the
      chain) and for every other input, replays included
      (PRAETORE_SAFETY_SOURCE_RATE/_BURST,
      PRAETORE_SAFETY_REJECTED_RATE/_BURST), and on Linux a sender user id
      check (PRAETORE_SAFETY_ALLOWED_UIDS, SCM_CREDENTIALS; refused at
      startup on other platforms). What is not recorded one by one is added to
      signed counts on _unattributed (loss reasons rate_limited,
      rejected_suppressed, duplicate, peer_refused). Decision
      change:
      an exact duplicate no longer creates a duplicate record; it
      is counted (a conflict is still recorded, and the verifier still
      accepts duplicate records).
    • Migration 0017_safety_records_followups: the source_epoch column,
      record_id unique per tenant, the columns checked against the signed
      high_water and source_epoch, and the tenant registry
      praetore.safety_ingest_tenants (one login role and one ingestion key
      per tenant, registered by the schema owner). Row-level security on
      safety_records follows the registered role instead of the
      praetore.tenant_id setting, and the insert trigger accepts only
      records naming the tenant's registered key. The ingester and the
      exporter check the registration at startup. A documented manual
      rollback of 0016 to 0018 (docs/rollback/g1-safety-records.sql) is
      tested in CI.
    • Migration 0018_safety_audit_and_role_oids: registrations name the
      login role by OID ('<role>'::regrole), so a role dropped and created
      again with the same name is not registered; the read-only group
      praetore_safety_audit and praetore.safety_audit_tenants let a login
      role export and audit the tenants it is registered for, without write
      access (verify_safety_audit_role_with).
    • PRAETORE_SAFETY_MAX_EPOCH_JUMP bounds the step of source_epoch and a
      chain's first epoch. The ingester binds its socket without changing the
      process umask.
    • praetore journal-export --safety --from-seq N [--limit M] exports a
      chain in ranges, each anchored on the record before it, and
      praetore-verify safety-journal --range [--expected-anchor HEX]
      verifies one. Without --expected-head the verifier now warns
      (head_not_anchored). It reports epochs and dropped_by_reason.
    • Known limitation: the per-tenant advisory lock needs no privilege,
      so any role of the database can hold a tenant's lock and keep its
      ingester from starting (denial of service only). The refusal and
      praetore-safety-ingest doctor name the holding session. A lock that
      only the tenant's registered role can take is planned for v0.3.3.
    • CI runs every ignored PostgreSQL test one by one
      (scripts/postgres-ignored-tests.sh) and every G1 end-to-end test.
  • Walkthrough demo. make demo (or cargo run --locked -p praetore-core --example demo) runs three decisions of a simulated agent (allowed, denied
    by a policy rule, outside its authority), exports the signed receipts as a
    hash-linked chain, verifies it and rejects two altered copies; make demo-verify re-checks the chain with praetore-verify. Demonstration
    configuration only: in-memory replay guard and a fixed freshness lease with
    no revocation source. See docs/DEMO.md. Runs in CI (assurance.yml).

  • Post-hoc safety ingestion (G1, SAF-09.5, #92). Safety actions that an
    executor of an AI-enabled system already ran can be recorded, isolated from
    the decision path. New module praetore_core::safety_ingest:
    SafetyEvent (signed by a SafetySourceKey under
    PRAETORE_SAFETY_EVENT_V1\0: source_id, monotonic source_seq, the raw
    action name, occurred_at by the source clock, optional bounded params,
    post_hoc: true), SafetyRecord (signed by a SafetyIngestKey under
    PRAETORE_SAFETY_RECORD_V1\0, chained per source inside the signed
    payload; statuses accepted, undeclared, invalid_name, duplicate,
    conflict, late, rejected, loss), the SafetyIngestor state machine
    and verify_safety_chain. Key ids use PRAETORE_SAFETY_SOURCE_KEY_V1\0ed25519\0
    and PRAETORE_SAFETY_INGEST_KEY_V1\0ed25519\0. New crate
    praetore-safety-client: one non-blocking Unix datagram per event, no
    retry; on failure the event is dropped and counted locally. New binary
    praetore-safety-ingest (in praetore-cli; run, doctor,
    public-key): its own process, database role and key; verifies the safety
    namespace manifest and refuses any two roles with the same key at
    startup, without a flag; a 0600 (or 0660 with a group) socket in a
    directory it owns; a bounded queue whose overflow, like a database outage,
    becomes a signed loss record; one ingester per tenant (advisory lock);
    graceful shutdown. Migration 0016_safety_records: table
    praetore.safety_records (append-only by trigger, an insert trigger that
    refuses a row that does not extend its chain or whose columns are not its
    signed fields, forced row-level security per tenant) and the NOLOGIN group
    praetore_safety_ingest (USAGE on the schema, SELECT on
    schema_migrations, SELECT, INSERT on safety_records); creating it
    needs CREATEROLE in the migrating role, checked before any migration
    (MigrationError::GroupRoleMissing). verify_safety_ingest_role_with
    checks the ingester's role, and verify_runtime_role now refuses a
    gateway role that can insert safety records
    (RuntimeRoleError::RoleSeparation). New export praetore journal-export --safety --tenant UUID --source ID --ingest-pin HEX_FILE (verifies before
    writing, never overwrites; reads PRAETORE_SAFETY_DATABASE_URL) and new
    verifier command praetore-verify safety-journal --journal JSONL --ingest-pin HEX_FILE [--source-pins JSONL] [--expected-head HEX], which
    checks record signatures, the chain, source_seq continuity (gaps covered
    by loss records), duplicates and conflicts, event signatures and the head,
    and reports the count of each status. Format:
    docs/proposals/safety-ingestion-jsonl.md. New fuzz target
    safety_ingest; new CI job g1-mutation. Transport v1 is local only;
    HTTP with mutual TLS is future work.

  • Safety namespace manifest (G2). New module
    praetore_core::safety_namespace. SafetyActionName::parse is the one
    validator of safety:* names (exact ASCII prefix safety:, printable
    ASCII, a name that starts with an ASCII letter or digit, at most
    MAX_SAFETY_ACTION_NAME_BYTES = 128 bytes), with the typed
    SafetyNameError. Policy::validate uses it for every Safety entry, so
    a Safety entry longer than 128 bytes now fails to load with the new
    ActionClassError::SafetyNameTooLong (G7 accepted up to 1024 bytes).
    SafetyNamespaceManifest (schema version 1) is a signed, canonical JSON
    statement of the Safety names of one format 2 policy, bound to its
    digest, id and version, built deterministically by
    SafetyNamespaceManifest::from_policy. It is signed by a dedicated
    SafetyNamespaceKey (not the attester or issuer key) under the new domain
    PRAETORE_SAFETY_NAMESPACE_V1\0, with key ids under
    PRAETORE_SAFETY_NAMESPACE_KEY_V1\0ed25519\0. verify checks it against a
    pinned key, verify_matches_policy against a policy (digest and exact
    list), and classify_name answers Declared or Undeclared for the
    ingestion path; ensure_distinct_keys refuses the same key in the
    namespace and attester or issuer roles (SameKeyForBothRoles). Only the
    canonical encoding parses (from_json); a manifest file is that document
    and one newline (to_file, from_file). New commands: praetore policy safety-manifest --policy P --key K --output NEW_FILE [--other-pin A]...
    (never overwrites; writes a synced O_TMPFILE or temporary file, links
    it to the output name and checks the linked entry; needs a filesystem
    with hard links; reads the key with O_NOFOLLOW, checks the open
    descriptor and, on macOS, refuses extended ACLs) and praetore-verify safety-manifest --manifest M --pin K [--policy P] [--other-pin A]...,
    both with --format json|text; --other-pin (alias --attester-pin)
    refuses a namespace key equal to an attester or issuer key. The manifest authorizes nothing and is not read on
    the decision path. Golden vector
    docs/golden/safety-namespace-manifest-v1.json; new fuzz target
    safety_namespace.

  • Claude Code hook example: HighAssurance receipts.
    examples/claude-code-hook now evaluates with
    AuthorizationEngine::production (HighAssurance) instead of strict.
    Every receipt it writes, the unclassified DENY included, records the
    engine's signed decision time (decided_at), so praetore-verify evidence --issuer-pins checks the authority and the issuer pin at that instant and
    --require-decision-time accepts it. Intents are signed v2 for the
    audience praetore-claude-hook, valid for 60 s. The replay guard is a
    durable local claim store in the hook state (replay/): one file per
    request, created with create_new (O_CREAT|O_EXCL) and fsynced with
    its directories; on every claim the store must be a real directory owned
    by the current user with no group/other bits and (macOS) no extended ACL
    entries, and the state directory must be owned by the user and not
    group/other-writable; any store error denies without a receipt. The guard
    records each signed request's claim once; it does not deduplicate tool
    calls (each invocation builds a new request). receipts.jsonl is now
    fsynced after each append (and its directory on creation); a claim can
    remain without a receipt when that write fails, and the call is denied.
    Each receipt signs Claude Code's tool_use_id (claude.tool_use_id, a
    string or number up to 128 bytes; a longer one or another JSON type is
    evaluated as unregistered and recorded only as praetore.claim_rejected;
    a missing one is not recorded). The receipts.jsonl line carries an
    unsigned copy only when the receipt signs one; verify and export
    refuse an unsigned copy on a HighAssurance receipt that signs none, and
    export takes it only from the signed context. Unparseable hook input is
    denied with a fixed message that does not quote input values. The guard does not forge receipts and does not
    deduplicate invocations: a re-delivered tool call is evaluated again, and
    the hook's verify warns (without failing) about tool_use_ids signed in
    more than one receipt. An unanalyzable shell command is now denied (rule
    deny-unanalyzable-command, signed receipt) instead of held for approval.
    A DENY with a receipt shows only its reason class (capability, path,
    unregistered, unclassified, unanalyzable_command, use simple commands) and the evidence id, never the rule id or text; a
    RequireApproval message also includes the evidence id.
    Freshness is
    local (60 s lease, no revocation source). init creates replay/; state
    created before this change has none and is refused with a message that
    points to init (same pattern as the SAF-14 check). Profiles and
    per-agent keys (SAF-14), G7 classification and declared Safety tools
    (no decision, no receipt) are unchanged, and so is the receipt format.
    The hook's verify checks the authority at decided_at when a receipt
    records it. verify.sh takes --require-decision-time; demo.sh checks
    that the bundle it regenerates is HighAssurance. The committed bundle/
    and sets 03, 04 and 05 are unchanged and verify as before (they fail
    --require-decision-time, as expected). evidence/VERIFY.md section 7
    describes how to record new sets 04 and 05 with this hook. The G7 hook
    mutant (scripts/g7-mutants/hook.patch) is rebased onto the new code.

  • Claude Code hook example: no subagent profile gets process:execute by
    default
    (GHSA-wg33-3h8v-xvqw). The hook sees a command's text, not what
    it does when it runs, so Bash under process:execute is equivalent to
    every other capability; the README now says so, and that the .claude/
    write rule for subagents holds for Write/Edit only. coder loses
    process:execute in PROFILES (the main session keeps it) and
    agents/coder.md no longer lists Bash. State written by an earlier
    init keeps what it was issued; the README documents re-running init
    into a new directory. As defense in depth, not a boundary, the Bash scan
    now also flags an analyzable command whose words name <root>/.claude or
    <root>/.git, a path outside the project root, or a common network tool,
    and the default policy holds each for approval
    (approval-command-touches-protected-path, approval-command-leaves-root,
    approval-command-uses-network). init writes the root to
    project-root in the state directory. The README documents running
    Bash under Claude Code's sandbox. Receipt format unchanged; committed
    evidence not regenerated (bundle/ predates the change).

  • Claude Code hook example: client configuration is protected from
    subagent writes
    (GHSA-wg33-3h8v-xvqw). Writes to the project paths Claude
    Code lists as protected in its permission modes (.mcp.json, .vscode/,
    .cargo/, .husky/, .envrc, shell startup files, and the rest of that
    list) are denied to every profile except main
    (deny-subagent-client-config-writes), and main needs approval
    (approval-main-client-config-writes); the Bash scan flags the same
    paths. The hook also denies commands (claude:exec) to every profile
    except main whatever its authority grants, warns on stderr about state
    without project-root or with a subagent holding process:execute, fails
    closed on an invalid project-root, and maps Monitor and PowerShell to
    claude:exec (PowerShell is never analyzed, so main needs approval).
    The format-1 policy error now recommends a fresh init.

  • Claude Code hook example: protected names compared after Unicode
    folding; writes to them reserved to main in the binary

    (GHSA-wg33-3h8v-xvqw). Path components are compared after dropping
    default-ignorable code points, NFKC and full case folding (caseless,
    unicode-normalization, the versions praetore-mcp uses), and for every
    profile except main a write to a non-ASCII component that starts with
    . or whose folded form differs from its ASCII lowercase form is denied
    (main needs approval). A write that would complete a bare git repository
    (HEAD, config, objects, refs) is held the same way. The hook now
    denies, whatever the policy says, a write by a profile other than main
    to client configuration, .claude, .git or a path that failed its
    check, evaluated as unregistered with a signed receipt; without
    project-root every such write is denied. An agent_id without an
    agent_type is evaluated as unregistered, the governance rules name
    every profile except main, and a write tool without its path parameter
    is denied.

  • Claude Code hook example: guard denials name the guard in the signed
    receipt.
    A denial by the hook's exec or write guard records
    praetore.hook_guard (exec_reserved_to_main, client_config_write,
    governance_write, path_check_failed, no_project_root) and
    praetore.requested_profile in the signed context; check-attribution.py
    (run by verify.sh) requires them together on a Deny signed as
    unregistered and counts them apart, and test-attribution.sh checks
    them. A non-ASCII name now counts as a possible alias only if it starts
    with . or folds to ASCII, so ordinary non-ASCII file names are writable
    again; commondir and gitdir join the bare-repository names; a write
    without its path parameter says so instead of naming a path rule.

  • Claude Code hook example: guard denials and state warnings with
    HighAssurance receipts.
    A denial by the hook's exec or write guard shows
    the reason class derived from the signed praetore.hook_guard
    (exec_reserved_to_main is capability; the write guards are path),
    and verify checks the guard claims like check-attribution.py. The
    state warnings also reach the user as systemMessage. PowerShell and a
    Monitor without a command are unanalyzable, so they are denied like any
    unanalyzable command.

  • Breaking (API, G7): AuthorizationRequest.action is a MissionAction.
    praetore-core separates mission actions, which PRÆTORE decides, from
    safety actions, which the executor of an AI-enabled system runs without
    waiting for PRÆTORE (for example safety:halt, safety:stop_all). The new
    types MissionAction and SafetyAction are built only by
    Policy::classify(action) -> Result<ClassifiedAction>, and
    AuthorizationRequest::new takes a MissionAction, so a safety action
    cannot be put in a request (compile error E0308, checked by a
    compile_fail doc test). AuthorizationEngine::evaluate keeps its
    signature and re-checks the class against its own policy.
    Policy::evaluate / evaluate_with_context take a &MissionAction.
    AuthorizationRequest no longer implements Deserialize:
    AuthorizationRequest::from_json(json, &policy) classifies the action
    first and returns SafetyActionNotGoverned or UnclassifiedAction.
    New typed errors: PraetoreError::SafetyActionNotGoverned
    (SAFETY_ACTION_NOT_GOVERNED), UnclassifiedAction
    (UNCLASSIFIED_ACTION), PolicyFormatUnsupported and
    PolicyActionClassInvalid(ActionClassError).
    verify_journal takes an Option<&RecordedPolicy>.

  • Breaking (policy format 2, G7). A policy needs "format_version": 2
    and an action_classes table ("Mission" or "Safety" per exact
    action_type). Policy::validate rejects, with typed errors: a rule on an
    undeclared action type, a safety: type not declared Safety (and a
    Safety entry without the prefix), an unprefixed name that contains
    safety (ASCII, any case), and any rule that targets a Safety action
    (this replaces the external lint proposed in SAF-09). Mission action types
    need no prefix. A format 1 document (no format_version) is rejected for
    evaluation in every mode (PolicyFormatUnsupported { found: 1 }).
    Digests of migrated policies change; the receipt format does not.

  • Historical verification keeps working. RecordedPolicy::from_json
    reads format 1 and 2 documents and computes the digest they had; it
    cannot be evaluated. praetore-verify evidence|journal --policy and
    policy-digest (which now also prints policy_format_version) use it,
    as does the hook's verify. The committed evidence sets (hook bundle/,
    sets 03, 04 and 05, examples/verify/,
    examples/third-party-verification/bundle/) are unchanged and verify
    against their recorded format 1 documents; docs/golden/canonical-policy-v1.json
    keeps its digest and canonical-policy-v2.json is added.

  • Entry points classify first (G7). A declared Safety action gets no
    decision: the gateway HTTP API answers 422 safety_action_not_governed,
    the praetore-mcp gate forwards it to the wrapped server without a
    receipt (enforce and observe), and the Claude Code hook adds no decision;
    nothing is evaluated, signed, claimed or journaled. An action type the
    policy does not declare is refused at every entry point with a signed
    DENY receipt
    : the new AuthorizationEngine::refuse_unclassified (and
    refuse_unclassified_with_atomic_commit) takes an
    AuthorizationRequest<UnclassifiedAction> (built only from
    Policy::unclassified), verifies it exactly like a mission request
    (identity, authority, issuer pin, intent signature and, in HighAssurance,
    intent window, freshness and replay claim), never evaluates policy rules,
    and records Deny with reason unclassified and
    decided_by: {"kind": "engine_guard", "guard": "unclassified_action"} (an
    existing decided_by kind; verifiers that read engine guards accept it).
    It is journaled and claimed like a policy DENY. A forged or
    unauthenticated request gets no receipt. praetore-mcp refuses it in both
    modes; the hook appends it to receipts.jsonl. An unreadable policy.json still refuses every tool call,
    safety:* included (documented in docs/threat-model.md).

  • Breaking (gateway API behaviour change). Every DENY from
    POST /v1/execute now returns 403 with one body,
    {"code": "authorization_denied", "authorization": "denied", "execution": "not_dispatched", "evidence_id": ..., "request_id": ...}, instead of the
    signed receipt, whatever decided it (a rule, an engine guard or an
    undeclared action type), so a DENY response does not reveal what the
    policy declares or which rule matched (REQUIRE_APPROVAL responses still
    carry the receipt and the rule). The receipt, with its reason, is in the
    execution journal (praetore journal-export). The 422
    unclassified_action response is removed. Likewise, praetore-mcp
    answers every DENY with Denied by PRÆTORE. Evidence id: ... (the rule
    and reason go to stderr) and the hook answers every DENY that has a
    receipt with PRÆTORE denied this tool call (evidence ...) (details on
    stderr). Response timing is not made uniform.

  • Gateway: the reserved safety: prefix decides before classification.
    POST /v1/execute answers every action type that starts with safety:
    with the same 422 safety_action_not_governed (same body, headers and
    code path), declared Safety or not, before any verification, engine,
    journal or signing work. An undeclared safety:* gets no receipt at the
    gateway. Every request at this gate writes the same unsigned WARN line
    (claimed agent id and action type, bounded and escaped, and
    declared=true|false), so the answer cannot be used to enumerate the
    table; the remaining timing difference is a documented limit. SAFETY:x
    (not the exact prefix) goes through the unclassified path and gets a
    signed DENY when the request is authenticated. praetore-mcp and the hook keep the signed unclassified
    DENY for it.

  • Human-facing text escapes characters that render invisibly or reorder text
    (zero-width, bidi, control) as \u{XXXX}: praetore-verify --format text
    (which now also reports receipt_action_type, receipt_tool,
    receipt_decision and receipt_decided_by), praetore-mcp tables and
    stderr, the hook's stderr, and the gateway's WARN line (praetore_core::display). JSON
    output and receipts stay exact. UNCLASSIFIED_DENY_REASON and
    UNCLASSIFIED_ACTION_GUARD are public constants in praetore-core.

  • Breaking (behaviour change, praetore-mcp observe mode). A call whose
    action type the policy does not declare (UNCLASSIFIED_ACTION) is now
    refused in observe mode too, not forwarded: an undeclared safety:*, any
    tool name that starts with safety in any ASCII case and is not exactly a
    declared Safety action (including names with a trailing space or tab, and
    ambiguous lines), and also every mission call when the policy does not
    declare mcp.tools/call. praetore-mcp init declares mcp.tools/call,
    so new homes are not affected. A JSON-RPC batch stays all or nothing in
    enforce, so a declared Safety call in a batch with a blocked call is not
    forwarded; send safety calls on their own. Runtime tests per entry point
    check zero engine calls and zero journal writes, with the journal down,
    in under 100 ms (crates/praetore-gateway/tests/safety_actions.rs, the
    g7_ tests in crates/praetore-mcp/src/gate.rs,
    examples/claude-code-hook/src/tests_g7.rs, and the PostgreSQL test
    postgres_g7_safety_action_is_refused_before_the_engine_with_the_journal_down).
    scripts/g7-mutation-test.sh shows they fail when classify is removed.
    Mission actions take the unchanged path: synchronous signing, fail closed.
    Recording safety actions (SAF-09.5, isolated ingestion) is not
    implemented.

  • praetore policy classify --policy <path> proposes an action_classes
    table for a policy and lists what prevents loading it as format 2. It
    never writes files. praetore-core gains a test-probe feature (off by
    default, enabled only from dev-dependencies) that counts engine calls for
    tests.

  • Shipped policies are format 2: praetore-mcp init, the hook's init,
    praetore init and crates/praetore-cli/examples/policies/*.json.

    Migration guide. Migrate the policy to format 2 before upgrading the
    binary.
    After the upgrade a format 1 policy no longer loads, so hook or
    praetore-mcp state written before G7 refuses every tool call (fail
    closed, safety:* included) until its policy is migrated; the gateway
    service does not start.

    # before (format 1)
    {"id":"p","version":3,"canonical_version":1,"semantics_version":2,"rules":[
      {"id":"w","action_type":"fs:write_file","effect":"Allow", ...}]}
    
    # after (format 2)
    {"format_version":2,"id":"p","version":3,"canonical_version":1,"semantics_version":2,
     "action_classes":{"fs:write_file":"Mission","safety:halt":"Safety"},
     "rules":[{"id":"w","action_type":"fs:write_file","effect":"Allow", ...}]}
    
    1. Before upgrading, run praetore policy classify --policy policy.json
      (or add the fields by hand) and add the printed
      format_version and action_classes to the document.
    2. Rename any action the executor runs without waiting for PRÆTORE to
      safety:<name>, declare it Safety and remove every rule on it.
    3. Rust callers: let action = policy.classify(action)?.into_mission()?;
      before AuthorizationRequest::new, AuthorizationRequest::from_json(json, &policy), Policy::new(..).with_mission_actions([..]) /
      .with_action_class(..).
    4. praetore-mcp homes: make sure action_classes declares
      "mcp.tools/call": "Mission", otherwise every call is refused, in
      observe too.
    5. Pin the new digest (HighAssurance policy_digest). Keep the format 1
      document: receipts that recorded its digest verify only against it
      (praetore-verify --policy old-policy.json).
  • Journal export across an attester key rotation (v0.3.2 follow-up
    B5-5).
    praetore journal-export and praetore-verify journal accept
    --attester-pin more than once (up to 16 keys); each receipt and storage
    record is checked against the pinned key its key id names, and nothing is
    re-signed. A database adopted with a retired key exports and verifies
    again with the retired and the current pin; with only the current pin the
    export fails and names the key that signed the adoption record. New
    library API: ChainExporter::with_attesters and
    journal_chain::verify_journal_with_attesters; export,
    export_with_database_head and export_storage_records of the CLI take
    a slice of keys.

  • praetore-verify journal --policy on a database chain fails (B5-4)
    with INVALID_REQUEST (ChainError::PolicyNotApplicable) instead of
    reporting policy_verified: true with nothing compared. Breaking
    (API):
    new ChainError variant.

  • Extension objects in praetore are refused (B5-1). The runtime check
    (RuntimeRoleError::ExtensionObjects) and the migration runner
    (UnsafeDatabase) refuse an extension installed in praetore and any
    praetore object that belongs to an extension, which a role with CREATE
    on the database can install since PostgreSQL 13. Breaking (API): new
    RuntimeRoleError variants.

  • PRAETORE_SCHEMA_OWNER (B5-2). Optional exact role name of the
    praetore schema owner. When set, the runtime check
    (RuntimeRoleError::UnexpectedSchemaOwner) and migrating refuse another
    owner (and, before the schema exists, another migrating role). Read by the
    gateway, the CLI and praetore-observe; the gateway warns while it is
    unset. Set it in every deployment. New RuntimeRoleOptions::with_schema_owner
    and MigrationOptions::schema_owner (a new public field).

  • Docs (B5-3). docs/operations.md now says that an allowlisted event
    trigger runs with the privileges of the role executing the migration DDL
    (unless its function is SECURITY DEFINER), as a test records, not with its
    function owner's.

  • praetore run, praetore-gateway-demo and praetore-observe report a
    port in use
    with exit status 1 and the bind error, instead of aborting
    (SIGABRT or a panic) while they dropped their blocking PostgreSQL clients
    on the async runtime thread. The services bind before the state moves into
    the runtime, and the runtime is dropped before the last reference.

  • DEPENDS ON EXTENSION marks on praetore objects are refused by the
    runtime check and the migration runner, like extension members: DROP EXTENSION ... CASCADE by the extension's owner would drop the marked
    object (for example an append-only trigger function).

  • PRAETORE_SCHEMA_OWNER with a NOLOGIN owner group. With no schema yet,
    a migrating role that is a member of the named NOLOGIN group creates
    praetore owned by the group and runs the migrations as it; any other
    named role is refused before anything is created. The installation order
    is in docs/operations.md. The CLI and praetore-observe now warn, like
    the gateway, while the variable is unset. Before anything is created, a
    typed MigrationError::SchemaOwner (SchemaOwnerProblem) refuses a
    membership without SET or INHERIT (or a NOINHERIT migrating role), a
    predefined pg_* role, the bootstrap superuser for a new schema, and a
    missing CREATE privilege on the database; MigrationError:: RuntimeGroupMissing refuses, before migration 0001, when
    praetore_runtime does not exist and the role running the migrations has
    no CREATEROLE. The owner is checked again inside the transaction that
    creates or adopts the schema. verify_runtime_role refuses a pg_*
    value as a configuration error. Breaking (API): new MigrationError
    variants.

  • praetore-verify journal reports attester_key_ids (entries per
    signing key id), and a receipt signed by a key that is not pinned fails
    with AUTH_FAIL naming that key id (ChainError::UnpinnedAttesterKey).
    New journal_chain::verify_journal_report and JournalReport. With
    --database-journal, database_attester_key_ids reports that file's
    signers.

  • Tests (B5-6 and an intermittent CI failure). The full ignored
    PostgreSQL suite runs in parallel: the fault-injection test runs in its own
    scratch database, and cluster-wide grants of pg_read_all_data /
    pg_write_all_data are serialized with every runtime-role check.
    postgres_cli_journal_export_tenant_end_to_end no longer picks two ports
    that can coincide, and waits for a gateway that accepts its own token
    rather than any answer to /healthz (two gateways on one port made
    praetore demo get 401 authentication_required).