config.Validate() catches broken configs but not dangerous ones. You can happily mount $HOME (exposing .ssh/, .aws/), leak OPENAI_API_KEY=sk-live-... through env, or allowlist a network that entrypoint.sh silently blocks — and jailoc won't say a word.
Idea
jailoc audit [workspace] — static checker that goes beyond validation and flags risky-but-valid configs.
What it'd catch
🔴 Errors (this won't work):
- Paths/dockerfiles/build_contexts that don't exist on disk
allowed_networks overlapping the RFC 1918/link-local/CGNAT ranges that entrypoint.sh blocks (silently dead config)
🟡 Warnings (probably not what you want):
- Overly broad mounts (
$HOME, /) — agent sees way more than intended
- Sensitive dirs (
.ssh/, .gnupg/, .aws/) reachable under mounted paths
- Secret-looking env values (
sk-live-*, ghp_*, AKIA*, -----BEGIN) or suspicious keys (*_TOKEN, *_SECRET)
allowed_hosts that don't resolve
🔵 Info (just so you know):
- No network access configured at all (might be intentional)
- Empty workspace, default image
CLI sketch
jailoc audit [workspace]
jailoc audit --json
jailoc audit --level=warning
Exit: 0 clean, 1 warnings, 2 errors.
Implementation
internal/cmd/audit.go + internal/config/audit.go returning []Finding
- Runs on top of
config.Load() (validation first, audit second)
- DNS checks with timeout (warning-only, DNS is flaky)
- Network overlap uses same blocked CIDRs as entrypoint.sh
- Sensitive dir scan: shallow walk (1 level) under mounted paths
Advisory only — doesn't block jailoc up.
config.Validate()catches broken configs but not dangerous ones. You can happily mount$HOME(exposing.ssh/,.aws/), leakOPENAI_API_KEY=sk-live-...through env, or allowlist a network that entrypoint.sh silently blocks — and jailoc won't say a word.Idea
jailoc audit [workspace]— static checker that goes beyond validation and flags risky-but-valid configs.What it'd catch
🔴 Errors (this won't work):
allowed_networksoverlapping the RFC 1918/link-local/CGNAT ranges that entrypoint.sh blocks (silently dead config)🟡 Warnings (probably not what you want):
$HOME,/) — agent sees way more than intended.ssh/,.gnupg/,.aws/) reachable under mounted pathssk-live-*,ghp_*,AKIA*,-----BEGIN) or suspicious keys (*_TOKEN,*_SECRET)allowed_hoststhat don't resolve🔵 Info (just so you know):
CLI sketch
Exit:
0clean,1warnings,2errors.Implementation
internal/cmd/audit.go+internal/config/audit.goreturning[]Findingconfig.Load()(validation first, audit second)Advisory only — doesn't block
jailoc up.