Skip to content

Command permissions + Alembic SQLite migrations - #13

Merged
bulletinmybeard merged 9 commits into
masterfrom
sleepy-compiler
Jul 18, 2026
Merged

Command permissions + Alembic SQLite migrations#13
bulletinmybeard merged 9 commits into
masterfrom
sleepy-compiler

Conversation

@bulletinmybeard

@bulletinmybeard bulletinmybeard commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

Ships two related platform upgrades for v0.12.0:

Command permissions (shell / SSH)

  • Segment-aware allowlist / denylist / confirm modes under tools.shell.permissions and tools.ssh.permissions
  • YAML baseline + runtime overrides (SQLite), applied before CommandGuard / user confirm
  • REST API: /api/permissions/commands/* (list, overrides CRUD, dry-run validate with optional draft policy)
  • Core wheel stays importable without web (YAML-only policy when the web package is absent)
  • Docs: SECURITY.md, tools + API indexes

Alembic SQLite migrations

  • Chat DB (sessions, tools, monitor, connectors, canvas) — web/server/database/migrations/
  • Prompt Lab DBweb/server/prompt_lab/database/migrations/
  • Boot + Docker agentforge-web entrypoint: upgrade-all before uvicorn/SAQ
  • Legacy DBs stamped (no re-CREATE); applied history in schema_migrations (revision, filename, applied_at)
  • CLI: python -m web.server.database.cli … / agentforge-db
  • Docs: architecture.md

Other

  • Version 0.12.0; CHANGELOG cut from Unreleased
  • ty / CI fixes (reminders due-date test, optional-import typing)
  • Single alembic pin in pyproject.toml

Test plan

  • CI green on PR (lint, ty, build & smoke)
  • pytest migrations + command policy + permissions API
  • After merge: tag v0.12.0 and publish release notes from CHANGELOG
  • Coordinate agent-forge-webui Command Permissions modal (separate repo) so UI matches API

Deploy notes

  • Rebuilding/restarting agentforge-web runs migrations automatically (entrypoint + lifespan).
  • Existing SQLite files are stamped if pre-Alembic; data is preserved.
  • Optional: configure tools.*.permissions or use the Web UI modal when the frontend ships.

… the current way of detecting dangerous commands
… Lab (`web/server/prompt_lab/database/migrations/`) SQLite DB with baseline revision files

- Add multi-DB helper: upgrade/downgrade/current/history
- Add DB migration manager (CLI/Poetry command) for: upgrade-all, upgrade, downgrade, current, applied, history and revision
- Run migration on container start
- Cover empty and legacy paths and filename log in `tests/test_migrations.py`
- Reorder imports / run ruff commands
- Create and update tests
…E and CHANGELOG

- Update `docs/SECURITY.md` to include a section about the new command permissions/policy
- Update other docs as well
@bulletinmybeard bulletinmybeard changed the title Sleepy compiler Command permissions + Alembic SQLite migrations Jul 18, 2026
@bulletinmybeard
bulletinmybeard merged commit 7093a48 into master Jul 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant