Skip to content

Audit event schema

Schema version: 1

Every security-relevant action in Praxis emits an audit event. Events land in the built-in audit_events table and fan out to any configured external sinks (Settings → Audit Export).

This document is the wire format contract. Breaking changes bump schema_version.


Wire format

{
"schema_version": 1,
"event_uuid": "c9f1…",
"timestamp": "2026-04-22T00:00:00.000Z",
"action": "session.open",
"outcome": "success",
"actor": {
"user_id": 42,
"username": "alice",
"ip": "10.0.0.5"
},
"target": {
"kind": "session",
"system_id": 7,
"id": "123"
},
"context": { ... per-action payload ... }
}

Fields:

FieldTypeNotes
schema_versionintBumped on breaking changes. Consumers should reject unknown versions.
event_uuidstringStable ID. Dedup key for at-least-once sinks.
timestampISO 8601 UTCEvent time at the Praxis server.
actiondotted stringSee vocabulary below.
outcomesuccess / failure / denieddenied = permission gate rejected; failure = ran but errored.
actorobjectUser who triggered the action. All fields nullable.
targetobjectWhat the action applied to. All fields nullable.
contextobjectAction-specific payload. Stable within a given action+schema_version.

Action vocabulary

Sessions

ActionWhen it firescontext keys
session.openInteractive terminal session establishedlogin, fleet_role, cert_serial, ttl_s
session.closeUser clicked Disconnect or remote EOFreason, login
session.idle_killIdle timeout sweeper closed the sessionreason, login
session.max_durationCert TTL hit, hard closereason, login

Command execution

Actionoutcomecontext keys
command.execsuccess / failurecommand, exit_code, execution_time_ms, bypass_validation
command.execdeniedreason_code, reason

Package updates

Actionoutcomecontext keys
package.updatesuccess / failurehostname, package_names, package_count, result, packages_updated, packages_skipped, packages_failed, packages_unrecorded, and reason on a failure
package.updatedeniedreason_code, reason, and for a bulk request system_ids, system_count
package.direct_update.submittedsuccess / deniedoperation_id, plan_id, hostname, disposition, reason_code, policy_id, reboot_policy, approval_required, package_names, package_count
package.direct_update.canceledsuccessoperation_id, plan_ids
package.direct_update.unresolved_host_resolutionsuccess / deniedoperation_id, plan_id, result, host_check, delivery, queued_delivery_confirmed, reason
package.direct_update.reboot_reconciledsuccessreboot row fields as for other patch_update_execution_reboot events, with operation_id, previous_state, previous_decision_code

package.update is recorded once per host for a direct update from the package pages or the bulk update action, attributed to the operator who requested it and to the host in target. It is recorded when the host’s work ends, which can be long after the request when approval or a window held it. An event for work that ran through a generated plan also carries operation_id, plan_id, execution_id, and selected_packages. Scheduled jobs and other patch plan executions keep their own run history and do not emit this event.

Events of direct updates, including the patch_update_execution_reboot events for their reboot queue, are stored in the same transaction as the change they describe and then moved into the audit log. An interruption between the two delays an event until the next scheduled pass.

A direct update host whose command result was never received is settled later from what the host reports. It records patch_update_execution.host_succeeded or host_failed for that host with interrupted true, together with its package.update event.

package.direct_update.unresolved_host_resolution is recorded when an administrator resolves a host whose command result never arrived, attributed to that administrator, with the host’s execution row as the target. result is settled_from_host, closed_unresolved (closed as failed without evidence of what is installed), or refused_package_work_running with outcome denied. host_check is what the check of the host found (idle, busy, unknown, or versions_unreadable), and reason is the administrator’s stated reason, redacted and bounded. delivery is the transport recorded for the command (ssh, agent, or null when none was recorded), and queued_delivery_confirmed is whether the administrator confirmed that a queued command can no longer arrive, which any transport other than ssh requires.

package.direct_update.reboot_reconciled records that a reconcile changed an existing reboot row of a direct update other than by scheduling it, for example resolving unknown evidence to no reboot needed.

package.direct_update.submitted is recorded once per host when a request is accepted, and again, with joined true and the second caller as actor, when a later submission is answered by work that is already open. disposition states what policy allowed at that moment (immediate, approval_required, waiting_window, waiting_wave, blocked, no_changes, or already_in_progress); outcome is denied for a blocked host. See direct updates.

result reports what the host showed before and after the command, not the package manager exit code. The service reads the installed versions from the host itself on both sides of the command rather than from the stored inventory, which may predate the request, so a change is credited to the request only when the two readings differ:

  • updated: the attempted packages moved to their new version, or the two readings show other packages changed (outcome is success).
  • no_change: nothing was pending, or the command ran and the two readings show nothing moved (outcome is success). A package already at its target before the command is not counted.
  • partial: a verified change accompanies a tracked package that did not move, whether the verified change is a tracked package or one without a history row (outcome is failure).
  • failed: the command exited nonzero, the host could not be reached, or no verified change accompanies the tracked packages that did not move (outcome is failure).
  • unverified: the command exited cleanly but either reading was unavailable (a listing that exits nonzero is unavailable even when it printed a package list), so the effect cannot be attributed to the request (outcome is failure, so it is never read as a confirmed success). History rows for the request are closed as failed with a message saying the result could not be verified.

