フィールドガイド / 13 分
Sandbox で command を試し execpolicy を監査する
Guardrail を信頼する前に filesystem denial と rule decision を観察します。
codex sandbox は Codex sandbox 内で command を実行し、permission profile、readable roots/network、macOS denial logs を扱えます。execpolicy check は rule files に対して argv を評価します。これらは authority の診断手段であり、危険 command を安全に変えず、OS enforcement を置き換えません。
CLI
検証済みターミナル手順
- $
codex sandbox --permission-profile PROFILE -- command --arg - $
codex sandbox --log-denials -- command --arg - $
codex execpolicy check --pretty --rules ~/.codex/rules/default.rules -- gh pr view 7888
A
作業原則
Enforcement と policy は別
Sandbox は OS boundary、execpolicy は command intent を分類。両方の結果を残します。
Context で profile 解決
CWD、config layers、managed requirements が effective profile を変えます。
Denial は evidence
Missing capability を示す denial から profile を狭く調整します。
B
フィールド手順
- 01
Minimal probe
一つの capability だけを使う non-destructive command。
- 02
Intended profile
-C と exact profile、必要な時だけ managed config。
- 03
Denials を capture
--log-denials を使い、共有前に local path を確認。
- 04
Rules を評価
Production と同じ argv shape で matched rule/decision を読む。
- 05
Negative cases
必要 command 成功と隣接する禁止 command denial の両方を証明。
PASS / FAIL
受入チェック
- Probe が harmless/scoped。
- Profile/CWD 記録。
- Sandbox/execpolicy を混同しない。
- Negative test denied。
- Broad wildcard なし。
WATCH / REJECT
失敗パターン
- 一 denial で danger-full-access。
- Production と違う argv を test。
- Evolving execpolicy を固定 API 扱い。