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
0002_llm_usage.sql
0003_task_scope_icp_index.sql
0004_llm_usage_ts_index.sql
0005_traffic_rewrite_rules.sql
0006_activity_outbox.sql
0007_finding_report_state.sql
0008_traffic_evidence_rewrite_flag.sql
0009_llm_context.sql
0010_dashboard_usage_indexes.sql
0011_traffic_tamper_hooks.sql
0012_lesson_withdrawn.sql
0013_lesson_evidence_history.sql
0014_bedrock_gateway_profiles.sql
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