packages_updated counts packages with a history row that were verified at their new version by this request. In the API response the integer counts only moves the two readings attribute to the request, so it is 0 when the reading before is missing even though the history row records the version observed afterward. packages_unrecorded counts packages whose installed version changed between the two readings with no history row to verify them, for example a dependency that the package manager moved along with a selected package. A count that was not measured is null, not 0: after a failed command or a connection error packages_updated and packages_unrecorded are null, and packages_failed is null unless history rows were marked failed. The same holds for unverified, where packages_updated and packages_unrecorded are null and packages_failed is null unless a reading after the command was available. package_names is the list the operator named, or null when all pending updates were requested, capped at 50 entries with package_count giving the full size. reason is redacted text capped at 512 characters; an unexpected error records only its class name.

A refusal of an authenticated caller records outcome denied before the unchanged 403 or 404 response. reason_code is role_not_permitted or system_not_in_scope. A single-host refusal names the requested id in target.id and links the host only when it exists, so a probe of an unknown id leaves no host link; a bulk refusal links every existing host the caller lacked scope on. Denied events never carry a hostname. A request for a host whose packages are already covered by an open operation records no package.update event; that operation records the outcome. Unauthenticated requests record nothing.

File transfer

ActionWhen it firescontext keys
file.uploadWeb UI → host SFTP uploadlogin, size_bytes, sha256, local_filename, error?
file.downloadHost → web UI SFTP downloadlogin, size_bytes, sha256, error?
file.mkdirNew remote directorylogin, error?
file.unlinkRemote file/dir deletionlogin, error?

target.kind is path and target.id is the remote path.

A download that fails, ends short, or is abandoned by the client emits outcome failure with error set and no sha256. error is client_disconnected when the client went away mid-transfer.

Access bindings + requests

Actioncontext keys
binding.createfleet_role_id, subject_user_id, subject_app_role_id, scope_group_id, scope_smart_group_id, expires_at
binding.deleteSnapshot of the deleted binding shape
access_request.createfleet_role_id, scope_group_id, scope_smart_group_id, duration_seconds, justification
access_request.approverequested_by, fleet_role_id, resulting_binding_id, duration_seconds, comment
access_request.rejectrequested_by, comment
access_request.revokenone

Authentication

Actioncontext keys
totp.step_upmethod = totp or recovery

First-run initialization

An installation provisions its administrator once and records that it did. These events describe that record. They originate from startup rather than from a request, so actor is empty on all four: an operator identity here would be invented, and a reader could not tell it from a real login. target.kind is bootstrap_admin and target.id is null, because the subject is the installation’s own state and not a user row. No context field carries or describes credential material.

ActionWhen it firesoutcomecontext keys
bootstrap.admin.provisionedThe first administrator is created on an installation that has nonesuccessusername, user_id, state
bootstrap.admin.adoptedAn installation that already has users is recorded as initialized. Nothing is created, modified, reactivated, or re-roledsuccessusername (the configured one), matched_existing, user_id (null when nothing carries that username), user_count, state
bootstrap.admin.suppressedA restart supplies an administrator password while nothing carries the configured username, on an installation already recorded as initialized. This is the state that would otherwise resurrect a deleted administratorsuccessusername
bootstrap.admin.resetAn operator clears the record so the installation can provision again, or is refused because a user still existssuccess / deniedon success previous_state, username; on refusal reason, user_count

bootstrap.admin.provisioned and bootstrap.admin.adopted fire at most once per installation, and each is written in the same transaction as the record and the account it describes, so neither can exist without the other. bootstrap.admin.suppressed fires at most once per backend start, and only in the narrow state above; an installation whose administrator password has been cleared after first run never emits it.

Secrets, Vault & PKI

Sensitive secret and PKI actions emit unified audit events so secret access and CA lifecycle changes reach external sinks. context carries only locators and non-secret metadata, never secret values, passwords, private keys, certificate material, tokens, or raw Vault exception text.

ssh.user_cert.sign fires when Vault signs a short-lived SSH user certificate for host access, at mint time (independent of whether the subsequent SSH connection succeeds), for the actor-attributed paths: interactive sessions (purpose=session) and web file transfer (purpose=file_transfer). Backend SSH that reuses the pooled connection helper (e.g. command execution) has no single user actor at the mint point; that host access is audited via its parent command.exec event instead. Note session.open separately records the same cert_serial as part of the session lifecycle.

ActionWhen it firescontext keys
credential.secret.revealA credential’s secret is revealed from Vaultname, auth_method, vault_path
credential.createNew credential created (managed or linked)name, auth_method, vault_path, mode
credential.updateCredential metadata and/or its Vault secret updatedname, auth_method, secret_updated (bool)
credential.deleteCredential deleted (Vault secret + DB metadata)name, auth_method
vault.secret.readDirect Vault secret read (incl. specific version)vault_path, version?
vault.secret.writeDirect Vault secret create/updatevault_path
vault.secret.password_updatePassword field updated within a Vault secretvault_path, username
vault.secret.deleteDirect Vault secret deletedvault_path
ssh.user_cert.signShort-lived SSH user cert minted for host accesslogin, ttl_s, cert_serial, purpose
ssh.ca.rotateSSH CA keypair regenerated in Vaultnone
ssh.ca.revoke_user_certsSSH CA identifier bumped and pooled sessions droppednone

