Skip to content

Releases

PRÆTORE v0.3.6

Choose a tag to compare

@github-actions github-actions released this 16 Nov 23:47
27ceddb

Added

  • praetore-mcp: a report of each wrap session. When a session ends
    (the client or the server closes, or SIGINT/SIGTERM on macOS and Linux)
    and it recorded at least one receipt, wrap writes
    DIR/reports/session-<start UTC>-<id>.json and .pdf. The JSON has a
    header (praetore-mcp version, agent, server, mode, seq range, the heads
    of the receipts and approval journals at close, the result of verify)
    and the session's receipts, each one the journal line copied byte for
    byte. The PDF shows the same session for a person: PRÆTOR TECHNOLOGIES
    wordmark, local time with UTC next to it, summary (ALLOW, DENY, held,
    approved, expired), the calls (time, tool, decision, rule, short reason),
    the approvals with the approver key id and time, the result of verify,
    both heads and the SHA-256 of the JSON. If verify fails the first page
    says VERIFY FAILED and both files are still written. The report is a
    view: it signs nothing and does not change the journal; if it cannot be
    written the reason goes to stderr and the exit code and every decision
    stay the same. wrap --no-report and report = false in
    DIR/config.toml (new, optional file) turn it off.
    praetore-mcp report [--dir DIR] [--session ID | --last] writes a new
    report of a session from the journal as it is now (exit code 1 if it
    says verify failed): a new pair,
    session-<start UTC>-<id>.regen-<now UTC>.json and .pdf, next to the
    original, with regenerated_from in its header. The report written at
    close is never replaced. The session's approval records are copied from
    the approval journal byte for byte; if it cannot be read, the header and
    the PDF say so. The PDF is written in Rust with pdf-writer (MIT OR
    Apache-2.0; adds no other crate to the lockfile), with no network access
    and no external process.
  • praetore-mcp: session reports in the dashboard. A new Sessions view
    (Spanish, English, Portuguese) lists the reports in DIR/reports/, newest
    first: session id, agent, server, mode, open and close time (local and
    UTC), the decisions and, apart, the approval statuses, the result of
    verify, and buttons to download the PDF and the JSON (with the JSON's
    SHA-256). The pairs report wrote later are grouped under the report they
    came from. GET /reports/<file> serves a file only when its name is
    exactly a report file name, it opens without following a symlink as a
    regular file with a single link, owned by the dashboard's user, its real
    path is in DIR/reports/ and its content is a report (a JSON with the
    report schema; a PDF that starts with %PDF and whose JSON passes the
    same checks); anything else gets 404, a file over 64 MiB 413 (not read),
    any method but GET 405. While the
    page is open, a new session shows up on the next refresh with a "Report
    ready" notice. At close, wrap prints, after the report path, the
    command that starts the dashboard on the home with --port 8787
    (absolute and quoted) and the link http://127.0.0.1:8787/#/sessions/<id>,
    saying that on another port the page is #/sessions/<id> there. In the
    approval history and in the Live list, an approved or rejected call
    shows the time of the person's decision from the approval journal
    (approval_decided_at on the held rows of /api/state), noted as such.
    The Sessions view lists a file only when GET /reports/ serves it. The Live caption says how many rows
    it shows and since when. The dashboard still
    writes nothing: it does not write, regenerate or sign a report. The view
    signs nothing, does not prove that a person reviewed a session, and is
    tamper-evident only against an external copy of the heads.

Changed

  • praetore-mcp: the dashboard refuses a request whose Origin is not
    its own
    (http://127.0.0.1:PORT or http://localhost:PORT), with 403,
    on top of the Host check.

  • praetore-mcp: the report header names the build. praetore_mcp_version
    (JSON) and the PDF header are the version for a release build and
    <version>-dev+<short commit> (or <version>-dev) for any other build.
    A release build is only one whose commit carries the exact tag
    v<crate version>, or one built with PRAETORE_MCP_RELEASE=1. The
    commit comes from git only when the repository found is this one;
    otherwise from PRAETORE_MCP_BUILD_COMMIT, or none. praetore-mcp --version prints the same build version. CI fails a tag that is not
    v<crate version>, a tag build that does not print exactly
    praetore-mcp <crate version>, any other build that does not print
    exactly praetore-mcp <crate version>-dev+<commit>, and a binary that
    cannot run on the runner (Rosetta 2 is installed for x86_64 on Apple
    silicon). The end-to-end smoke test compares --version with the crate
    version (cargo metadata, or --expect-version), prereleases included.

  • praetore-mcp: the decision tiles of the report PDF are two fixed rows.
    The first counts decisions, one per call, from the receipts (ALLOW, DENY,
    HELD, FORWARDED, WOULD ASK); the second, labeled apart, counts the
    approval status of the held calls (APPROVED, REJECTED, PENDING,
    EXPIRED). Every tile is shown, 0 included, so HELD and PENDING no longer
    read as two events of the same call.

  • praetore-mcp: with reports on, wrap writes the report before it ends
    by SIGINT or SIGTERM (macOS and Linux).
    Before, the signal ended wrap
    at once. Now, when the session report is on, wrap waits up to 300 ms
    for the server to end, forwards the signal to it, waits up to 2 s more,
    kills it if it is still running, writes the report, and then ends by that
    same signal, so the parent still sees wrap terminated by SIGINT or
    SIGTERM, as in 0.3.5. A second signal ends it at once without the report.
    With --no-report or report = false no handler is installed and the
    signal ends wrap at once, as in 0.3.5. A signal that was ignored when
    wrap started stays ignored.

Fixed

  • praetore-mcp: an approval that expired undecided reads Expired.
    Before, the dashboard's Live view showed such a call as waiting for a
    decision while "To decide" listed nothing. The server now labels a held
    call nobody decided expired once its expires_at has passed (or
    cannot be read, as for approve), and lists to decide only the calls it
    labels pending, from the same map. The drawing, the Live list, the
    approval history and the drawer show Vencida / Expired / Vencida, and
    praetore-mcp receipts shows expired. The session report uses the same
    rule, so a pending call whose expires_at cannot be read is Expired
    there too (before, it stayed Pending), and so do approve, reject and
    holding the same call again. praetore-mcp approvals prints
    expired: run the agent again so the call is held again for such a call
    in place of its approve and reject commands. The journal and the
    signed receipts are unchanged.

  • praetore-mcp: printed commands run when the binary is not on PATH.
    The approve and reject commands in the tool error of a held call, in
    approvals and in the dashboard, and the commands that init (its
    allow-all warning included), policy check, policy allow,
    policy coverage and the not-initialized errors print, start with the
    absolute path of the running binary (std::env::current_exe,
    canonicalized, so a symlink such as ~/.local/bin/praetore-mcp prints
    the file it points to) and always pass --dir as an absolute path, also
    for the default home, both single-quoted for a POSIX shell (' written
    as '\''). The not-initialized notes of install still say
    praetore-mcp init. Before, they started with
    praetore-mcp, and a binary extracted to a folder off PATH answered
    "command not found". If the binary's path cannot be read the commands
    start with praetore-mcp, as before. The dashboard shows and copies the
    strings the server sends, unchanged. On Windows nothing changes.

  • praetore-mcp: approval expiry is shown in local time, with what is
    left.
    approvals, approve and the dashboard show the expiry in local
    time with UTC beside it and the time left (in 9 min 40 s); the tool
    error of a held call adds that line after Expires (UTC). After an
    approval, approve prints the time to retry before. approve on an
    expired call says so before it asks for the confirmation code
    (this approval expired at HH:MM (local time) / HH:MM UTC; run the agent again so the call is held again) and signs nothing; its exit code stays
    2. The dashboard marks an approval that expired before any retry ran as
    expired, apart from one that was approved and executed (receipts shows
    approve by KEY, expired unused or approve by KEY, executed once).
    Approval is unchanged: bound to the exact call, single use, the same
    TTL, decided only in a terminal; the dashboard stays read-only.

  • praetore-mcp: a decided approval id is not handed out again after a
    crash.
    approve and reject append the decision to the approval
    journal and then remove the pending file. If the process stopped between
    the two, holding the same call again reused the decided id, so a
    rejected call stayed held under it until it expired. A pending file
    whose id already has a decision is now removed and the call is held with
    a new id. A rejected id still never runs, and an approved id runs at
    most once.

  • praetore-mcp: the report PDF says 1 RECEIPT for a session with one
    receipt (it said 1 RECEIPTS).

Internal

  • praetore-mcp: clippy keeps Expiry::at for display only, a test refuses
    an allow of that lint anywhere in the crate, and new tests cover a
    signal while the report is written and the fixes above.

PRÆTORE v0.3.5

Choose a tag to compare

@github-actions github-actions released this 15 Nov 23:17
b6d668a

praetore-mcp: init writes a default-deny policy (no
allow-all-mcp-tool-calls), policy coverage reports what the policy
decides for each tool a server lists, and dashboard serves a read-only
local page over the receipts journal. Also carries everything merged to
main since v0.3.4, including the dashboard minors and latency tests that
tolerate a loaded machine from #175.

Changed

  • praetore-mcp: init writes a default-deny policy (behavior change for
    enforce mode).
    The policy has no rules. Before, it had
    allow-all-mcp-tool-calls, which allowed every tools/call that no other
    rule matched, so DENY rules that named tools left every other tool
    allowed: with DENY rules per tool, copy_file and append_file of
    @modelcontextprotocol/server-filesystem@2.3.0 were allowed because no
    rule named them. Now, in enforce mode, every tools/call that no rule
    allows is denied; allow tools with
    praetore-mcp policy allow --id ID --server NAME --tool NAME. No rule is
    needed to start a server: only tools/call is evaluated, so
    initialize, tools/list and the rest of the MCP traffic pass. Observe
    mode is unchanged and never blocks. Existing homes keep their policy:
    init on a home that has an allow-all rule leaves it in place and prints
    a warning with praetore-mcp policy remove --id allow-all-mcp-tool-calls.
    Not in v0.3.4: init in that release still writes
    allow-all-mcp-tool-calls (#167). The GUIDE records that fact and how
    to remove the rule from a home created by that release (#168).
  • praetore-mcp: policy check warns about allow-all next to tool
    rules.
    When the policy has an allow-all rule and DENY or
    REQUIRE_APPROVAL rules for specific tools, it says that tools those rules
    do not name are allowed and suggests policy coverage. policy deny,
    require-approval and allow print the same warning after the change
    (#167).

Added

  • praetore-mcp dashboard [--dir DIR] [--port N] [--expected-head HEX].
    A read-only local page over receipts/*.jsonl, served on 127.0.0.1 only
    (default port 8787, 0 picks a free one). Any other address is refused.
    The page shows a summary (total, ALLOW, DENY, active policy id, version
    and digest, and a warning when an allow-all rule meets enforce receipts),
    the decisions table (local time and UTC, server, tool, arguments,
    decision, rule or default deny, mode, evidence id) with filters, and
    each receipt's full JSON, path_check and agent, attester and authority
    signatures with their key ids. The verification status, per receipt and
    for the journal, with seq/prev and the journal head, comes from the code
    behind praetore-mcp verify. To share it, verify's per-receipt check
    is split into one result per check (receipts::check_evidence). verify
    prints the same output as before. HTML, CSS and JS are embedded in the
    binary. Nothing is loaded from the network or written under DIR. Only
    GET requests with a loopback Host are answered. Texts in Spanish,
    English and Portuguese. The table shows 100 receipts per page, newest
    first; the filters (decision, tool, time range, text) run on the server
    over the whole journal. The verification result is kept in memory until
    a file verify reads changes, so a reload of an unchanged 10,000-receipt
    journal does not run verify again (#166).
  • praetore-mcp dashboard: home, live, chain and information views. The
    page opens on a home view with the agent, the servers, the mode, the
    verification result and the ALLOW, DENY and pending counts. The live view
    draws the newest receipts: an allowed call reaches its box, a denied one
    stops at a red bar that shows the rule id, default deny or the engine
    check, and a call waiting for approval stops at an amber bar marked as an
    unsigned notice that verify does not check. The chain view draws the
    receipts in seq order joined by the prev hash link and shows the link
    cut, with the reason, where verify fails. Opening a receipt shows its
    tool, arguments, rule, mode, local time and UTC, evidence id, seq, prev
    and its verify result. The live view marks a receipt that verify
    rejects, with the reason, and moves only when a receipt arrives, the
    verify result changes or the pending calls change. Live and chain each
    have a text list view with the same content, and nothing moves when the
    system asks for reduced motion. The drawings use a 2D canvas and code
    embedded in the binary; the page keeps the same Content-Security-Policy
    and loads nothing from the network. The page now uses one dark color
    scheme (#172, #173).
  • praetore-mcp: policy coverage [--dir DIR] [--server NAME] -- <command> [args...]. Starts the MCP server, sends initialize and tools/list
    (every page), closes it, and prints for each tool what the policy
    decides: the rule that applies or default deny, and whether a rule
    depends on an argument. Tools allowed only by an allow-all rule are
    listed apart. Exit code 0 when there are none, 1 when there is one, 2 on a
    usage error or when the server cannot be started or does not answer. It
    sends no tools/call and writes nothing under DIR. For each tool
    denied because no rule names it, it prints the
    praetore-mcp policy allow --id ... --server ... --tool ... line that
    allows it, quoted to run as printed in a POSIX shell. Tools with a rule
    that depends on an argument get no line, and neither do tool names with
    characters outside A-Z a-z 0-9 _ - . (#167, #170).
  • Commands that praetore-mcp prints with --dir DIR quote DIR when it
    has spaces or other characters a shell would interpret.
  • scripts/mcp-smoke.py checks policy coverage against
    @modelcontextprotocol/server-filesystem@2.3.0, and the smoke test now
    allows read_text_file with an explicit rule.

Fixed

  • praetore-mcp dashboard: the live view writes the whole reason verify
    gives for a rejected receipt, over up to three lines, and says when a
    longer one continues in the receipt detail. It was clipped (#175).
  • praetore-mcp dashboard: /favicon.ico is answered with 204 instead of
    404, so the browser console shows no error. Only GET on loopback, as for
    the other paths (#175).
  • praetore-safety-client: the non-blocking latency tests no longer fail on
    a loaded machine; a slow send still fails them (#175).
  • console: keep the operator language chosen during the first catalog
    load.
    If the operator changed language while that catalog request was
    still in flight, the first load could overwrite the choice and put the
    page back in Spanish (#161).
  • console: the package language test builds every download at one fixed
    instant
    , so the byte-for-byte comparison no longer fails when two
    builds straddle a second (#171).

PRÆTORE v0.3.4

Choose a tag to compare

@github-actions github-actions released this 14 Nov 02:59
a606c11

Adds local approval to praetore-mcp: in enforce mode a REQUIRE_APPROVAL
rule holds the call until someone approves or rejects it from a terminal on
the same machine. Also carries everything merged to main since v0.3.3.

Added

  • praetore-mcp 0.3.4: local approval for REQUIRE_APPROVAL. In enforce
    mode a matching tools/call is not forwarded. The proxy writes a pending
    file under the praetore-mcp home and returns the approval id plus the
    exact praetore-mcp approve <id> --dir <home> command. approvals lists
    pending calls, approve and reject sign the decision with a new local
    approver key (init creates it; running init again adds it to an
    existing home and does not replace keys or receipts). approve reads a
    confirmation code from an interactive terminal. That check is cooperative.
    An approval is bound to the server, tool and canonical arguments, expires
    (default 10 minutes, PRAETORE_MCP_APPROVAL_TTL_SECONDS or
    approvals/ttl-seconds), and authorizes one later matching call. The
    decision and that execution are appended to approvals/journal.jsonl.
    verify checks the approver signature, the binding, the expiry and that
    the approval was not used twice. receipts shows the state. Observe mode
    still forwards, and the receipt list says enforce would ask. Receipt
    lines in receipts/*.jsonl are unchanged, so journals written by v0.3.3
    and by current main keep verifying.

Breaking

  • The console's JSON API sends codes and UTC instants instead of Spanish
    text.
    situacion, relato, aviso, mensaje and nota are stable
    English snake_case codes ("awaiting_approval",
    {"codigo": "request_gone"}, {"codigo": "inbox_truncated", "limite": 200});
    queria and sobre are {"texto": ...} or {"codigo": "not_shown"};
    agente is {"nombre": ...} or {"numero": N}. Times are RFC 3339 UTC
    in cuando_utc, actualizado_utc, pedida_utc and vale_hasta_utc;
    cuando, actualizado, pedida, vale_hasta and queda are gone (the
    page counts the time left itself). The history filter takes the code and
    still accepts the earlier Spanish phrase. An unused attester pin is now
    named by its number ("La clave n.º 2 …") instead of an ordinal word.
    Action: a script that read the console's API compares codes instead of
    phrases. Nothing signed, recorded or exported changes.

  • praetore-gateway-demo requires PRAETORE_GATEWAY_ADAPTER (T-016).
    The service no longer falls back to local-demo when the variable is
    missing or empty: it exits before it connects to PostgreSQL and names the
    three values (sandbox, http, local-demo). Action: set the adapter
    explicitly, including local-demo for local runs (docs/operations.md).

  • Gateway attester keys are read from owner-only files (T-016).
    PRAETORE_GATEWAY_EVIDENCE_ATTESTER_KEY_FILE and
    PRAETORE_GATEWAY_EXECUTION_ATTESTER_KEY_FILE name two files with 64
    lowercase hexadecimal characters each, checked like the safety namespace
    key (regular file, not a symlink, owned by the service user, no group or
    other bits, at most 128 bytes). The two keys must differ. The
    ..._KEY_HEX variables are no longer read; the service refuses to start
    while either is set. Execution receipts carry the key id
    execution-attester-<public key hex> instead of the earlier prefixed id.
    Legacy baseline adoption reads the evidence key from the same file
    variable. Action: move each key into its own file and remove the
    ..._KEY_HEX variables.

  • praetore-observe requires its read-only role (T-016). At startup it
    checks that PRAETORE_OBSERVE_DATABASE_URL logs in as praetore_observe
    or as a member of it, is not a member of praetore_runtime,
    praetore_safety_ingest or praetore_safety_audit, and holds no
    privilege beyond the documented column SELECT grant
    (docs/observability-mvp.md). New
    praetore_replay_postgres::verify_observe_role_with. No migration creates
    the role. Action: run observe with the documented role instead of the
    gateway runtime credential.

  • praetore-verify journal renames database_head_verified to
    database_head_consistent (T-016).
    The field means that the tenant
    chain's reference matches the database head given by --database-journal
    or --expected-database-head. The new database_head_anchored is true
    only with --expected-database-head, a head the caller holds; the head
    of a --database-journal file is not anchored by that file. Action:
    scripts that read database_head_verified read database_head_consistent,
    and check database_head_anchored where an anchored database head is
    required.

  • A journal chain holds the receipts of one tenant (T-016). praetore-verify journal and praetore journal-export refuse a chain whose receipts name
    different tenants in their signed authority, or a tenant and none
    (JOURNAL_TENANT_MISMATCH). The verifier reports the chain's tenant as
    tenant_id (null for a database chain, or when the receipts name
    none). Exports written by journal-export --tenant hold one tenant and
    are not affected.

  • Storage record signatures must be lowercase hex (T-016). A storage
    record whose signature is written in uppercase or mixed-case hex is
    refused (EVIDENCE_FAIL), as receipts and safety records already were.
    praetore only ever wrote lowercase.

  • Cooperative execution is refused by default (T-013). The local HTTP
    API (praetore run) and praetore-gateway-demo, with every adapter and
    with or without sandbox_root, require praetore-exec-mode: gateway on
    every execution-path request and never answer approved on /status
    for an approved action. Before, this applied only with sandbox_root, and
    praetore-gateway-demo never applied it. http_api::HttpOptions now has
    exec_mode: ExecMode instead of gateway_executes_effects: bool. Action:
    clients send the header (the praetore CLI already does). Development
    only, with no guarantee about who performs an effect:
    praetore init --dev-cooperative-exec or
    PRAETORE_GATEWAY_DEV_COOPERATIVE_EXEC=1 (local-demo adapter).

  • ExecutionJournal::record_human_approval takes a HumanDecisionRecord
    (T-016).
    A rejection now carries its signed approval_rejected close and
    the journal writes the decision and the close in one transaction; an
    approval carries no close. Action: custom journal implementations write
    both, or neither, as PostgresExecutionJournal does.

  • ExecutionAttestation::create takes observed_at (T-016, signing
    feature).
    Callers pass the time from their trusted clock; the gateway
    passes the engine's clock.

  • praetore-mcp journal lines are hash-linked (T-016). Each line of
    receipts/<date>.jsonl is now {"seq","prev","evidence"}, the line
    format of praetore_core::journal_chain, instead of a bare evidence
    document. praetore-mcp verify checks the order (an entry removed,
    duplicated or reordered is reported), prints the journal head and accepts
    --expected-head HEX. Entries removed at the end of the journal are only
    detected with --expected-head against a head kept elsewhere; the chain
    has no key. Lines written by earlier versions still verify as unchained
    entries before the chain. Action: tools that read journal lines
    directly take the evidence member (see the praetore-mcp README).

  • praetore-mcp no longer forwards unchecked client lines in observe
    (T-016).
    A line it cannot parse that may name a safety* tool, and any
    line over 32 MiB, is refused in both modes. Other unparseable lines are
    still forwarded in observe, now with a warning that gives the SHA-256 and
    the length.

  • The receipt of a held approval is signed as awaiting_approval
    (T-016, schema v5).
    The 202 response of a request that requires human
    approval now carries execution: "awaiting_approval" (before:
    "not_dispatched" with no reason), signed in execution attestation
    schema v5. Schema v5 has exactly one shape: requires_approval, no
    reason, no output, no failure. A saved 202 receipt keeps verifying as
    awaiting_approval with final: false after the request was approved
    and executed; it can no longer be read as a closed not_dispatched
    request. awaiting_approval is a signed receipt state only, never a
    journal state: GatewayReceipt::execution and
    ExecutionAttestation::execution are now AttestedExecution
    (ExecutionStatus remains the journal row state, and
    AttestedExecution::journal_status() maps between them).
    NonFinalReason gains AwaitingApproval and loses Intermediate (no
    signed receipt carries an intermediate state). Action: HTTP clients that
    match on the 202 execution field accept awaiting_approval; offline
    verifiers are upgraded together with the gateway (see the table below).

  • An approval claimed after its window closes as
    approved_claim_expired (T-016).
    New signed not_dispatched_reason
    (schema v3) for an approved request whose single dispatch is claimed too
    late. approval_expired now means only that the window closed without a
    decision. Rows closed before this release keep approval_expired.

  • ActionDispatcher::preflight takes the verified authority (T-016).
    The signature is now preflight(&self, authority: &Authority, action: &Action); the gateway passes the same authority that dispatch receives,
    so an adapter that routes per tenant can check its route before an action
    is dispatched or held for approval. Action: adapters that override
    preflight add the parameter.

  • HTTP and sandbox-supervisor adapters report refusals made before sending
    as no_effect (T-016).
    HttpActionDispatcher now implements
    preflight: an action with no configured route for the verified tenant,
    action type and target, with a capability other than the route's, or with
    parameters over 64 KiB is refused at submission (403
    `act...

Read more

PRÆTORE v0.3.3

Choose a tag to compare

@github-actions github-actions released this 04 Nov 02:41
0ce6334

Closes the two known limitations of v0.3.2 in the post-hoc safety ingestion
(G1) for AI-enabled systems: R7, the tenant lock of praetore-safety-ingest
can only be taken by the tenant's registered role (#97, migration 0019), and
L95-1, the socket is set up without following symbolic links (#98). Breaking:
the socket directory needs the sticky bit when it is writable by group or
others. GitHub release with checksums only; nothing is published to
crates.io.

Breaking

  • praetore-safety-ingest refuses a socket directory writable by group or
    others without the sticky bit (L95-1, #98),
    also with
    PRAETORE_SAFETY_SOCKET_GROUP. Before, a group-writable directory (for
    example 0770) was accepted with a socket group; now the ingester does
    not start. Action: chmod 1770 <dir> (with a socket group) or
    chmod 0700 <dir>.

Fixed

  • L95-1 (#98): socket mode and group without following symbolic links.
    praetore-safety-ingest opens the socket directory with O_DIRECTORY | O_NOFOLLOW, checks owner and mode on that descriptor, creates and opens
    its private bind directory relative to it, sets the socket's group with
    fchownat(AT_SYMLINK_NOFOLLOW) and its mode relative to the private
    directory's descriptor after checking the entry is its own socket, and
    renames it into place without replacing an existing entry
    (renameat2(RENAME_NOREPLACE) on Linux, renameatx_np(RENAME_EXCL) on
    macOS). On Linux the mode is set with fchmodat without
    AT_SYMLINK_NOFOLLOW (fchmodat2, Linux 6.6 and later, is not used); the
    entry is checked first, in a directory only the ingester's user can
    write.

  • R7 (#97, migration 0019): the tenant lock of praetore-safety-ingest
    can only be taken by the tenant's registered role.
    It is now a row lock (FOR UPDATE NOWAIT) on the ingester's own row of praetore.safety_ingest_tenants,
    on a second connection, instead of a PostgreSQL advisory lock that any
    login could hold. Migration 0019 adds the lock_anchor column, the only
    one praetore_safety_ingest may UPDATE, and an UPDATE policy limited to
    the session's own registration with WITH CHECK (false), so the row can
    be locked but not changed. Another tenant's role, an unregistered role or
    a role with no grant fails closed. The ingester checks the lock before
    each write and renews it every PRAETORE_SAFETY_LOCK_RENEW_SECONDS
    (default 300: COMMIT; BEGIN; SELECT ... FOR UPDATE NOWAIT), so its
    transaction id is never older than one interval. If the lock is lost or
    a renewal finds it taken, the ingester keeps running, writes nothing and
    retries until it takes the lock again. Reversible with
    docs/rollback/0019-safety-ingest-row-lock.sql (it sets lock_timeout). Stop v0.3.2 ingesters
    before migrating: the old and new locks do not exclude each other.

PRÆTORE v0.3.2

Choose a tag to compare

@github-actions github-actions released this 03 Nov 23:11
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, can...

Read more

PRÆTORE v0.3.1

Choose a tag to compare

@github-actions github-actions released this 01 Nov 18:09
7d10e82

This release also includes every change listed under 0.3.1-rc.1 below.

  • Breaking (journal chain format): the journal export gains signed
    storage records. Adopting a legacy baseline writes a record signed with
    the evidence attester key into praetore.storage_records (migration
    0015, append-only) in the adoption transaction; adoption without a signer
    is refused (MigrationError::AdoptionRequiresSigner). praetore journal-export --database exports them as a database-level chain
    (record lines), and a tenant export of a database with records starts
    with a database_head reference to that chain. praetore-verify journal
    verifies both, and --database-journal/--expected-database-head check
    the reference. Chains without records are unchanged; older verifiers
    refuse chains with the new lines. See
    docs/proposals/journal-chain-jsonl.md.

  • Migration checks accept event triggers and global revoke-only default
    privileges only when listed explicitly (PRAETORE_TRUSTED_EVENT_TRIGGERS,
    PRAETORE_TRUSTED_DEFAULT_PRIVILEGES; off by default; listed event
    triggers are verified at startup and refused if they cannot be). Default
    privileges in schemas other than praetore are no longer considered.
    Relaxations are logged at startup and reported by praetore doctor.
    docs/operations.md documents them and recommends
    PRAETORE_RUNTIME_LOGINS in production.

  • Breaking: an existing praetore schema without migration records is
    no longer adopted silently. apply_migrations refuses it
    (MigrationError::LegacyBaselineNotAdopted). Adoption is explicit:
    PRAETORE_ADOPT_LEGACY_BASELINE=1 for the gateway service,
    praetore run <directory> --adopt-legacy-baseline (or the same variable)
    for the CLI, apply_migrations_with and MigrationOptions in the
    library. An adoption is recorded in praetore.schema_migrations
    (adopted_legacy_baseline, adopted_by, baseline_structure_sha256,
    with applied_at), returned by legacy_baseline_adoption, logged by the
    gateway service and printed by praetore doctor. The record is
    informative and not tamper-evident; baseline_structure_sha256 identifies
    the compared 0001-0009 structure for the server version, not the
    database. praetore doctor flags the most direct inconsistency
    (migration_record_inconsistency). Fresh databases and databases with
    migration records are unaffected.

  • apply_migrations compares the praetore structure with a scratch apply
    of the recorded migrations on every run (before migrating forward and
    after applying), checks owners on every run, and runs migrations as the
    schema owner when it is a NOLOGIN group of the migrating role
    (MigrationError::SchemaDrift, MigrationError::InvalidConfiguration).

  • verify_runtime_role also checks ownership of every praetore object,
    members of the schema owner (allowed only through
    PRAETORE_SCHEMA_OWNER_MEMBERS), non-superuser members of
    pg_read_all_data/pg_write_all_data, objects elsewhere that depend on
    praetore, WITH GRANT OPTION, the exact documented praetore_observe
    columns, and SECURITY DEFINER functions with the owner's rights that any
    other role may execute. Other login members of praetore_runtime are
    reported at startup and by praetore doctor, and refused when
    PRAETORE_RUNTIME_LOGINS lists the allowed ones.

  • PRAETORE_TRUSTED_SECURITY_DEFINER_FUNCTIONS entries must be
    schema-qualified with their signature; they are resolved by OID, an
    entry that does not resolve is a configuration error, superuser-owned
    ones are logged with a warning, and praetore run reads the variable.

  • docs/threat-model.md describes the trust perimeter of these checks.

  • apply_migrations checks the database environment on every run, fresh,
    adopted or current (MigrationError::UnsafeDatabase).
    verify_runtime_role checks schema ACLs (RuntimeRoleError::UnexpectedGrant):
    only the grants the migrations make and the documented praetore_observe
    shape are accepted. SECURITY DEFINER functions with the owner's rights are
    refused unless listed in PRAETORE_TRUSTED_SECURITY_DEFINER_FUNCTIONS
    (semicolon-separated; logged at startup).

  • The 0009 baseline check in praetore-replay-postgres (a praetore
    schema without migration records, recorded as 0001-0009 without running
    them) now compares the live schema with 0001-0009 applied by the same
    server, not names. In a transaction that is always rolled back, 0001-0009
    run in a scratch schema (schema name rewritten; the praetore.tenant_id
    setting is kept), and a canonical dump of both schemas must be identical:
    relations (kind, RLS and FORCE RLS, owner, ACL, index and view
    definitions), columns (type, NOT NULL, default, identity, collation,
    column ACL), constraints (pg_get_constraintdef), functions (prosrc,
    result, language, SECURITY DEFINER, SET search_path, volatility,
    STRICT, LEAKPROOF, parallel, owner, ACL; overloads are separate),
    triggers (pg_get_triggerdef, enabled, internal triggers), RLS policies
    (command, roles, USING, WITH CHECK), rewrite rules, inheritance and
    partitions, types, other objects in the schema, and objects in other
    schemas that depend on it. The schema owner must be the migrating role
    or one it is a member of; event triggers, default privileges for the
    schema or owner, and per-database or per-role search_path,
    row_security or session_replication_role settings are refused. Any
    difference refuses the migration and names the objects
    (MigrationError::UnrecognizedSchema now carries a String).

  • The migration runner sends every statement with
    search_path = pg_catalog, pg_temp (the caller's value is restored) and
    catalog names qualified. It refuses a session with
    session_replication_role other than origin
    (MigrationError::UnsafeSession), fresh database or not.

  • crates/praetore-replay-postgres/migrations/.gitattributes keeps the
    migrations LF (*.sql text eol=lf): their bytes are checksummed and
    compared.

  • verify_runtime_role also refuses
    (RuntimeRoleError::OwnerFunctionExecutable) a SECURITY DEFINER function
    outside pg_catalog/information_schema that runs with the praetore
    owner's rights and that the runtime role may execute.

  • The baseline check also refuses SECURITY DEFINER functions outside
    praetore that run with the owner's rights; any role that can act as the
    owner other than the migrating role and NOLOGIN groups it belongs to (the
    owner must be the migrating role or such a group); FOR ALL TABLES and
    TABLES IN SCHEMA praetore publications. The dump adds sequence
    parameters, index flags (indisvalid, indisready, indislive,
    indimmediate), relhastriggers, relhasrules, replica identity, access
    method and the column collation with its schema. The comparison and the
    recording of 0001-0009 now run in one transaction with the praetore
    tables locked, and a failing comparison names the server's error.

  • Limits of the baseline check: it inspects an untrusted database from
    inside it and is best effort. It is structural only (stored rows are not
    validated; a legitimate VALIDATE CONSTRAINT on the NOT VALID foreign
    keys is refused), and it cannot defend against a superuser who edits the
    system catalogs directly.

  • New ignored PostgreSQL tests, run in CI with --exact, one per case
    above.

  • BREAKING (engine, Development mode): no action_type fallback for rule
    capabilities.
    In Development, a matching Allow or RequireApproval
    rule without required_capability was still applied when the authority
    also granted the action's action_type. It is now denied in every mode,
    as Strict and HighAssurance already did: the decision is Deny with
    reason policy rule '<id>' must declare required_capability and
    decided_by engine guard unbound_rule_capability. Actions without a
    capability stay denied in Development (engine guard missing_capability)
    and rejected with INVALID_REQUEST in Strict and HighAssurance. Deny
    rules without required_capability are unaffected. The receipt format is
    unchanged; no golden file or signed fixture changed.

    Migration (Development only; Strict and HighAssurance behave as before):

    // Before: allowed in Development when the authority granted "read_data".
    PolicyRule::new("allow-read", "read_data", PolicyEffect::Allow)
    // After: the rule names the capability it requires.
    PolicyRule::new("allow-read", "read_data", PolicyEffect::Allow)
        .with_capability("read_data")

    In policy JSON, set "required_capability" on every Allow and
    RequireApproval rule. Every action still needs
    Action::with_capability(...).

  • Engine construction has no default mode. This was already the case since
    0.2.0 (new and with_clock were removed in #6) and is now pinned by
    compile_fail doc tests: AuthorizationEngine::new(..) and
    AuthorizationEngine::default() do not compile. Choose the profile by
    name: AuthorizationEngine::development(policy) /
    development_with_clock(policy, clock) (explicit, unsigned, local only),
    strict(policy, pins), or production(policy, HighAssuranceConfig).

  • Docs: README, docs/crypto-and-policy.md, docs/policy-language.md,
    ADR-002, ADR-005 and the threat model no longer describe deprecated
    new / with_clock compatibility constructors (they no longer exist) and
    document that the rule-capability requirement applies in every mode.

  • Runtime connections now pin search_path. Every runtime transaction
    (praetore_replay_postgres::set_tenant_context, now public; also used by
    praetore journal-export, praetore approve and praetore dispatch)
    sets search_path = pg_catalog, pg_temp for the transaction and calls
    pg_catalog.set_config; DatabaseConnector starts sessions with the same
    search_path. verify_runtime_role runs its checks under that search_path
    and also...

Read more

PRÆTORE v0.3.1-rc.1

PRÆTORE v0.3.1-rc.1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 01 Nov 00:43
3227312
  • CI builds praetore-mcp release binaries for x86_64-unknown-linux-gnu,
    aarch64-apple-darwin and x86_64-apple-darwin on every run, runs
    scripts/mcp-smoke.py on each (a real allowed and a real denied
    tools/call through @modelcontextprotocol/server-filesystem@2.1.0, then
    verify), and uploads .tar.gz archives with .sha256 files as workflow
    artifacts. Release checksums now runs on every run, not only on v*
    tags: scripts/release-checksums.sh checks each runner's .sha256, that
    all three targets are present, that each archive holds only the binary,
    LICENSE and NOTICE, and that nothing else is in the set, then writes
    and re-checks one SHA256SUMS (the three archives and praetore-verify).
    scripts/test-release-checksums.sh covers those failures. Only a v* tag
    keeps the result as the release-assets-<tag> artifact.
  • A pushed v* tag now creates the GitHub Release (job release-publish):
    SHA256SUMS is signed with Sigstore keyless signing
    (SHA256SUMS.sigstore.json, verified against the workflow identity before
    publishing), the notes are the tag's CHANGELOG.md section
    (scripts/release-notes.sh, tested by scripts/test-release-notes.sh), an
    existing release is never overwritten, and - tags are pre-releases. On
    every PR the signing tooling is exercised with a throwaway key, including a
    changed SHA256SUMS that must not verify. CI still holds no long-lived
    signing key. The macOS binaries are not signed or notarized.
  • release-publish now needs every other assurance.yml gate, not only the
    release artifacts; a tag that does not equal v plus the workspace version
    fails before anything is published; its checkout keeps no token; the
    signature check also pins the tagged commit
    (--certificate-github-workflow-sha). CONTRIBUTING documents how to recover
    from a failed release job. The smoke test runs on Node 24, which
    @modelcontextprotocol/server-filesystem@2.1.0 requires.
  • Breaking (sandbox supervisor configuration): schema_version 1 → 2.
    Every route must now declare a closed schema of its action's top-level
    parameters. At dispatch, before any Kubernetes request, the supervisor
    answers 400 if parameters is not an object, has a key the route does not
    declare, has a value of another kind, or lacks a required key. Only path
    and path_list values get the lexical path check; free text in string
    values is not path-checked. The check is fail-closed and much stricter
    than in 0.3.0. A path value, and every path_list element, is split on
    both / and \; every segment must match [A-Za-z0-9._-]+, must not
    start with . or -, and must be at most 255 bytes; the whole value must
    be at most 1024 bytes (the in-process sandbox dispatcher's
    MAX_COMPONENT_BYTES and MAX_PATH_BYTES). As a consequence the
    supervisor refuses:
    • an empty value, an empty segment (a//b, a trailing separator as in
      dir/) and the segments . and ..;
    • hidden names such as .env or a/.git/config, and ... (a leading
      . is rejected on purpose; this may be relaxed later);
    • option-like names such as -rf, -- or a/-n, in case a tool profile
      passes a path to a subprocess without --;
    • a segment longer than 255 bytes or a value longer than 1024 bytes;
    • a leading /, \ or ~, and a drive or UNC prefix;
    • spaces and punctuation outside ._- (+, @, ~, %, :, ...);
      % is always refused, including names such as 100%.txt;
    • every non-ASCII character, including accented letters and homoglyphs
      such as Cyrillic а (U+0430) or full-width a (U+FF41);
    • control characters, Unicode format (Cf) and bidi characters, and
      U+2028/U+2029 (also checked explicitly, as defense in depth).
    • Not covered, because runners are Linux only: Windows reserved device
      names (CON, NUL, COM1, aux.txt) and trailing dots (a., x..).
    • By design, only keys declared path or path_list are path-checked: a
      string value such as ../../etc/passwd is accepted. Declare as path
      every key the runner uses as a path.
    • Path migration for callers: send x instead of ./x and dir
      instead of dir/, and rename files whose names use spaces, non-ASCII
      letters, other punctuation or a leading . or - (for example
      informe año 2026.txt → informe_ano_2026.txt, .env → env) before
      routing them through a path or path_list parameter. Free text
      belongs in a string key.
    • Kinds: path, path_list (array of at most 64 path values, each
      checked), string, integer, boolean. Nested objects are not
      supported.
    • Schema keys must match [a-z0-9_]+ (at most 256 bytes); otherwise the
      configuration is refused at startup. Rename keys such as orderId,
      order-id or Path to order_id or path.
    • "key": "kind" declares a required key. A key is optional only when
      written as "key": {"kind": "...", "optional": true}.
    • A version 1 file is refused at startup, not upgraded.
      SandboxSupervisor::new returns, and praetore-sandbox-supervisor
      exits with (main returns the error, so it is printed as
      Error: "<message>"):
      sandbox supervisor configuration must have schema_version 2 (version 1 has no per-route `parameters` schema; see the CHANGELOG for the migration)
      
    • Migration: set "schema_version": 2 and add parameters to every route.
      Before (v1):
      {"schema_version": 1, "runner_image": "…@sha256:…", "routes": [
        {"tenant_id": "…", "action_type": "orders:create", "target": "orders-api",
         "capability": "orders:write", "tool_profile": "orders-create"}]}
      After (v2):
      {"schema_version": 2, "runner_image": "…@sha256:…", "routes": [
        {"tenant_id": "…", "action_type": "orders:create", "target": "orders-api",
         "capability": "orders:write", "tool_profile": "orders-create",
         "parameters": {
           "order_id": "string",
           "quantity": "integer",
           "attachments": {"kind": "path_list", "optional": true}}}]}
      Declare every key the tool actually receives: after the upgrade, a
      request with an undeclared key is refused.
  • praetore journal-export --tenant orders the journal rows by
    (created_at, request_id, agent_id). (created_at, request_id) was not a
    total order (the key is (tenant_id, agent_id, request_id)), so two exports
    of the same journal could differ. It now warns on stderr when the database
    role is not the least-privilege runtime role. New PostgreSQL tests: export
    as a login member of praetore_runtime confined by RLS without the SQL
    filter, fail closed without the tenant setting, no writes; row order with
    ties; and praetore journal-export --tenant plus praetore-verify journal
    end to end against two gateways.
  • Hash-linked JSONL export of receipts, as specified in
    docs/proposals/journal-chain-jsonl.md (now marked implemented):
    • praetore_core::journal_chain: the format, the link
      (SHA-256("PRAETORE_JOURNAL_LINK_V1\0" || u64_be(seq) || prev || context_hash || attester_signature)), a producer (ChainExporter) and a
      verifier (verify_chain) that share it.
    • praetore journal-export (--receipts-dir DIR | --tenant UUID) --attester-pin HEX_FILE --output NEW_FILE builds a chain from a
      directory of receipts or from one tenant's praetore.execution_journal
      rows, checking every receipt against the pinned attester key first. It
      never overwrites the output.
    • praetore-verify journal --journal JSONL --attester-pin HEX_FILE [--expected-head HEX] [--policy PATH], brought from
      feat/journal-chain-verifier (bfeade5) by cherry-pick. Changes from
      bfeade5: it uses the shared core code; adds --expected-head
      (JOURNAL_HEAD_MISMATCH); every line, including the last, must end in
      \n and \r is rejected (before, lines() accepted CRLF and a missing
      final newline, and a file with only \n failed as JOURNAL_CHAIN_FAIL,
      now INVALID_REQUEST); failures print the entry on stderr; test fixtures
      updated for Decision::allow(reason, DecidedBy).
    • examples/claude-code-hook/evidence/0{3,4,5}-*/journal-chain.jsonl
      (22, 8 and 118 entries; receipts unchanged), heads in VERIFY.md,
      verify-chain.sh, and a journal-chain CI job that rejects a deleted,
      deleted-and-relinked, truncated, reordered and altered copy.
    • Limit: the link is unkeyed. Anyone with the receipts can rebuild a chain
      over a subset, and the attester key holder can rebuild anything. A head
      only detects deletion or truncation if it was published outside the
      producer's control and passed as --expected-head; the heads in this
      repository are not such an anchor.
  • T-014, praetore-mcp: arguments covered by a PathPrefix rule are
    resolved through the filesystem before evaluation. Unless an absolute value
    resolves to itself (no symlink, ./.., dangling link or missing parent),
    the engine sees praetore-mcp:path-check-failed, which core treats as an
    unsafe path (every DENY / REQUIRE_APPROVAL PathPrefix rule matches, no
    ALLOW one). Receipts record context["praetore.path_check"]; forwarded
    bytes are unchanged. Core's PathPrefix stays lexical. Behavior change: on
    macOS, /tmp/... arguments under such a rule are now refused or not
    allowed; use resolved paths. policy commands and policy check warn
    about prefixes that resolve elsewhere. The check is point-in-time (TOCTOU).
    A path that resolves to itself but is at or under a policy PathPrefix
    only when compared like the filesystem compares names (case folding and/or
    NFC: APFS, HFS+, casefolded ext4/f2fs, unknown filesystems), not byte for
    byte, is ambiguous and hidden the same way; this covers case and NFD
    variants of a denied name that does not exist yet. Case folding is full
    Unicode case ...
Read more

v0.3.0

v0.3.0 Pre-release
Pre-release

Choose a tag to compare

@Mavericksantander Mavericksantander released this 30 Oct 21:45
b63252f
  • The gateway-service sandbox supervisor rejects a dispatch request when any
    string value in action.parameters, at any depth, contains NUL, starts at
    a root (/ or \), has a drive or UNC prefix, or has a .. segment
    (T-013 fix A, lexical only; / and \ are both checked on every OS).
    Symlinks are not resolved yet (fix B, stage 2).

  • crates/praetore-mcp/GUIDE.md: a guide for external developers with a
    first-run walkthrough, the limits (only MCP tools/call through a wrapped
    server is governed; LOCAL/DEV keys; no approval flow for REQUIRE_APPROVAL;
    lexical path rules; TOCTOU) and a troubleshooting table.

  • praetore-mcp install/uninstall process a config file once when two
    default paths name it (Cursor's ~/.cursor/mcp.json and
    ./.cursor/mcp.json when run from ~, or a symlink). Before, it was
    listed twice; the second pass was skipped as already wrapped. The
    praetore-mcp README records the real-app check on macOS (Claude Desktop
    and Cursor).

  • The praetore-mcp README documents installing without a clone:
    cargo install --git https://github.com/Mavericksantander/praetore praetore-mcp --locked (checked on macOS arm64 against 9735974).

  • praetore-mcp <command> --help / -h prints that command's usage and
    exits 0 (it used to fail with unexpected argument "--help"). --help
    after wrap ... -- is still passed to the MCP server. praetore-mcp version is an alias of --version. Exit codes (0, 1, 2, and wrap's
    server code / 127) are documented in --help and the praetore-mcp README.

  • praetore-mcp wrap --mode observe no longer forwards tools/call without
    receipts when the home cannot be loaded at startup (not initialized, or
    invalid keys, pins, authority or policy). Both modes now refuse every
    tools/call in that case and print every tools/call will be REFUSED;
    other MCP traffic is still relayed. Per-call evaluation errors after a
    successful start keep the documented observe behavior.

  • New receipts always record what decided them in decision.decided_by, as
    part of the hashed and Ed25519-signed evidence payload, in the new
    evidence schema v4:

    • DecidedBy::Rule { rule_id } (a rule's declared effect applied; a
      RECOVER rule's rule_id equals its recovery obligation's),
      UnboundRule { rule_id } (a REQUIRE_APPROVAL/RECOVER rule matched
      without its required capability or target and denied instead),
      DefaultDeny and EngineGuard { guard }. Combining decisions keeps the
      decider of the higher severity (Recover > Deny > RequireApproval > Allow), the earlier one on a tie.
    • Versioning: every new evidence is v4 (with or without HighAssurance
      metadata and recovery). v1-v3 must not carry decided_by, so existing
      receipts, golden vectors and fixtures keep verifying byte-for-byte; v4
      must carry it. decided_by must be consistent with the outcome,
      recovery obligation and contributions; unknown kinds, unknown fields and
      an explicit null are rejected.
    • Upgrade order: binaries without v4 support reject v4 evidence (fail
      closed). Upgrade every verifier, Python binding and gateway node before
      any node starts producing v4; during a mixed-version rollout or after a
      rollback, journal rows and pending approvals written by new nodes are
      unreadable (InvalidRecord) on old ones.
    • Breaking: Decision has a required decided_by: DecidedBy (JSON without
      it does not deserialize); Decision::allow/deny/require_approval take it
      as a second argument (Decision::recover derives it from the
      obligation). Evidence.decision is now a RecordedDecision (the read
      path) whose decided_by is optional, crate-private and read via
      decided_by(); Decision converts with .into(). Evidence::new and
      attest reject a decision that violates these invariants. Consumers that
      compared evidence_schema_version to 2/3 should use
      is_high_assurance_shape() and decision.recovery.
    • Dispatch revalidation compares a legacy (pre-v4) record on every field
      except decided_by, so approvals pending across the upgrade can still be
      dispatched; v4 records must match decided_by too.
    • Test fixtures in packages/praetore-python/tests/fixtures were
      regenerated as v4; the previous v1/v2 bytes are kept in
      fixtures/legacy-evidence/ and still verify.
  • New crate praetore-mcp (binary praetore-mcp): a local stdio MCP proxy
    for Claude Desktop, Cursor and VS Code that needs no PostgreSQL and no Rust.
    init creates LOCAL/DEV issuer, agent and attester keys (0600), a signed
    authority, praetore-verify-compatible trust pins and a default v2 policy.
    wrap evaluates every client→server tools/call in HighAssurance mode and
    appends attested evidence to an fsynced JSONL journal. In observe mode
    (the default) calls are always forwarded and only recorded. In enforce
    mode DENY and REQUIRE_APPROVAL are blocked with an MCP isError result,
    and errors fail closed. The mode is bound into the signed evidence as
    context["praetore.mode"]. install / uninstall rewrite and restore
    client configs, writing a backup and asking for confirmation first.
    receipts and verify read and check the journal. policy list|check|deny|require-approval|allow|remove manage rules without
    hand-written JSON. Each change is validated, written atomically with a
    backup, and refused when it would create an unscoped argument rule unless
    --any-tool is given. Limitations: stdio
    only, REQUIRE_APPROVAL is not supported, LOCAL/DEV keys only, and receipts
    attest the proxy's view of a call, not the upstream agent's intent. See
    crates/praetore-mcp/README.md. praetore-core is unchanged.

  • praetore-verify evidence accepts --policy PATH: the receipt must record
    that policy's digest (Evidence::verify_policy); receipts without a digest
    fail with POLICY_MISMATCH.

  • The hash-linked journal export (praetore-verify journal) is a proposal
    only (docs/proposals/journal-chain-jsonl.md). It is not shipped: the
    verifier is kept on branch feat/journal-chain-verifier until a Postgres
    exporter lands with it in one PR. As specified (unkeyed links, no signed
    or published head) it does not let a third party detect deletion,
    truncation, reordering or a recomputed chain; the proposal lists what is
    missing.

  • scripts/regen-legacy-evidence-fixture.sh regenerates the legacy receipt
    fixture (no policy_digest) from commit 3db7b5e.

  • Breaking (core): Evidence::sign now refuses to sign a receipt that does
    not record the full lowercase SHA-256 digest of the active policy
    (policy_digest, from Policy::digest() over the canonical JSON). The
    engine already bound it in every mode; this makes it a hard requirement of the write path, so the
    Ed25519 attester signature always covers which policy decided. Receipts
    signed before this change (no policy_digest) still deserialize and verify.
    Callers that sign evidence directly (not through PolicyEngine) must call
    Evidence::bind_policy_digest first.

  • New Evidence::verify_policy(&Policy) checks that a receipt was decided
    under a given policy (digest present and equal). Legacy receipts without a
    digest return an error.

  • Known limitation (accepted): legacy receipts whose policy_digest was
    recorded in uppercase hex still deserialize and verify, but cannot be
    re-signed, because Evidence::sign only accepts the lowercase SHA-256 hex
    produced by Policy::digest(); verify_policy also rejects them.

  • Security (gateway HTTP API): caller authentication. http_api::router and
    serve_local now take an ApiAuth. ApiAuth::Required(ApiCredentials)
    requires Authorization: Bearer on every endpoint except /healthz, with
    tenant-scoped credentials (SHA-256 digests, constant-time comparison) whose
    tenant must match the {tenant_id} path segment or, for /v1/execute, the
    submitted authority's tenant. Roles are disjoint: agent may execute and
    read status; only approver may read challenges, decide and dispatch.
    Unauthenticated: 401 authentication_required; wrong role or tenant: 403
    caller_not_authorized.

    • Breaking (gateway service): PRAETORE_GATEWAY_API_CREDENTIALS_FILE is
      required with the http and sandbox adapters and for any non-loopback
      PRAETORE_GATEWAY_LISTEN_ADDR. Only local-demo on loopback may run
      unauthenticated, and local-demo never listens beyond loopback.
    • The freshness snapshot is read with a bounded read (not only a
      metadata size check), and a snapshot whose issued_at is older than
      one already loaded is refused (fail closed), so a stale sync or restored
      backup cannot undo a revocation.
    • Breaking (CLI): praetore init creates agent-api.token and
      approver-api.token; run, demo, approve, reject and dispatch
      use them. Older demo directories need a fresh init.
  • Security (gateway): approver keys can be bound to a tenant
    (HumanApprovalVerifier::for_tenant); the gateway accepts several
    verifiers and a key never verifies another tenant's decision. Service:
    new PRAETORE_GATEWAY_APPROVER_BINDINGS_FILE; breaking: the single
    PRAETORE_GATEWAY_APPROVER_KEY_ID/_PUBLIC_KEY_HEX pair is rejected with
    http/sandbox unless exactly one tenant is issuer-bound (it is then bound
    to that tenant). The CLI demo approver is bound to the demo tenant.

  • Security (gateway service): breaking: http and sandbox adapters require
    PRAETORE_GATEWAY_FRESHNESS_FILE, a file-based revocation snapshot
    (revoked authority IDs, agent key fingerprints, authority digests) with
    bounded staleness that fails closed when missing, invalid or stale
    (PRAETORE_GATEWAY_FRESHNESS_RELOAD_INTERVAL_MS, _LEASE_MS,
    _MAX_SNAPSHOT_VALIDITY_MS). The demo provider, which never checks
    revocation, is limited to local-demo.

  • Security (gateway): claim_dispatch independentl...

Read more