23 lines
2.3 KiB
Markdown
23 lines
2.3 KiB
Markdown
# ADR-007 — AI authorization, code isolation and promotion
|
|
|
|
Status: **implementation authorized by owner, 2026-10-24**, through the instruction to complete all remaining scheduled tasks. Research-only quotas, OS isolation and no autonomous live access remain mandatory. Actual paper activation still requires a deliberate human action; no trading is activated by development or task closure.
|
|
|
|
## 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.
|