target.kind is credential (with target.id = credential id), vault_secret (with target.id = vault path), system (for ssh.user_cert.sign when the target system is known; otherwise ssh_user_cert), or ssh_ca.

Guided system onboarding

A setup holds no secret and creates nothing until it finishes, so these events record decisions and outcomes rather than state changes. target.kind is onboarding_draft and target.id is the setup’s opaque handle, except on a successful finish, where the target is the host that now exists.

actionWhenoutcomecontext
onboarding.draft.createAn operator opens a guided setupsuccessnone
onboarding.draft.cancelAn operator abandons a setupsuccessnone
onboarding.verifyA verification run completessuccess when verified, else failurereason_code, checks (per-check check / status / reason_code)
onboarding.host_key.decisionAn operator approves or rejects an offered host keysuccess on approval, denied on rejectiondecision, fingerprint, key_type
onboarding.verify.skippedAn operator explicitly declines verificationsuccessnone
onboarding.discoverDiscovery completessuccesssupport_mapping, package_family
onboarding.finishFinalization is attemptedsuccess, failure, or deniedon success hostname, status, verification_skipped, host_key_decision; otherwise code

Verification context carries reason codes only. The transport and library text behind a failure is never recorded, so an audit row cannot leak a path, a key, or an internal hostname.

Advisory feeds

Publisher advisory feed configuration and refresh outcomes. target.kind is patch_advisory_feed and target.id is the source kind (debian_security, ubuntu_usn, redhat_updateinfo, or the enrichment sources cisa_kev and cve_list_v5). Context never carries response bodies, tokens or local paths; error text is redacted and bounded.

ActionoutcomeWhen it firescontext keys
patch_advisory_feed.configuredsuccessAn administrator changes a feed’s enabled flag, interval or scope. A request that changes nothing is not recordedsource_kind, changes (map of changed field to its old and new value, or the new scope, and withdrawn_for_scope when narrowing the scope withdrew advisories)
patch_advisory_feed.refresh_completedsuccessA refresh finished with status success or unchangedsource_kind, run_id, trigger (scheduled / manual), status, imported, refreshed, unchanged, withdrawn, errors, source_timestamp, revision, error (always null), import (false)
patch_advisory_feed.importedsuccessA document loaded from a file (CISA KEV catalog or CVE records) was applied with status success or unchanged. A failed import is recorded as refresh_failedSame keys as .refresh_completed, with import true
patch_advisory_feed.refresh_failedfailureA refresh failed; the previous snapshot was retainedSame keys, with status failed and a redacted error
patch_advisory_feed.refresh_skippedsuccessA scheduled or manual refresh was skipped because offline mode is onsource_kind, trigger, reason (offline)
patch_advisory_feed.stalefailureA feed’s last successful refresh passed its freshness deadline (twice the interval). Recorded once per transitionsource_kind, last_success_at, interval_hours, stale_after_hours, offline, at
patch_advisory_feed.recoveredsuccessA stale feed completed a successful refresh. Recorded once per transitionSame keys as .stale

A manual refresh carries the requesting operator as actor; scheduled refreshes and the freshness watchdog have no actor. See advisory feeds.

Patch findings

Operator actions on a host’s patch findings. target.kind is system and target.id is the host id. Neither action changes a verdict, marks a package fixed, or starts a remediation. Context never carries the free-text review reason; that stays with the review itself.

ActionoutcomeWhen it firescontext keys
patch_finding.reviewedsuccessAn administrator or maintainer recorded a reasoned review of a potentially vulnerable finding, bound to the evidence digest and review the operator was shown. A refused or stale review is not recordedfinding_key, package, arch, decision (likely_affected / likely_not_affected / needs_investigation), replaced_review (whether an earlier review for the same finding was superseded), previous_decision, supersedes_event_id, event_id (the history entry), evidence_basis (the digest the review was written against), review_id, verdict (always potentially_vulnerable)
patch_finding.recheck_requestedsuccess or failureAn administrator or maintainer asked for the host’s installed packages to be collected again. failure when the scan could not run, in which case the previous evidence is unchangedscan_status

See patch prioritization.

Patch remediation

Governed remediation of host CVEs and the rules that raise it. Item events use target.kind patch_remediation_item and target.id the item id, with target.system_id the host. Rule events use target.kind patch_remediation_rule and target.id the rule id. Every item event carries the same stable keys so one item can be followed from staging to verification: item_id, origin (manual or rule), rule_ids, status, package, installed_version, candidate_version, cves (each with cve_id, advisory_ids, expected and outcome), rationale, plan_id, execution_id, approval_id and verification. The approval, start and per-host execution events of the patch plan itself are recorded separately, as listed under package updates, and carry the same plan and execution ids.

