Skip to content

v1.5.2

Latest

Choose a tag to compare

@github-actions github-actions released this 03 Dec 01:07

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 /orgs and POST /orgs/{slug}/switch (Switching, creating or joining an organization); PATCH and DELETE /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/backup and POST /admin/restore (Backup and restore); POST /admin/backfill/task-project-relationships and POST /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_project runs verify_api_key_project_scope and verify_api_key_project_memory_grant on link_team_project and unlink_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_team guards delete_team, add_team_member, and remove_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, and api_key_id held at admission, and queues them with each batch.
  • _current_import_authority() resolves the admitted key through current_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() return None, raising the new SourceImportRefusedError with importer_authority_revoked.
  • current_writer_context() is extracted into sibyl/services/operational_authority.py and returns AuthContext | None instead of raising, so callers can distinguish revocation from error. OperationalWriteAuthority.current() now delegates to it.

Privacy

  • New pending_purge_receipts table (39_pending_purge_receipts.surql), SCHEMAFULL with PERMISSIONS NONE and a unique index on receipt_id. It carries uuid, organization_id, principal_id, deleted_at, purge_after, and purged_at.
  • purge_due_deleted_personal_memories reads pending rows via list_pending_purge_receipts(), writes each receipt through log_memory_audit_event(..., audit_id=receipt_id), then calls clear_pending_purge_receipt(receipt_id). Passing the minted receipt_id as audit_id makes 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 RuntimeError when 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() in apps/api/src/sibyl/backup_archives.py returns true for single-process deployments, or when SIBYL_BACKUP_ARCHIVE_URL is set, or when backup_dir was explicitly configured. Under Redis coordination with a default backup_dir, it returns false.
  • get_schedule_specs() in jobs/worker.py skips the backup job in that case and logs scheduled_backups_off_without_shared_archive_store, including the shared SHARED_ARCHIVE_STORE_REMEDIATION text and a pointer to SIBYL_BACKUP_ENABLED=false for externally managed backups.
  • POST /backups returns 409 with backup_archive_store_not_shared under 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() calls list_scheduled_backup_settings(await list_org_ids_with_active_members()), replacing list_enabled_backup_settings(). The org query excludes accounts with deleted_at set 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/state to /home/sibyl/.sibyl on the backend service only; the role's compose file defines surrealdb, backend, frontend, and caddy, 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.yml carries state out of a pre-1.5.2 container. It inspects sibyl-backend for an existing /home/sibyl/.sibyl mount, stops the container so its state is final, runs docker cp into {{ sibyl_dir }}/state/, then chowns to uid/gid 10001. A rescue block 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.yml and docker-compose.quickstart.yml set SIBYL_BACKUP_DIR: /home/sibyl/.sibyl/backups on both backend and worker. Both files already mount a shared named volume at /home/sibyl/.sibyl (validation_receipts in prod, sibyl_secrets in quickstart), so backups stay enabled when SIBYL_COORDINATION_BACKEND=redis.
  • charts/sibyl/values.yaml documents backend.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's sibyl_version default, and the sibyl-core pin in apps/api and apps/cli.

Breaking Changes

  1. 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.
  2. 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_denied or api_key_memory_space_denied.
  3. A revoked key stops a running import. Imports admitted under a key that is later revoked now fail with SourceImportRefusedError and importer_authority_revoked instead of completing.
  4. POST /backups returns 409 without a shared archive store. Under Redis coordination with no SIBYL_BACKUP_ARCHIVE_URL and an unconfigured SIBYL_BACKUP_DIR, backup creation is refused with backup_archive_store_not_shared, and scheduled backups do not register at all.
  5. The privacy purge job fails on pending receipts. purge_due_deleted_personal_memories raises 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

  1. 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.
  2. Set a shared archive store under Redis coordination. Point SIBYL_BACKUP_ARCHIVE_URL at an S3 prefix, or set SIBYL_BACKUP_DIR to a volume every API and worker process mounts (Helm: backend.backupArchives). Without one, scheduled backups silently stop registering and manual creates return 409. Set SIBYL_BACKUP_ENABLED=false if backups are handled outside Sibyl.
  3. Docker Compose needs no action. docker-compose.prod.yml and docker-compose.quickstart.yml already mount a shared named volume at /home/sibyl/.sibyl, and this release adds SIBYL_BACKUP_DIR to backend and worker for you.
  4. Ansible hosts migrate state on the first 1.5.2 run. The role stops sibyl-backend, copies ~/.sibyl to /opt/sibyl/state, and restarts onto the mount. Confirm free space under /opt/sibyl/state first: a failed copy aborts the play with the old backend running and its state untouched, which is safe but leaves the upgrade incomplete.
  5. Expect the purge job hourly. purge_due_deleted_personal_memories moves from 04:00 daily to :15 every hour. Update any monitoring that keyed on the nightly cadence.
  6. Schema bootstrap adds pending_purge_receipts. Applied automatically from 39_pending_purge_receipts.surql; no manual migration required.
  7. 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.2

Remote 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 login

Homebrew

brew install hyperb1iss/tap/sibyl
sibyl up

Arch Linux (AUR)

paru -S sibyl
sibyl up

Headless server

curl -fsSL https://raw.githubusercontent.com/hyperb1iss/sibyl/main/install.sh | sh -s -- --version 1.5.2 --no-open

Kubernetes (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.2

Artifacts

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.