ARTEX/db/migrations
BaaRai ed70ea3220 security: promote company scope egress only when approved by the operator
An operator company approval froze the company's whole inventory into
task_scope_egress: every company_scope domain and IP/CIDR row plus the
root_domain, domain and ip of every asset attributed to the company. The
agent writes both (insert_assets, add_company_scope), so the next operator
selection or re-approval promoted worker-chosen hosts into the sandbox
egress allowlist for the life of the task.

The snapshot now reads only company_scope domain and IP/CIDR rules with
approved_by_operator = TRUE; the asset branches are gone. Migration 0025
adds the column and backfills existing rows as approved. The flag is an
explicit parameter of insertScopeRulesTx and the CompanyStore scope
writers: the operator company API passes true, add_company_scope and the
ScopeSentry sync pass false. An operator write of a rule the agent stored
first approves the existing row.

AddOperatorScope outside a transaction now commits the task_scope row and
the egress snapshot together.

Existing task_scope_egress rows are not purged.
2026-12-01 20:44:37 +01:00
..
0001_llm_records.sql db: versioned migrations runner with schema_migrations 2026-11-14 12:52:34 +01:00
0002_llm_usage.sql db: versioned migrations runner with schema_migrations 2026-11-14 12:52:34 +01:00
0003_task_scope_icp_index.sql perf(db): batch coverage-graph lookups and index icp scope probes 2026-11-14 21:16:49 +01:00
0004_llm_usage_ts_index.sql fix(db): index llm_usage.ts for the usage time-window queries 2026-11-16 00:00:56 +01:00
0005_traffic_rewrite_rules.sql feat(db): store capture-proxy rewrite rules, sealed at rest 2026-11-17 00:12:09 +01:00
0006_activity_outbox.sql Stop admitting work before the drain and replay each outbox row once. 2026-11-17 15:41:56 -05:00
0007_finding_report_state.sql feat(findings): add report_state separate from triage 2026-11-18 00:07:50 +01:00
0008_traffic_evidence_rewrite_flag.sql feat(evidence): record capture-proxy rewrite provenance on traffic snapshots (P3.3b2a) 2026-11-20 04:00:34 +01:00
0009_llm_context.sql feat(llmrec): opt-in LLM context size telemetry and aggregation (P3.5 phase A) 2026-11-20 18:15:23 +01:00
0010_dashboard_usage_indexes.sql perf(db): add partial covering indexes for dashboard/usage queries (migration 0010) 2026-11-20 21:48:31 +01:00
0011_traffic_tamper_hooks.sql feat(db): add traffic_tamper_hooks migration 0011, sealed CRUD, versions, and rollback 2026-11-21 00:48:27 +01:00
0012_lesson_withdrawn.sql fix(rsi): add migration 0012 for lesson evidence withdrawn_at 2026-11-21 08:50:48 +01:00
0013_lesson_evidence_history.sql fix(db): preserve rsi_lesson_evidence withdrawal history on re-confirmation (#269) 2026-11-21 16:17:07 +01:00
0014_bedrock_gateway_profiles.sql feat: add bearer-authenticated Bedrock gateway profiles 2026-11-22 18:27:43 +08:00
0015_chat_bridges.sql fix(chatbridge): address review notes on the bridge core 2026-11-26 22:24:28 +05:30
0016_chat_bridge_access.sql feat(chatbridge): task commands, main-agent chat and per-user access 2026-11-27 11:30:06 +05:30
0017_legacy_fact_capture_provenance.sql fix(agent,db): isolate fact capture provenance and tighten prove_goal (#602) 2026-11-28 10:00:55 +01:00
0018_chat_bridge_share_text.sql fix(chatbridge): opt-in text excerpts, SafeText hardening, and asker re-check (#642 1/3) 2026-11-28 23:07:52 +01:00
0019_chat_bridge_approvals.sql feat(chatbridge): remote approvals with one-time buttons (#642 2/3) 2026-11-28 23:07:52 +01:00
0020_chat_bridge_chat_type_backfill.sql security: bind stored LLM keys to their route, bearer-only sessions, SSRF and log hardening 2026-11-29 22:35:38 +01:00
0021_planner_progress.sql fix(planner): bound retries with backoff, expose state, resume planning, and migrate 0021 (#676) 2026-11-30 03:16:35 +01:00
0022_target_gate_backfill.sql sec(p0): fail-closed startup, atomic secret rotation, scoped target-gate backfill, and kernel kill-switch 2026-11-30 17:41:46 +01:00
0023_task_scope_operator_approval.sql security: isolate task execution in per-task sandbox worker and egress proxy 2026-11-30 19:09:32 +01:00
0024_task_scope_egress.sql fix(sandbox): freeze company egress at operator approval 2026-12-01 02:51:19 +01:00
0025_company_scope_approved.sql security: promote company scope egress only when approved by the operator 2026-12-01 20:44:37 +01:00