ActionoutcomeWhen it firesExtra context keys
patch_remediation.stagedsuccessA draft patch plan was created for a package change, by an operator or by an enabled rule. The actor is the operator, or the operator who enabled the ruleplan_id, plan_name
patch_remediation.deduplicatedsuccessA request or rule matched a package change that an active item already covers; the rule is recorded behind the existing item and no new work is createdrequested_by_rule
patch_remediation.status_changedsuccessAn item’s status changed, for example after approval, dispatch, a failed run or verification from fresh packagesprevious_status, reason
patch_remediation.dispatch_deferredsuccessUnattended dispatch did not start and the reason changed: a rule was disabled or no longer dispatches, the enabling operator lost authority, the maintenance window is closed or unusable, the host is offline, or the start gate refused. Fires once per change of reasonitem_id, plan_id, rule_ids, code, message
patch_remediation.host_reconciledsuccessA host left running by an interrupted execution was resolved from package evidence collected after dispatch began, or left unresolved with the reasonexecution_id, execution_host_id, system_id, state (succeeded, failed or unresolved), reason
patch_remediation_rule.createdsuccessAn administrator or maintainer created a rule. Rules are created disabledrule_id, name, mode, scope_kind, scope_id, criteria, enabled
patch_remediation_rule.updatedsuccessA rule was changed. A change to what it selects or does disables itSame keys, plus definition_changed
patch_remediation_rule.enabledsuccessA rule was enabled with the confirmation issued by this operator’s preview of its current definition. The actor is the operator whose authority the rule usesSame keys
patch_remediation_rule.disabledsuccessA rule was disabledSame keys
patch_remediation_rule.deletedsuccessA rule was deleted. Items it staged remainSame keys
patch_remediation_rule.evaluatedsuccessA rule was evaluated, on a change in evidence, on the periodic sweep, or on requestrule_id, rule, trigger, evaluated_at, staged, deduplicated, waiting, error (set when the enabling operator no longer has authority)

See patch remediation.

Third-party update discovery

Administrator changes to the repositories trusted as sources of package updates. target.kind is update_origin_trust and target.id is the entry id. The stored origin never carries credentials, queries or fragments.

Actionoutcomecontext keys
update_origin_trust.createdsuccesspackage_manager, origin, label, enabled, allow_installed_origin_change, channels
update_origin_trust.updatedsuccessThe same keys plus changes, a map of each changed field to its old and new value (notes is recorded as true). A request that changes nothing is not recorded
update_origin_trust.deletedsuccesspackage_manager, origin, label, enabled, allow_installed_origin_change, channels

Application host checks, verification and the loading of vendor release notices are recorded beside them. Host checks and verification are read-only; an operator’s run writes the event whatever the result, and no event carries raw command output. Later reads of both states come from the newest event of that application on the host, except that a passing host check does not replace a failed one recorded after it began.

ActionoutcometargetWhen it firescontext keys
third_party_application.host_check_recordedsuccess when every check passed, otherwise failurekind application, id the mapping id, system_id the hostAn administrator or maintainer ran the read-only host check of an offered application update (Grafana), or the checks repeated immediately before an install refused it. A refusal is written in a transaction of its own, so it remains if the dispatch is rolled back; the actor is who dispatchedmapping_id, binding (exactly what was checked: package_id, package, edition, manager, architecture, installed_version, installed_epoch, installed_origin, installed_origin_evidence, offered_version, offered_epoch, offered_architecture, offered_sources as repository and channel pairs, offered_sources_complete), state (passed, failed or unknown; a refusal is never passed), source (operator or dispatch), started_at (when the host began to be asked, or when a refusal was recorded), checks (a list of id, status and detail; status is pass, fail or unknown. Ids are artifact_identity, package_manager_offer, service_health, database, plugin_compatibility, recovery_readiness, free_space and, for RPM, installed_location and offered_location; prerequisites stands alone when none could be judged), artifact (what the installed files were compared with, when the application compares them: package, version, epoch, architecture, state (pass, fail or unknown) and, as far as reached, error (unavailable, unauthenticated, missing, ambiguous or invalid), the artifact url, sha256 and size, the signed metadata address, signed_by (key fingerprint), signed_at, files_compared, configuration_differences, difference_count and differences (at most 10 of each, as a file path and what differs)). Details can name plugin directories, database file paths and files of the application
third_party_application.verification_recordedsuccess when the result is verified, otherwise failurekind application, id the mapping id, system_id the hostAn administrator or maintainer ran Check running version and health for a mapped applicationmapping_id, package (the server package checked), package_id (its inventory record), installed_version (the package version checked), epoch (the approved or installed epoch, or null), architecture, state (verified, failed or pending), running_version (what the running service reported, or null), revision_source (live when the package manager answered, audited when the inventory stood in, or null), acquisition (for an APT package, recorded, not_recorded or not_applicable: whether the installed origin was bound to a governed installation), checks (a list of id, status and detail; status is pass, fail or unknown. GitLab ids are installed_code_version, package_revision, running_identity, services_running, restarted_after_install and readiness; Grafana ids are installed_code_version, package_revision, service_running, listener, restarted_after_install, running_version and health)
vendor_release_notices.importedsuccesskind vendor_release_notices, id the vendor (gitlab)An administrator or maintainer loaded the vendor’s patch release feed, from a file (origin import, unsigned and never used as evidence) or from the official address (origin fetch). A document that is refused is not recordedvendor, origin (import or fetch), imported, refreshed, unchanged, stale (an older revision that did not replace a newer one), protected (an unsigned import that was not allowed to touch a retrieved notice) and skipped (entries that did not validate, including a missing or invalid date)

