Repository navigation
Releases
PRÆTORE v0.3.6
Added
- praetore-mcp: a report of each
wrapsession. When a session ends
(the client or the server closes, or SIGINT/SIGTERM on macOS and Linux)
and it recorded at least one receipt,wrapwrites
DIR/reports/session-<start UTC>-<id>.jsonand.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 ofverify)
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 ofverify,
both heads and the SHA-256 of the JSON. Ifverifyfails the first page
saysVERIFY FAILEDand 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-reportandreport = falsein
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>.jsonand.pdf, next to the
original, withregenerated_fromin 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 withpdf-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 inDIR/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 pairsreportwrote 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 inDIR/reports/and its content is a report (a JSON with the
report schema; a PDF that starts with%PDFand 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,wrapprints, after the report path, the
command that starts the dashboard on the home with--port 8787
(absolute and quoted) and the linkhttp://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_aton the held rows of/api/state), noted as such.
The Sessions view lists a file only whenGET /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
Originis not
its own (http://127.0.0.1:PORTorhttp://localhost:PORT), with 403,
on top of theHostcheck. -
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 withPRAETORE_MCP_RELEASE=1. The
commit comes from git only when the repository found is this one;
otherwise fromPRAETORE_MCP_BUILD_COMMIT, or none.praetore-mcp --versionprints 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
exactlypraetore-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--versionwith 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,
wrapwrites the report before it ends
by SIGINT or SIGTERM (macOS and Linux). Before, the signal endedwrap
at once. Now, when the session report is on,wrapwaits 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 seeswrapterminated by SIGINT or
SIGTERM, as in 0.3.5. A second signal ends it at once without the report.
With--no-reportorreport = falseno handler is installed and the
signal endswrapat once, as in 0.3.5. A signal that was ignored when
wrapstarted 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 decidedexpiredonce itsexpires_athas passed (or
cannot be read, as forapprove), and lists to decide only the calls it
labelspending, from the same map. The drawing, the Live list, the
approval history and the drawer show Vencida / Expired / Vencida, and
praetore-mcp receiptsshowsexpired. The session report uses the same
rule, so a pending call whoseexpires_atcannot be read is Expired
there too (before, it stayed Pending), and so doapprove,rejectand
holding the same call again.praetore-mcp approvalsprints
expired: run the agent again so the call is held againfor such a call
in place of itsapproveandrejectcommands. The journal and the
signed receipts are unchanged. -
praetore-mcp: printed commands run when the binary is not on
PATH.
Theapproveandrejectcommands in the tool error of a held call, in
approvalsand in the dashboard, and the commands thatinit(its
allow-all warning included),policy check,policy allow,
policy coverageand 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-mcpprints
the file it points to) and always pass--diras an absolute path, also
for the default home, both single-quoted for a POSIX shell ('written
as'\''). The not-initialized notes ofinstallstill say
praetore-mcp init. Before, they started with
praetore-mcp, and a binary extracted to a folder offPATHanswered
"command not found". If the binary's path cannot be read the commands
start withpraetore-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,approveand 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 afterExpires (UTC). After an
approval,approveprints the time to retry before.approveon 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 (receiptsshows
approve by KEY, expired unusedorapprove 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.approveandrejectappend 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 RECEIPTfor a session with one
receipt (it said1 RECEIPTS).
Internal
- praetore-mcp: clippy keeps
Expiry::atfor 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
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:
initwrites a default-deny policy (behavior change for
enforce mode). The policy has no rules. Before, it had
allow-all-mcp-tool-calls, which allowed everytools/callthat no other
rule matched, so DENY rules that named tools left every other tool
allowed: with DENY rules per tool,copy_fileandappend_fileof
@modelcontextprotocol/server-filesystem@2.3.0were allowed because no
rule named them. Now, in enforce mode, everytools/callthat 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: onlytools/callis evaluated, so
initialize,tools/listand the rest of the MCP traffic pass. Observe
mode is unchanged and never blocks. Existing homes keep their policy:
initon a home that has an allow-all rule leaves it in place and prints
a warning withpraetore-mcp policy remove --id allow-all-mcp-tool-calls.
Not in v0.3.4:initin 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 checkwarns 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 suggestspolicy coverage.policy deny,
require-approvalandallowprint the same warning after the change
(#167).
Added
praetore-mcp dashboard [--dir DIR] [--port N] [--expected-head HEX].
A read-only local page overreceipts/*.jsonl, served on 127.0.0.1 only
(default port 8787,0picks 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 ordefault deny, mode, evidence id) with filters, and
each receipt's full JSON,path_checkand 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
behindpraetore-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 loopbackHostare 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 fileverifyreads changes, so a reload of an unchanged 10,000-receipt
journal does not runverifyagain (#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 thatverifydoes not check. The chain view draws the
receipts in seq order joined by theprevhash link and shows the link
cut, with the reason, whereverifyfails. Opening a receipt shows its
tool, arguments, rule, mode, local time and UTC, evidence id, seq,prev
and itsverifyresult. The live view marks a receipt thatverify
rejects, with the reason, and moves only when a receipt arrives, the
verifyresult 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, sendsinitializeandtools/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 notools/calland writes nothing underDIR. 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 outsideA-Z a-z 0-9 _ - .(#167, #170). - Commands that praetore-mcp prints with
--dir DIRquoteDIRwhen it
has spaces or other characters a shell would interpret. scripts/mcp-smoke.pycheckspolicy coverageagainst
@modelcontextprotocol/server-filesystem@2.3.0, and the smoke test now
allowsread_text_filewith 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.icois 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 slowsendstill 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
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 matchingtools/callis not forwarded. The proxy writes a pending
file under the praetore-mcp home and returns the approval id plus the
exactpraetore-mcp approve <id> --dir <home>command.approvalslists
pending calls,approveandrejectsign the decision with a new local
approver key (initcreates it; runninginitagain adds it to an
existing home and does not replace keys or receipts).approvereads 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_SECONDSor
approvals/ttl-seconds), and authorizes one later matching call. The
decision and that execution are appended toapprovals/journal.jsonl.
verifychecks the approver signature, the binding, the expiry and that
the approval was not used twice.receiptsshows the state. Observe mode
still forwards, and the receipt list says enforce would ask. Receipt
lines inreceipts/*.jsonlare 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,mensajeandnotaare stable
Englishsnake_casecodes ("awaiting_approval",
{"codigo": "request_gone"},{"codigo": "inbox_truncated", "limite": 200});
queriaandsobreare{"texto": ...}or{"codigo": "not_shown"};
agenteis{"nombre": ...}or{"numero": N}. Times are RFC 3339 UTC
incuando_utc,actualizado_utc,pedida_utcandvale_hasta_utc;
cuando,actualizado,pedida,vale_hastaandquedaare 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-demorequiresPRAETORE_GATEWAY_ADAPTER(T-016).
The service no longer falls back tolocal-demowhen 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, includinglocal-demofor local runs (docs/operations.md). -
Gateway attester keys are read from owner-only files (T-016).
PRAETORE_GATEWAY_EVIDENCE_ATTESTER_KEY_FILEand
PRAETORE_GATEWAY_EXECUTION_ATTESTER_KEY_FILEname 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_HEXvariables 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_HEXvariables. -
praetore-observerequires its read-only role (T-016). At startup it
checks thatPRAETORE_OBSERVE_DATABASE_URLlogs in aspraetore_observe
or as a member of it, is not a member ofpraetore_runtime,
praetore_safety_ingestorpraetore_safety_audit, and holds no
privilege beyond the documented columnSELECTgrant
(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 journalrenamesdatabase_head_verifiedto
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 newdatabase_head_anchoredis true
only with--expected-database-head, a head the caller holds; the head
of a--database-journalfile is not anchored by that file. Action:
scripts that readdatabase_head_verifiedreaddatabase_head_consistent,
and checkdatabase_head_anchoredwhere an anchored database head is
required. -
A journal chain holds the receipts of one tenant (T-016).
praetore-verify journalandpraetore journal-exportrefuse 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(nullfor a database chain, or when the receipts name
none). Exports written byjournal-export --tenanthold 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.
praetoreonly ever wrote lowercase. -
Cooperative execution is refused by default (T-013). The local HTTP
API (praetore run) andpraetore-gateway-demo, with every adapter and
with or withoutsandbox_root, requirepraetore-exec-mode: gatewayon
every execution-path request and never answerapprovedon/status
for an approved action. Before, this applied only withsandbox_root, and
praetore-gateway-demonever applied it.http_api::HttpOptionsnow has
exec_mode: ExecModeinstead ofgateway_executes_effects: bool. Action:
clients send the header (thepraetoreCLI already does). Development
only, with no guarantee about who performs an effect:
praetore init --dev-cooperative-execor
PRAETORE_GATEWAY_DEV_COOPERATIVE_EXEC=1(local-demo adapter). -
ExecutionJournal::record_human_approvaltakes aHumanDecisionRecord
(T-016). A rejection now carries its signedapproval_rejectedclose 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, asPostgresExecutionJournaldoes. -
ExecutionAttestation::createtakesobserved_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>.jsonlis now{"seq","prev","evidence"}, the line
format ofpraetore_core::journal_chain, instead of a bare evidence
document.praetore-mcp verifychecks 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-headagainst 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 theevidencemember (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 asafety*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 carriesexecution: "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_approvalwithfinal: falseafter the request was approved
and executed; it can no longer be read as a closednot_dispatched
request.awaiting_approvalis a signed receipt state only, never a
journal state:GatewayReceipt::executionand
ExecutionAttestation::executionare nowAttestedExecution
(ExecutionStatusremains the journal row state, and
AttestedExecution::journal_status()maps between them).
NonFinalReasongainsAwaitingApprovaland losesIntermediate(no
signed receipt carries an intermediate state). Action: HTTP clients that
match on the 202executionfield acceptawaiting_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 signednot_dispatched_reason
(schema v3) for an approved request whose single dispatch is claimed too
late.approval_expirednow means only that the window closed without a
decision. Rows closed before this release keepapproval_expired. -
ActionDispatcher::preflighttakes the verified authority (T-016).
The signature is nowpreflight(&self, authority: &Authority, action: &Action); the gateway passes the same authority thatdispatchreceives,
so an adapter that routes per tenant can check its route before an action
is dispatched or held for approval. Action: adapters that override
preflightadd the parameter. -
HTTP and sandbox-supervisor adapters report refusals made before sending
asno_effect(T-016).HttpActionDispatchernow 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...
PRÆTORE v0.3.3
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-ingestrefuses 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
example0770) 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-ingestopens the socket directory withO_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 withfchmodatwithout
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 ofpraetore.safety_ingest_tenants,
on a second connection, instead of a PostgreSQL advisory lock that any
login could hold. Migration 0019 adds thelock_anchorcolumn, the only
onepraetore_safety_ingestmay UPDATE, and an UPDATE policy limited to
the session's own registration withWITH 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 everyPRAETORE_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 setslock_timeout). Stop v0.3.2 ingesters
before migrating: the old and new locks do not exclude each other.
PRÆTORE v0.3.2
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'spraetore-safety-ingestfrom starting (denial
of service; it cannot read or write the tenant's records). The refusal
andpraetore-safety-ingest doctorname the holding session
(docs/operations.md, "Deployment"). - L95-1: a group-writable socket directory. With
PRAETORE_SAFETY_SOCKET_GROUPthe 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 thechmod/chownof 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 ofmain(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
bypraetore_safety_client::EpochFile, which fails closed instead of
starting again from 1);source_seqstarts at 1 in each epoch and a
chain is a sequence of segments, one per epoch. Every record of a source
chain signshigh_waterandsource_epoch; the ingester resumes from
the last signed record only (SafetyIngestor::resume_heads, replacing
set_heads;IngestorConfig::headsis removed), andcommitnow
returns an error unless the records extend the current head. - New
rejectedreasonsseq_jump_too_large,stale_epochand
epoch_jump_too_large(bounded byPRAETORE_SAFETY_MAX_SEQ_JUMPand
PRAETORE_SAFETY_MAX_EPOCH_JUMP, which also bounds a chain's first
epoch); an
event far from the ingester's clock carriesclock_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 inPRAETORE_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(lossreasonsrate_limited,
rejected_suppressed,duplicate,peer_refused). Decision
change: an exact duplicate no longer creates aduplicaterecord; it
is counted (aconflictis still recorded, and the verifier still
acceptsduplicaterecords). - Migration
0017_safety_records_followups: thesource_epochcolumn,
record_idunique per tenant, the columns checked against the signed
high_waterandsource_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_recordsfollows the registered role instead of the
praetore.tenant_idsetting, 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_auditandpraetore.safety_audit_tenantslet a login
role export and audit the tenants it is registered for, without write
access (verify_safety_audit_role_with). PRAETORE_SAFETY_MAX_EPOCH_JUMPbounds the step ofsource_epochand 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-headthe verifier now warns
(head_not_anchored). It reports epochs anddropped_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 doctorname 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.
- Format 2: every event signs
-
Walkthrough demo.
make demo(orcargo 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-verifyre-checks the chain withpraetore-verify. Demonstration
configuration only: in-memory replay guard and a fixed freshness lease with
no revocation source. Seedocs/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 modulepraetore_core::safety_ingest:
SafetyEvent(signed by aSafetySourceKeyunder
PRAETORE_SAFETY_EVENT_V1\0:source_id, monotonicsource_seq, the raw
action name,occurred_atby the source clock, optional boundedparams,
post_hoc: true),SafetyRecord(signed by aSafetyIngestKeyunder
PRAETORE_SAFETY_RECORD_V1\0, chained per source inside the signed
payload; statusesaccepted,undeclared,invalid_name,duplicate,
conflict,late,rejected,loss), theSafetyIngestorstate machine
andverify_safety_chain. Key ids usePRAETORE_SAFETY_SOURCE_KEY_V1\0ed25519\0
andPRAETORE_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(inpraetore-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; a0600(or0660with 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. Migration0016_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(USAGEon the schema,SELECTon
schema_migrations,SELECT,INSERTonsafety_records); creating it
needsCREATEROLEin the migrating role, checked before any migration
(MigrationError::GroupRoleMissing).verify_safety_ingest_role_with
checks the ingester's role, andverify_runtime_rolenow refuses a
gateway role that can insert safety records
(RuntimeRoleError::RoleSeparation). New exportpraetore journal-export --safety --tenant UUID --source ID --ingest-pin HEX_FILE(verifies before
writing, never overwrites; readsPRAETORE_SAFETY_DATABASE_URL) and new
verifier commandpraetore-verify safety-journal --journal JSONL --ingest-pin HEX_FILE [--source-pins JSONL] [--expected-head HEX], which
checks record signatures, the chain,source_seqcontinuity (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 jobg1-mutation. Transport v1 is local only;
HTTP with mutual TLS is future work. -
Safety namespace manifest (G2). New module
praetore_core::safety_namespace.SafetyActionName::parseis the one
validator ofsafety:*names (exact ASCII prefixsafety:, 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::validateuses it for everySafetyentry, so
aSafetyentry 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...
PRÆTORE v0.3.1
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 intopraetore.storage_records(migration
0015, append-only) in the adoption transaction; adoption without a signer
is refused (MigrationError::AdoptionRequiresSigner).praetore journal-export --databaseexports them as a database-level chain
(recordlines), and a tenant export of a database with records starts
with adatabase_headreference to that chain.praetore-verify journal
verifies both, and--database-journal/--expected-database-headcheck
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 thanpraetoreare no longer considered.
Relaxations are logged at startup and reported bypraetore doctor.
docs/operations.mddocuments them and recommends
PRAETORE_RUNTIME_LOGINSin production. -
Breaking: an existing
praetoreschema without migration records is
no longer adopted silently.apply_migrationsrefuses it
(MigrationError::LegacyBaselineNotAdopted). Adoption is explicit:
PRAETORE_ADOPT_LEGACY_BASELINE=1for the gateway service,
praetore run <directory> --adopt-legacy-baseline(or the same variable)
for the CLI,apply_migrations_withandMigrationOptionsin the
library. An adoption is recorded inpraetore.schema_migrations
(adopted_legacy_baseline,adopted_by,baseline_structure_sha256,
withapplied_at), returned bylegacy_baseline_adoption, logged by the
gateway service and printed bypraetore doctor. The record is
informative and not tamper-evident;baseline_structure_sha256identifies
the compared 0001-0009 structure for the server version, not the
database.praetore doctorflags the most direct inconsistency
(migration_record_inconsistency). Fresh databases and databases with
migration records are unaffected. -
apply_migrationscompares thepraetorestructure 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_rolealso checks ownership of everypraetoreobject,
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 documentedpraetore_observe
columns, and SECURITY DEFINER functions with the owner's rights that any
other role may execute. Other login members ofpraetore_runtimeare
reported at startup and bypraetore doctor, and refused when
PRAETORE_RUNTIME_LOGINSlists the allowed ones. -
PRAETORE_TRUSTED_SECURITY_DEFINER_FUNCTIONSentries 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, andpraetore runreads the variable. -
docs/threat-model.mddescribes the trust perimeter of these checks. -
apply_migrationschecks the database environment on every run, fresh,
adopted or current (MigrationError::UnsafeDatabase).
verify_runtime_rolechecks schema ACLs (RuntimeRoleError::UnexpectedGrant):
only the grants the migrations make and the documentedpraetore_observe
shape are accepted. SECURITY DEFINER functions with the owner's rights are
refused unless listed inPRAETORE_TRUSTED_SECURITY_DEFINER_FUNCTIONS
(semicolon-separated; logged at startup). -
The 0009 baseline check in
praetore-replay-postgres(apraetore
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; thepraetore.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-rolesearch_path,
row_securityorsession_replication_rolesettings are refused. Any
difference refuses the migration and names the objects
(MigrationError::UnrecognizedSchemanow carries aString). -
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_roleother thanorigin
(MigrationError::UnsafeSession), fresh database or not. -
crates/praetore-replay-postgres/migrations/.gitattributeskeeps the
migrations LF (*.sql text eol=lf): their bytes are checksummed and
compared. -
verify_runtime_rolealso refuses
(RuntimeRoleError::OwnerFunctionExecutable) a SECURITY DEFINER function
outsidepg_catalog/information_schemathat runs with the praetore
owner's rights and that the runtime role may execute. -
The baseline check also refuses SECURITY DEFINER functions outside
praetorethat 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 TABLESand
TABLES IN SCHEMA praetorepublications. 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 legitimateVALIDATE CONSTRAINTon theNOT VALIDforeign
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_typefallback for rule
capabilities. In Development, a matchingAlloworRequireApproval
rule withoutrequired_capabilitywas still applied when the authority
also granted the action'saction_type. It is now denied in every mode,
as Strict and HighAssurance already did: the decision isDenywith
reasonpolicy rule '<id>' must declare required_capabilityand
decided_byengine guardunbound_rule_capability. Actions without a
capability stay denied in Development (engine guardmissing_capability)
and rejected withINVALID_REQUESTin Strict and HighAssurance. Deny
rules withoutrequired_capabilityare 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 everyAllowand
RequireApprovalrule. Every action still needs
Action::with_capability(...). -
Engine construction has no default mode. This was already the case since
0.2.0 (newandwith_clockwere removed in #6) and is now pinned by
compile_faildoc 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), orproduction(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_clockcompatibility 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 approveandpraetore dispatch)
setssearch_path = pg_catalog, pg_tempfor the transaction and calls
pg_catalog.set_config;DatabaseConnectorstarts sessions with the same
search_path.verify_runtime_roleruns its checks under that search_path
and also...
PRÆTORE v0.3.1-rc.1
- CI builds
praetore-mcprelease binaries forx86_64-unknown-linux-gnu,
aarch64-apple-darwinandx86_64-apple-darwinon every run, runs
scripts/mcp-smoke.pyon each (a real allowed and a real denied
tools/callthrough@modelcontextprotocol/server-filesystem@2.1.0, then
verify), and uploads.tar.gzarchives with.sha256files as workflow
artifacts.Release checksumsnow runs on every run, not only onv*
tags:scripts/release-checksums.shchecks each runner's.sha256, that
all three targets are present, that each archive holds only the binary,
LICENSEandNOTICE, and that nothing else is in the set, then writes
and re-checks oneSHA256SUMS(the three archives andpraetore-verify).
scripts/test-release-checksums.shcovers those failures. Only av*tag
keeps the result as therelease-assets-<tag>artifact. - A pushed
v*tag now creates the GitHub Release (jobrelease-publish):
SHA256SUMSis signed with Sigstore keyless signing
(SHA256SUMS.sigstore.json, verified against the workflow identity before
publishing), the notes are the tag'sCHANGELOG.mdsection
(scripts/release-notes.sh, tested byscripts/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
changedSHA256SUMSthat must not verify. CI still holds no long-lived
signing key. The macOS binaries are not signed or notarized. release-publishnow needs every otherassurance.ymlgate, not only the
release artifacts; a tag that does not equalvplus 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.0requires.- Breaking (sandbox supervisor configuration):
schema_version1 → 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 ifparametersis not an object, has a key the route does not
declare, has a value of another kind, or lacks a required key. Onlypath
andpath_listvalues get the lexical path check; free text instring
values is not path-checked. The check is fail-closed and much stricter
than in 0.3.0. Apathvalue, and everypath_listelement, 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_BYTESandMAX_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
.envora/.git/config, and...(a leading
.is rejected on purpose; this may be relaxed later); - option-like names such as
-rf,--ora/-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 as100%.txt; - every non-ASCII character, including accented letters and homoglyphs
such as Cyrillicа(U+0430) or full-widtha(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
pathorpath_listare path-checked: a
stringvalue such as../../etc/passwdis accepted. Declare aspath
every key the runner uses as a path. - Path migration for callers: send
xinstead of./xanddir
instead ofdir/, 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 apathorpath_listparameter. Free text
belongs in astringkey. - Kinds:
path,path_list(array of at most 64pathvalues, 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 asorderId,
order-idorPathtoorder_idorpath. "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::newreturns, andpraetore-sandbox-supervisor
exits with (mainreturns 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": 2and addparametersto every route.
Before (v1):After (v2):{"schema_version": 1, "runner_image": "…@sha256:…", "routes": [ {"tenant_id": "…", "action_type": "orders:create", "target": "orders-api", "capability": "orders:write", "tool_profile": "orders-create"}]}Declare every key the tool actually receives: after the upgrade, a{"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}}}]}
request with an undeclared key is refused.
- an empty value, an empty segment (
praetore journal-export --tenantorders 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 ofpraetore_runtimeconfined by RLS without the SQL
filter, fail closed without the tenant setting, no writes; row order with
ties; andpraetore journal-export --tenantpluspraetore-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_FILEbuilds a chain from a
directory of receipts or from one tenant'spraetore.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
\nand\ris rejected (before,lines()accepted CRLF and a missing
final newline, and a file with only\nfailed asJOURNAL_CHAIN_FAIL,
nowINVALID_REQUEST); failures print the entry on stderr; test fixtures
updated forDecision::allow(reason, DecidedBy).examples/claude-code-hook/evidence/0{3,4,5}-*/journal-chain.jsonl
(22, 8 and 118 entries; receipts unchanged), heads inVERIFY.md,
verify-chain.sh, and ajournal-chainCI 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 aPathPrefixrule are
resolved through the filesystem before evaluation. Unless an absolute value
resolves to itself (no symlink,./.., dangling link or missing parent),
the engine seespraetore-mcp:path-check-failed, which core treats as an
unsafe path (every DENY / REQUIRE_APPROVALPathPrefixrule matches, no
ALLOW one). Receipts recordcontext["praetore.path_check"]; forwarded
bytes are unchanged. Core'sPathPrefixstays lexical. Behavior change: on
macOS,/tmp/...arguments under such a rule are now refused or not
allowed; use resolved paths.policycommands andpolicy checkwarn
about prefixes that resolve elsewhere. The check is point-in-time (TOCTOU).
A path that resolves to itself but is at or under a policyPathPrefix
only when compared like the filesystem compares names (case folding and/or
NFC: APFS, HFS+, casefolded ext4/f2fs, unknown filesystems), not byte for
byte, isambiguousand 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 ...
v0.3.0
-
The gateway-service sandbox supervisor rejects a dispatch request when any
string value inaction.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 MCPtools/callthrough 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/uninstallprocess a config file once when two
default paths name it (Cursor's~/.cursor/mcp.jsonand
./.cursor/mcp.jsonwhen 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 against9735974). -
praetore-mcp <command> --help/-hprints that command's usage and
exits 0 (it used to fail withunexpected argument "--help").--help
afterwrap ... --is still passed to the MCP server.praetore-mcp versionis an alias of--version. Exit codes (0, 1, 2, andwrap's
server code / 127) are documented in--helpand the praetore-mcp README. -
praetore-mcp wrap --mode observeno longer forwardstools/callwithout
receipts when the home cannot be loaded at startup (not initialized, or
invalid keys, pins, authority or policy). Both modes now refuse every
tools/callin that case and printevery 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'srule_idequals its recovery obligation's),
UnboundRule { rule_id }(a REQUIRE_APPROVAL/RECOVER rule matched
without its required capability or target and denied instead),
DefaultDenyandEngineGuard { 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 carrydecided_by, so existing
receipts, golden vectors and fixtures keep verifying byte-for-byte; v4
must carry it.decided_bymust be consistent with the outcome,
recovery obligation and contributions; unknown kinds, unknown fields and
an explicitnullare 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:
Decisionhas a requireddecided_by: DecidedBy(JSON without
it does not deserialize);Decision::allow/deny/require_approvaltake it
as a second argument (Decision::recoverderives it from the
obligation).Evidence.decisionis now aRecordedDecision(the read
path) whosedecided_byis optional, crate-private and read via
decided_by();Decisionconverts with.into().Evidence::newand
attestreject a decision that violates these invariants. Consumers that
comparedevidence_schema_versionto 2/3 should use
is_high_assurance_shape()anddecision.recovery. - Dispatch revalidation compares a legacy (pre-v4) record on every field
exceptdecided_by, so approvals pending across the upgrade can still be
dispatched; v4 records must matchdecided_bytoo. - Test fixtures in
packages/praetore-python/tests/fixtureswere
regenerated as v4; the previous v1/v2 bytes are kept in
fixtures/legacy-evidence/and still verify.
-
New crate
praetore-mcp(binarypraetore-mcp): a local stdio MCP proxy
for Claude Desktop, Cursor and VS Code that needs no PostgreSQL and no Rust.
initcreates LOCAL/DEV issuer, agent and attester keys (0600), a signed
authority,praetore-verify-compatible trust pins and a default v2 policy.
wrapevaluates every client→servertools/callin HighAssurance mode and
appends attested evidence to an fsynced JSONL journal. Inobservemode
(the default) calls are always forwarded and only recorded. Inenforce
mode DENY and REQUIRE_APPROVAL are blocked with an MCPisErrorresult,
and errors fail closed. The mode is bound into the signed evidence as
context["praetore.mode"].install/uninstallrewrite and restore
client configs, writing a backup and asking for confirmation first.
receiptsandverifyread and check the journal.policy list|check|deny|require-approval|allow|removemanage 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-toolis 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-coreis unchanged. -
praetore-verify evidenceaccepts--policy PATH: the receipt must record
that policy's digest (Evidence::verify_policy); receipts without a digest
fail withPOLICY_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 branchfeat/journal-chain-verifieruntil 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.shregenerates the legacy receipt
fixture (nopolicy_digest) from commit 3db7b5e. -
Breaking (core):
Evidence::signnow refuses to sign a receipt that does
not record the full lowercase SHA-256 digest of the active policy
(policy_digest, fromPolicy::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 (nopolicy_digest) still deserialize and verify.
Callers that sign evidence directly (not throughPolicyEngine) must call
Evidence::bind_policy_digestfirst. -
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_digestwas
recorded in uppercase hex still deserialize and verify, but cannot be
re-signed, becauseEvidence::signonly accepts the lowercase SHA-256 hex
produced byPolicy::digest();verify_policyalso rejects them. -
Security (gateway HTTP API): caller authentication.
http_api::routerand
serve_localnow take anApiAuth.ApiAuth::Required(ApiCredentials)
requiresAuthorization: Beareron 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:agentmay execute and
read status; onlyapprovermay read challenges, decide and dispatch.
Unauthenticated: 401authentication_required; wrong role or tenant: 403
caller_not_authorized.- Breaking (gateway service):
PRAETORE_GATEWAY_API_CREDENTIALS_FILEis
required with thehttpandsandboxadapters and for any non-loopback
PRAETORE_GATEWAY_LISTEN_ADDR. Onlylocal-demoon loopback may run
unauthenticated, andlocal-demonever listens beyond loopback. - The freshness snapshot is read with a bounded read (not only a
metadatasize check), and a snapshot whoseissued_atis older than
one already loaded is refused (fail closed), so a stale sync or restored
backup cannot undo a revocation. - Breaking (CLI):
praetore initcreatesagent-api.tokenand
approver-api.token;run,demo,approve,rejectanddispatch
use them. Older demo directories need a freshinit.
- Breaking (gateway service):
-
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:
newPRAETORE_GATEWAY_APPROVER_BINDINGS_FILE; breaking: the single
PRAETORE_GATEWAY_APPROVER_KEY_ID/_PUBLIC_KEY_HEXpair is rejected with
http/sandboxunless 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:
httpandsandboxadapters 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 tolocal-demo. -
Security (gateway):
claim_dispatchindependentl...