Repository navigation
Release Notes 1.5.2
Released: 2026-12-03
A security and durability release. API keys narrowed to a project or memory space could still reach organization, team, and import routes that ignored the binding. Privacy purges could lose their audit receipt when the audit write failed. Backups on Ansible hosts lived in the container's writable layer, and under Redis coordination they could be written somewhere no API process could serve them.
Highlights
Bound API keys are refused outside their scope
A new require_unbound_credential(action) dependency in sibyl/auth/dependencies.py rejects any key carrying api_key_project_ids or api_key_memory_space_ids on routes that act organization-wide. Sessions and unrestricted keys pass through untouched. Refusals return 403 with api_key_scope_denied and a remediation string rather than a bare status.
Imports re-check their credential on every batch
Source imports capture the key's grants at admission and recompute authority before each batch. A key revoked mid-import now stops the queued work instead of running to completion on authority it no longer holds.
Purge receipts survive an audit outage
Captures live in the content store and receipts in the auth store, so no transaction spans both. The purge now writes a pending receipt row in the same statement that deletes the capture, then clears it once the receipt lands. A receipt lost to an audit failure is retried on the next hourly run.
Backups refuse to run where they cannot be restored
Under Redis coordination, a worker writing archives to its own home directory produces backups the API cannot serve and a restart discards. Sibyl now detects this and refuses, loudly, instead of accumulating unusable archives.
Content restore is no longer quadratic
Binding each row's identity as a client parameter avoids a SurrealDB 4.0.1 full-table scan. Measured on 4.0.1: 72.8s to 0.65s for 200 deletes over 4,000 rows.
Authorization
Routes that now require a session or unbound key, with the action label reported in the refusal:
- Organizations (
orgs.py):POST /orgsandPOST /orgs/{slug}/switch(Switching, creating or joining an organization);PATCHandDELETE /orgs/{slug}(Organization administration) - Members and invitations (
org_members.py,org_invitations.py): member create, update, and delete, plus invitation create and delete (Organization administration);POST /invitations/{token}/accept(Switching, creating or joining an organization) - Bots (
bots.py): router-level dependency covering every route (Bot management) - Backups (
backups.py): router-level dependency (Backup management) - Admin (
admin.py):POST /admin/backupandPOST /admin/restore(Backup and restore);POST /admin/backfill/task-project-relationshipsandPOST /admin/backfill/project-records(An organization-wide backfill) - Account and keys (
auth.py): API key create and revoke (API key management);update_me(Changing your account)
Teams take a finer path, since a bound key may legitimately manage a team it fully reaches. Two helpers in teams.py guard the write routes:
_verify_key_reaches_projectrunsverify_api_key_project_scopeandverify_api_key_project_memory_grantonlink_team_projectandunlink_team_project. A project link grants every member a role and a share of the project's memory, so the project must sit inside the key's binding._verify_key_reaches_teamguardsdelete_team,add_team_member, andremove_team_member. Members inherit every project link the team holds plus the team's own memory space, so a bound key needs all of them. Sessions and unbound keys skip the team lookup entirely.
Both new verifiers live in sibyl/auth/authorization.py and return 403 with project_scope_denied or api_key_memory_space_denied.
Source Imports
admission_policy_payload(ctx, context)records the memory scope grants, project grants, credential type, andapi_key_idheld at admission, and queues them with each batch._current_import_authority()resolves the admitted key throughcurrent_writer_context()at batch time, then intersects admitted grants against current ones via_still_held(). The batch runs under the narrowed context, never the admitted one.- A revoked or expired key makes
current_writer_context()returnNone, raising the newSourceImportRefusedErrorwithimporter_authority_revoked. current_writer_context()is extracted intosibyl/services/operational_authority.pyand returnsAuthContext | Noneinstead of raising, so callers can distinguish revocation from error.OperationalWriteAuthority.current()now delegates to it.
Privacy
- New
pending_purge_receiptstable (39_pending_purge_receipts.surql),SCHEMAFULLwithPERMISSIONS NONEand a unique index onreceipt_id. It carriesuuid,organization_id,principal_id,deleted_at,purge_after, andpurged_at. purge_due_deleted_personal_memoriesreads pending rows vialist_pending_purge_receipts(), writes each receipt throughlog_memory_audit_event(..., audit_id=receipt_id), then callsclear_pending_purge_receipt(receipt_id). Passing the mintedreceipt_idasaudit_idmakes the write idempotent: a row whose receipt already landed is cleared without duplicating it, and a capture purged twice correctly owes two receipts.- The job raises
RuntimeErrorwhen any receipt stays pending, so a silent audit outage surfaces as a failed job rather than a clean log line. - Schedule moved from daily at 04:00 to hourly at :15, so a pending receipt is retried well before the next nightly backup reads the stores.
Backups
- New
backup_archives_shared()inapps/api/src/sibyl/backup_archives.pyreturns true for single-process deployments, or whenSIBYL_BACKUP_ARCHIVE_URLis set, or whenbackup_dirwas explicitly configured. Under Redis coordination with a defaultbackup_dir, it returns false. get_schedule_specs()injobs/worker.pyskips the backup job in that case and logsscheduled_backups_off_without_shared_archive_store, including the sharedSHARED_ARCHIVE_STORE_REMEDIATIONtext and a pointer toSIBYL_BACKUP_ENABLED=falsefor externally managed backups.POST /backupsreturns 409 withbackup_archive_store_not_sharedunder the same condition, rather than queueing a job whose archive no API process could serve.- Nightly backups now cover every organization with a live human member.
run_scheduled_backups()callslist_scheduled_backup_settings(await list_org_ids_with_active_members()), replacinglist_enabled_backup_settings(). The org query excludes accounts withdeleted_atset and skips service records, and orgs without stored settings fall back to_default_backup_settings(). Organizations whose admins never opened the backup settings page are now covered.
Performance
Content restore in persistence/content_archive.py binds every identity filter to a per-row client parameter ($archive_identity_{index}) instead of a batch-scoped LET:
_existing_rows_sql(spec, identity)and the new_delete_by_identity_sql(spec, identity)take the parameter name._auxiliary_restore_statement()and_auxiliary_history_check()thread it through;_prepare_auxiliary_content_restore()mints it per row.
SurrealDB 4.0 plans a statement before it runs, so a DELETE whose filter operand is bound inside the batch scans the whole table. With 6,000 document chunks, restore went quadratic at roughly 4 extra seconds per batch.
Deployment
- The Ansible role mounts
/opt/sibyl/stateto/home/sibyl/.sibylon the backend service only; the role's compose file definessurrealdb,backend,frontend, andcaddy, with no worker service. Backup archives and validation receipts now survive container recreation and can be copied off the host. - A migration block in
roles/sibyl/tasks/main.ymlcarries state out of a pre-1.5.2 container. It inspectssibyl-backendfor an existing/home/sibyl/.sibylmount, stops the container so its state is final, runsdocker cpinto{{ sibyl_dir }}/state/, then chowns to uid/gid10001. Arescueblock restarts the old backend and fails the play if the copy does not succeed, so the restart can never remove the only copy. docker-compose.prod.ymlanddocker-compose.quickstart.ymlsetSIBYL_BACKUP_DIR: /home/sibyl/.sibyl/backupson both backend and worker. Both files already mount a shared named volume at/home/sibyl/.sibyl(validation_receiptsin prod,sibyl_secretsin quickstart), so backups stay enabled whenSIBYL_COORDINATION_BACKEND=redis.charts/sibyl/values.yamldocumentsbackend.backupArchives: the chart refuses to render with no archive store at all, and a deployment without a shared store gets no scheduled backups, a refused create, and a log line explaining why.- Version bumps to 1.5.2 across
VERSION,charts/sibyl,charts/surrealdb,infra/ansible/galaxy.yml, the role'ssibyl_versiondefault, and thesibyl-corepin inapps/apiandapps/cli.
Breaking Changes
- Bound API keys lose organization and team write access. Keys narrowed to projects or memory spaces are refused on org, member, invitation, bot, backup, admin backup/restore/backfill, API key management, and account update routes with 403
api_key_scope_denied. Automation using a bound key for these operations must move to a session or an unrestricted key. - Team writes check the full reach of the key. Linking or unlinking a project, adding or removing a member, and deleting a team all require every linked project (and, for memory-bound keys, each project's memory space plus the team's own) to sit inside the binding. Refusals are 403
project_scope_deniedorapi_key_memory_space_denied. - A revoked key stops a running import. Imports admitted under a key that is later revoked now fail with
SourceImportRefusedErrorandimporter_authority_revokedinstead of completing. POST /backupsreturns 409 without a shared archive store. Under Redis coordination with noSIBYL_BACKUP_ARCHIVE_URLand an unconfiguredSIBYL_BACKUP_DIR, backup creation is refused withbackup_archive_store_not_shared, and scheduled backups do not register at all.- The privacy purge job fails on pending receipts.
purge_due_deleted_personal_memoriesraises when any receipt could not be written. Alerting that treated this job as always-green will now see failures during an audit store outage.
Upgrade Notes
- Audit bound API keys before upgrading. Any automation using a project- or memory-space-bound key against org, team, bot, backup, or admin routes will start receiving 403
api_key_scope_denied. Issue an unrestricted key or switch to a session for those paths. - Set a shared archive store under Redis coordination. Point
SIBYL_BACKUP_ARCHIVE_URLat an S3 prefix, or setSIBYL_BACKUP_DIRto a volume every API and worker process mounts (Helm:backend.backupArchives). Without one, scheduled backups silently stop registering and manual creates return 409. SetSIBYL_BACKUP_ENABLED=falseif backups are handled outside Sibyl. - Docker Compose needs no action.
docker-compose.prod.ymlanddocker-compose.quickstart.ymlalready mount a shared named volume at/home/sibyl/.sibyl, and this release addsSIBYL_BACKUP_DIRto backend and worker for you. - Ansible hosts migrate state on the first 1.5.2 run. The role stops
sibyl-backend, copies~/.sibylto/opt/sibyl/state, and restarts onto the mount. Confirm free space under/opt/sibyl/statefirst: a failed copy aborts the play with the old backend running and its state untouched, which is safe but leaves the upgrade incomplete. - Expect the purge job hourly.
purge_due_deleted_personal_memoriesmoves from 04:00 daily to :15 every hour. Update any monitoring that keyed on the nightly cadence. - Schema bootstrap adds
pending_purge_receipts. Applied automatically from39_pending_purge_receipts.surql; no manual migration required. - Review backup volume. Nightly backups now cover every org with a live human member, including those that never configured settings. Storage use may rise on installs with many dormant organizations.
Install
Local server
curl -fsSL https://raw.githubusercontent.com/hyperb1iss/sibyl/main/install.sh | sh -s -- --version 1.5.2Remote CLI
curl -fsSL https://raw.githubusercontent.com/hyperb1iss/sibyl/main/install.sh | sh -s -- --remote --version 1.5.2
sibyl init --remote https://sibyl.example.com
sibyl auth loginHomebrew
brew install hyperb1iss/tap/sibyl
sibyl upArch Linux (AUR)
paru -S sibyl
sibyl upHeadless server
curl -fsSL https://raw.githubusercontent.com/hyperb1iss/sibyl/main/install.sh | sh -s -- --version 1.5.2 --no-openKubernetes (Helm)
helm repo add sibyl https://raw.githubusercontent.com/hyperb1iss/sibyl/gh-pages
helm repo update sibyl
helm upgrade --install sibyl sibyl/sibyl --version 1.5.2Artifacts
This release includes Python wheels and sdists, the generated
Homebrew formula, the generated AUR PKGBUILD, Helm charts, Docker
SBOMs, aggregate dual-registry cosign receipts, and a SHA256 checksum
manifest.