The package_revision check compares the exact epoch-qualified revision, so its detail reads like 0:17.5.4-ce.0 installed, not the expected 0:17.5.4-ce.1. Context never carries notice text, CVE content or host command output. See third-party repository updates.

A patch plan host whose selected candidates no longer qualify when it is dispatched records patch_update_execution.host_failed with error_code candidate_revalidation_failed and a failures list. Each failure names the package, the version and its blockers, each with a stable code (held, untrusted_origin, unknown_origin, stale_metadata, unverified_metadata, missing_metadata, capability_unsupported, not_qualified, candidate_changed, candidate_not_offered, origin_changed, installed_changed, installed_origin_unknown, installed_origin_differs, installed_origin_changed, installed_artifact_unverified, downgrade, same_version, version_unreadable, epoch_unknown, pin_changed, ambiguous_origin, incomplete_origin_evidence, ambiguous_architecture, identity_incomplete, probe_failed) and a message.

Airgap signing keys and import trust

Airgap bundle signing-key and import trust-pin lifecycle events carry only public identifiers and status metadata. Context must never include armored key bodies, private key material, Vault paths, bundle tar contents, or raw GPG/Vault exception text.

ActionWhen it firestarget.kindcontext keys
airgap.signing_key.createdInitial instance bundle signing key is bootstrappedairgap_signing_keykey_id, fingerprint, key_uid, status
airgap.signing_key.rotatedActive bundle signing key is rotated: old active becomes rotating_out, new key becomes activeairgap_signing_keyold_key_id, old_fingerprint, old_status, new_key_id, new_fingerprint, new_status
airgap.signing_key.retiredA rotating_out bundle signing key is retiredairgap_signing_keykey_id, fingerprint, status
airgap.import_trust.addedImport-side public key trust pin is addedairgap_import_trustkey_id, fingerprint, key_uid
airgap.import_trust.removedImport-side public key trust pin is soft-deletedairgap_import_trustkey_id, fingerprint, key_uid

Compliance remediation requests

Non-executing workflow that captures operator intent to remediate a failing compliance evidence row plus the approval-gate state. Approval flips the request state only: no host mutation, no command execution, no dispatch.

target.kind is compliance_remediation_request and target.id is the request id. target.system_id is the host the request applies to.

All four actions emit outcome=success (no denied or failure paths in the current release; validation errors raise before any audit row is written).

Stable context keys present on every action: policy_id, policy_slug, policy_version, check_id, check_slug, check_kind, system_id, evidence_id, evaluation_run_id, verdict_snapshot, severity_snapshot, state, requested_by, decided_by.

ActionWhen it firesAdditional context keys
compliance_remediation.requestedOperator opens a remediation request for a failing evidence rowhas_guidance_snapshot (bool), justification_length (int, 0 when omitted)
compliance_remediation.approvedAdmin approves the request; state flips to approved. Does NOT execute anythingseparation_of_duties_enforced (bool, always true in the current release), decided_reason_length (int)
compliance_remediation.rejectedAdmin rejects the request; terminal statedecided_reason_length (int)
compliance_remediation.cancelledAdmin or original requester withdraws the request; terminal stateself_cancel (bool, true when the requester withdrew their own request), decided_reason_length (int)

Compliance remediation plan previews

Non-executing execution-plan previews derived from approved remediation requests. Building a plan never runs anything on a host, dispatches a job, or mutates the source request. plan_steps is a JSON list of structured operator-readable intent objects (action, target, expected value, safety notes), NOT executable shell.

target.kind is compliance_remediation_plan and target.id is the plan id. target.system_id is the host the plan applies to.

All three actions emit outcome=success. Validation failures (e.g. building against a non-approved request) raise before any audit row is written.

Stable context keys present on every action: request_id, policy_id, check_id, system_id, policy_slug, policy_version, check_slug, check_kind, severity_snapshot.

ActionWhen it firesAdditional context keys
compliance_remediation_plan.builtFirst plan preview is generated for an approved remediation requestplan_state (planned / unsupported / failed), plan_kind, step_count (int), refreshed (bool, always false), superseded_plan_id (int or null)
compliance_remediation_plan.refreshedA non-acknowledged current draft plan is rebuilt in place (idempotent recompute; row id stable)plan_state, plan_kind, step_count, refreshed (bool, always true), superseded_plan_id (always null)
compliance_remediation_plan.unsupportedThe resolved plan kind is unsupported (paired with the matching built/refreshed event)unsupported_reason (string)
compliance_remediation_plan.acknowledgedOperator explicitly acknowledges the current plan (“this is what I intend to run”); metadata only, no executionplan_kind, ready_for_execution (bool)
compliance_remediation_plan.supersededAn acknowledged current plan is replaced by a fresh build (the new plan becomes current; the old one is locked as history)superseded_by_plan_id (int, the new current plan id)

