# ADR-007 — AI authorization, code isolation and promotion Status: **owner approval required** for the execution trust model; quotas/isolation/no autonomous live access are user requirements. ## Selected approach Use existing operator authentication plus explicit research-agent identity/scope. AI may create hypotheses/candidate artifacts and submit bounded experiments, but cannot loosen account risk, choose its own privileges or invoke paper/live administration. Unreviewed code is built/imported/evaluated in an OS-restricted process or container with no network, secrets, database, broker credentials, shared writable paper state or full future dataset. The financial supervisor sends prefix-only contexts over IPC. Require CPU/wall/memory/process limits and safe cancellation. A JS `vm` or a separate unrestricted process alone is insufficient. Trusted registered/reviewed artifacts can run beside NAPI in a worker for speed. Moving an artifact into that tier requires an explicit operator action, never an AI-supplied trust flag. If the sandbox is unavailable, reject untrusted execution; do not silently downgrade. ## Evidence [Current role model](../../../../libs/core/di/src/http/security.ts#L4) is a small operator boundary, not research isolation. [Current registry dependencies](../../../../apps/stock/orchestrator/src/strategies/StrategyRegistry.ts#L7) expose execution services that the new decision API must not expose. ## Alternatives / tradeoffs Running all AI code in the API/engine process is fast but not a meaningful protection against future-data reads or credential access. Sandboxing all reviewed code unnecessarily penalizes the trusted fast path. IPC has a cost; P01/A02 measure it separately. ## Migration A01 adds actor/budget admission; A02 adds isolation; A03 composes existing research APIs; A04 permits only human-reviewed paper promotion after paper gates. Limits apply to autonomous job budgets and resource use, **not arbitrary truncation of the owner's datasets**. Local dev .env policy is not changed by this plan, but sandboxed code must never receive its contents.