The plan read envelope also exposes lifecycle metadata fields: check_definition_fingerprint, is_current, superseded_by_plan_id, acknowledged_at, acknowledged_by, is_stale, and ready_for_execution. These are derived/snapshot fields and are not separate audit events. ready_for_execution is the gate an execution flow consults; it is true only when the source request is still approved, the plan is current, state='planned', acknowledged, not stale, and of an executable plan_kind (i.e. one of package_install_preview / package_remove_preview / package_upgrade_preview; review-required kinds always read false).

Compliance remediation execution attempts

Durable, pre-dispatch record of an operator’s intent to execute a current acknowledged ready-for-execution package remediation plan. The .created action persists the snapshot + actor + approval lineage and emits one audit event; it does not run commands, dispatch jobs, queue work, mutate hosts, refresh facts, scan packages, reboot, or roll back. The dispatch actions below add transport selection, dispatch, and outcome recording on top of the same row via .dispatched / .succeeded / .failed / .cancelled events.

target.kind is compliance_remediation_execution_attempt and target.id is the attempt id. target.system_id is the host the attempt applies to.

The readiness gate is re-checked at write time so a stale UI cannot bypass it by replaying a previously-true ready_for_execution flag. Validation failures (missing plan, superseded plan, non-planned state, unacknowledged, stale, non-package plan_kind, source request no longer approved) raise before any audit row is written.

ActionWhen it firescontext keys
compliance_remediation_execution.createdOperator creates a durable execution-attempt row for an acknowledged, ready, package remediation plan. State persists as pending; nothing dispatches yet.attempt_id (the attempt id; also surfaced as the target.id), request_id, plan_id, policy_id, check_id, system_id, policy_slug, policy_version, check_slug, check_kind, severity_snapshot, plan_kind_snapshot (one of the three executable package plan kinds), package_name (nullable when the plan was built against a deleted check), package_version_target (set for upgrade plans), state (always pending for this action), approval_decided_by (snapshot of the request’s approver, nullable if the user row is later deleted), dispatched (bool, always false for this action)
compliance_remediation_execution.dispatchedOperator dispatches a pending attempt through the governed patch transport. State flips from pending → dispatched; dispatched_at is set. The audit row commits BEFORE the transport call so a transport hang still leaves a durable record.Same stable keys as .created (without dispatched), plus package_family (apt / dnf) and command_program (the argv[0], i.e. apt-get or dnf)
compliance_remediation_execution.succeededDispatch returned exit 0 with no transport error. State flips from dispatched → succeeded; completed_at set; exit_code, duration_ms, transport, bounded stdout_summary / stderr_summary written to the attempt row.Same stable keys as .created (without dispatched), plus package_family, exit_code (always 0), duration_ms, transport, failure_reason (always null)
compliance_remediation_execution.failedDispatch returned a non-zero exit code, the transport raised, or the adapter raised. State flips dispatched → failed; failure_reason carries the short stable code (transport_unavailable, transport_error, package_manager_failed, etc.); error_message carries a bounded operator-readable summary.Same stable keys as .created (without dispatched), plus package_family, exit_code (may be -1 for transport errors), duration_ms, transport, failure_reason
compliance_remediation_execution.batch_dispatchedOperator triggers a bounded request-scoped batch dispatch. The batch loops dispatch_attempt(...) over every pending attempt for the named request (capped by limit, default = MAX_BATCH_SIZE = 500); per-attempt .dispatched / .succeeded / .failed events still fire from the inner path. This event records the aggregate once per batch call, after the loop finishes. target.kind is compliance_remediation_request (not the attempt) because the batch is request-scoped; target.id is the request id.request_id, policy_id, policy_slug, check_slug, check_kind, system_id, limit, total_eligible (≤ limit), dispatched_count (succeeded + failed; excludes refused), succeeded_count, failed_count, refused_count (count of attempts whose pre-flight ComplianceError left the row in pending), failure_breakdown_by_reason (dict keyed on failure_reason for the failed subset)

The attempt read envelope additionally exposes approval_decided_at, transport, failure_reason, error_message, exit_code, duration_ms, stdout_summary, stderr_summary, dispatched_at, and completed_at. These are reserved on pending attempts and populated on the same row as the attempt moves through dispatched → succeeded | failed. Bounded fields: stdout_summary / stderr_summary are truncated to 64 KiB each at the service layer; error_message is truncated to 2048 chars; transport and failure_reason are bounded by the column type.

The readiness gate is re-checked at dispatch time so a stale UI cannot bypass it by replaying a previously-true ready_for_execution flag. Lineage drift (mismatched request_id, plan_kind drift, missing package_name, unsafe package_name, missing/unparsable upgrade version target, unknown host package-manager family, source request no longer approved, plan superseded/stale/unacknowledged/non-planned) raises before any audit row is written and before any host mutation. The dispatch path uses only the governed transport seam (patch_execution_dispatch_service.default_dispatch); there is no raw SSH/agent/subprocess/local-fallback path.

Patch reboot actions

target.kind is patch_update_execution_reboot and target.id is the reboot row id, with the host in target, unless noted.

Automatic sends and verifications are recorded with the actor username reboot-worker and trigger automatic in the context. An automatic send also carries authorized_by, the id of the operator who started the run.

ActionWhen it firescontext keys
patch_update_execution_reboot.queued, .scheduled, .skippedA reconcile queues, schedules or skips a rebootreboot row fields
patch_update_execution_reboot.started / .dispatch_failedA reboot command was sent, or sending it failedreboot row fields, the send result, reason for a send an operator requested
patch_update_execution_reboot.verification_passed / .verification_failedA reboot is proven, or fails verificationreboot row fields and the verification reason. When Praxis stopped while sending and no .started or .dispatch_failed was recorded, also dispatch_result (not_recorded) and send, with the send’s trigger and its authorized_by or reason
patch_update_execution_reboot.send_requestedAn operator used Send now, before anything is sentoperator fields
patch_update_execution_reboot.skipped_by_operatorSkipoperator fields, decision_before
patch_update_execution_reboot.rescheduledRescheduleoperator fields, previous_scheduled_for_at
patch_update_execution_reboot.verification_requestedVerify now, before the host is askedoperator fields
patch_update_execution_reboot.verification_retriedRetry verificationoperator fields, previous_reason
patch_update_execution_reboot.resetResetoperator fields, previous_attempt with the earlier send, its result and the facts that proved no restart
patch_update_execution_reboot.evidence_recheckedRe-check evidenceoperator fields, evidence_outcome, reboot_required, decision_code
patch_update_execution_reboot.acknowledgedAcknowledgeoperator fields
patch_update_execution_reboot.batch_paused (target.kind patch_update_execution)Pause reboots, or the failure threshold, which has no actorexecution_id, plan_id, old_state, new_state, source (operator or threshold), reason, changed_at, threshold
patch_update_execution_reboot.batch_resumed (target.kind patch_update_execution)Resume rebootsold_state, new_state, reason, accepted_reboot_ids, changed_at
patch_update_execution_reboot.batch_canceled (target.kind patch_update_execution)Cancel rebootsold_state, new_state, reason, changed_at, dropped with each reboot’s host and old and new state

Operator fields are execution_id, execution_host_id, plan_id, system_id, system_hostname, reason, old_state, new_state, scheduled_for_at and at. A control that is refused records nothing, except that send_requested and verification_requested record the request before its outcome.

Patch reboot reconciliation

The reboot queue for an execution is rebuilt by a reconcile pass. When that pass raises, the failure is recorded rather than left to a log line, because the queue counts are what an operator reads as “what still has to reboot”.

target.kind is patch_update_execution and target.id is the execution id.

ActionWhen it firesoutcomecontext keys
patch_update_execution_reboot.reconcile_failedA reboot reconcile pass for an execution raises, and the failure is surfaced. A queue that merely reads as incomplete does not emit this actionfailureexecution_id, plan_id, phase, wave_index, reason (redacted and bounded), recorded (bool, whether the marker was persisted on the execution)

The same failure raises a patch.reboot_required notification at error severity and blocks dependent waves. See when the reboot queue is incomplete for the operator path.

Patch and compliance notifications

This release expands the notification vocabulary alongside the existing audit-event vocabulary. Notifications flow through the existing notification_service.create_notification → alert_service.send_alert path: per-user disable (notification_preferences), per-fleet smart-group scope, and the existing retry/dead-letter behavior all apply unchanged. There are no new audit-event actions here; emission lives beside the existing service-level audit emits at the same stable state transitions, and the helper functions in app.services.notification_events are best-effort (failures log + swallow so an audit event always wins precedence).

Event vocabulary (each is also a valid disabled_types entry on the /notification-preferences route and a valid events[] entry on an AlertConfig):

EventSeverityFires from
patch.executedinfo on succeeded, warning on canceled, error on failedpatch_execution_dispatch_service._maybe_finalize_execution when an execution reaches its terminal state
patch.reboot_requiredwarning on a queued reboot, error on a failed reconcilepatch_reboot_service.auto_reconcile_on_terminal when a queued reboot row is added for a host that needs a reboot, and patch_reboot_service.surface_reconciliation_failure when a reconcile pass raises. A queue that merely reads as incomplete raises no notification
patch.reboot_completedinfo on healthy, error on failedpatch_reboot_verify_service once per row’s terminal verify transition, automatic or requested
patch.rollback_startedwarningpatch_rollback_dispatch_service.start_rollback_execution
patch.rollback_completedinfo on succeeded, warning on canceled, error on failedpatch_rollback_dispatch_service._maybe_finalize_run when the run reaches its terminal state
compliance.evaluatedtracks the dominant per-host verdict (pass → info, fail → warning, error → error)compliance_evaluation_service.evaluate_policy_for_host after the evidence rows commit
remediation.requestedwarningcompliance_remediation_service.create_request after commit
remediation.readyinfocompliance_remediation_plan_service.acknowledge_plan only when the acknowledgement flipped ready_for_execution to true
remediation.executedinfocompliance_remediation_execution_service.dispatch_attempt on succeeded
remediation.failederrorcompliance_remediation_execution_service.dispatch_attempt on failed (carries failure_reason in the message body)

Titles and message bodies are bounded at 160 / 1024 chars respectively. Notifications are broadcast (no user_id target) so they appear in the unread feed for every operator who has the event enabled.

Patch and compliance reporting / exports

Manual operator-driven export endpoints for review-period reporting. Each event emits after the response body is built so the recorded row_count matches the bytes the operator received. target.id is null because the export is a bounded multi-row query, not a single-resource read. outcome is always success: bad windows, bad filter values, and row-cap violations raise HTTP 422 before any audit row is written.

ActionWhen it firestarget.kindcontext keys
compliance_export.requestedOperator downloads compliance evidence over a bounded review window via GET /compliance/exports/evidence.{jsonl,csv}compliance_evidence_exportformat (jsonl / csv), filters (evaluated_after, evaluated_before, policy_id, system_id, verdict), row_count
compliance_remediation_export.requestedOperator downloads compliance remediation requests over a bounded review window via GET /compliance/exports/remediation-requestscompliance_remediation_request_exportformat (csv / json), filters (created_after, created_before, policy_id, system_id, state), row_count
patch_execution_export.requestedOperator downloads patch update executions over a bounded review window via GET /patch/update-executions/exportpatch_execution_exportformat (csv / json), filters (started_after, started_before, plan_id, state), row_count
patch_plan_export.requestedOperator downloads patch update plans over a bounded review window via GET /patch/update-plans/exportpatch_update_plan_exportformat (csv / json), filters (created_after, created_before, policy_id, state), row_count
patch_reboot_export.requestedOperator downloads the per-execution reboot queue via GET /patch/update-executions/{id}/reboots/exportpatch_reboot_queue_exportformat (csv / json), filters (execution_id), row_count
patch_rollback_export.requestedOperator downloads the per-execution rollback dispatch run + per-host rows via GET /patch/update-executions/{id}/rollback/exportpatch_rollback_run_exportformat (csv / json), filters (execution_id), row_count
compliance_remediation_plan_export.requestedOperator downloads compliance remediation plans (current + superseded) over a bounded review window via GET /compliance/exports/remediation-planscompliance_remediation_plan_exportformat (csv / json), filters (created_after, created_before, policy_id, system_id, state, current_only), row_count
compliance_remediation_execution_export.requestedOperator downloads compliance remediation execution attempts over a bounded review window via GET /compliance/exports/remediation-executionscompliance_remediation_execution_exportformat (csv / json), filters (created_after, created_before, policy_id, system_id, state), row_count

Scheduled report runs do NOT add a new audit-event action: the scheduler tick (apscheduler report_schedules_due job, every 5 minutes) invokes the same per-kind dispatcher used by the manual export routes, so the same *_export.requested audit events fire from the scheduled-firing path. The only persisted difference is the matching report_runs row, which is written with triggered_by='system_scheduled' (vs 'user' for manual exports). Operators distinguish manual vs scheduled runs by reading the triggered_by column on GET /reports/runs. Schedule definitions live in the report_schedules table (admin/maintainer write, auditor read via GET /reports/schedules) with plain-language cadence (daily, weekly, or monthly). No cron expression ever reaches the wire.

Bounded review-window guard: created_after/created_before (and started_after/started_before) default to the last 30 days when both bounds are omitted and a single request cannot span more than EXPORT_WINDOW_MAX_DAYS = 366 days. The remediation-request and patch-execution exports additionally cap a single response at EXPORT_MAX_ROWS = 50_000; oversized filters raise HTTP 422 with operator-readable text rather than truncate. The compliance evidence export is streamed (yield_per) and therefore not row-capped.

RBAC: all three export endpoints require admin or maintainer. Auditors can read individual records through the per-resource detail routes but cannot trigger a bulk export.


Delivery guarantees

Events persist to the database synchronously with the action that emitted them (same DB transaction where reasonable). External sinks receive events at least once via the delivery queue:

  • Pending delivery rows are drained every 30 seconds.
  • Transport failures retry with exponential backoff: 5s → 15s → 1m → 5m → 15m → 1h.
  • After 6 attempts, deliveries move to dead_letter and stop retrying automatically. Admin can re-queue via POST /audit/deliveries/{id}/retry.
  • Sink receivers should deduplicate on event_uuid.

Transport formats

HTTP

POST {target}
Content-Type: application/json
X-Praxis-Signature: sha256={hex} # when hmac_secret is configured
User-Agent: Praxis-Audit/1.0
{ event JSON }

Signature = HMAC-SHA256 of the request body bytes keyed with the sink’s secret.

Syslog (RFC 5424)

TCP (TLS by default, disable via config.tls=false). Octet-counting framing per RFC 6587. MSG part is the event JSON. Facility/severity configurable (defaults: user / informational).

File

JSONL append at the configured path. One event per line. Receiver is expected to rotate.

Versioning policy

We bump schema_version only for breaking changes (field rename, field removal, semantic change to an existing field). Additive changes (new actions, new context keys) do NOT bump version, so consumers must tolerate unknown fields.