Skip to content

Commit f5fa97f

Browse files
rozsival-agentrozsival
authored andcommitted
fix: prompt rather than deny env -i in the omp guardrail
1 parent c1a347e commit f5fa97f

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎docs/security.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ control: a subverted agent can call the same APIs through an SDK without either
110110
what each credential can do. `home/.omp/agent/config.yml` ships exactly such a guardrail for OMP, seeded
111111
when absent by `bootstrap` and `./bin/install-agent`: `bash.patterns` that deny `gh auth token|login|…`,
112112
an absolute-path `gh` (`*/bin/gh *` - past the shim), unsetting or reassigning the launcher's exports
113-
(`env -u`/`-i`, `unset GIT_CONFIG_GLOBAL`, `GH_CONFIG_DIR=…`; reading them stays allowed), keychain reads,
113+
(`env -u`, `unset GIT_CONFIG_GLOBAL`, `GH_CONFIG_DIR=…`; reading them stays allowed; `env -i` prompts instead,
114+
since this repo's own smoke tests use it), keychain reads,
114115
`gh secret`/`variable`/`repo delete`, `--no-verify` and force pushes, and prompt for `op`,
115116
`gcloud` and `terraform apply`. `deny` holds even under yolo, but the rules match command text in the
116117
`bash` tool only - not `eval`, not a script file - and a project's own `bash.patterns` **replaces** the

‎docs/toolchain.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ it shadows, which is why the launcher survives an update. See
8383
devbox, by `./bin/install-agent` on the laptop - with `secrets: { enabled: true }` obfuscating an API key in
8484
the environment (`~/.config/devbox/secrets.env` or a project `.env`) before it reaches a provider, and a
8585
`bash.patterns` guardrail: `deny` for reaching past the agent's scoped tokens (`gh auth token|login|…`, an
86-
absolute-path `gh`, `env -u`/`env -i`, unsetting or reassigning `GIT_CONFIG_GLOBAL`, `GIT_SSH_COMMAND`,
86+
absolute-path `gh`, `env -u`, unsetting or reassigning `GIT_CONFIG_GLOBAL`, `GIT_SSH_COMMAND`,
8787
`GH_CONFIG_DIR`, `GIT_TERMINAL_PROMPT`, keychain reads, `gh secret`/`variable`/`repo delete`) and for history rewrites (`--no-verify`, force push),
88-
`prompt` for `op`, `gcloud`, `terraform apply`. Your edits are never overwritten; an existing file without
88+
`prompt` for `env -i` (this repo's smoke tests use it), `op`, `gcloud`, `terraform apply`. Your edits are never overwritten; an existing file without
8989
a `bash:` block is reported by both installers so you can copy the block in. A project's own
9090
`bash.patterns` replaces this list entirely - arrays don't merge across settings layers. What it does and
9191
does not stop: [Security](security.md#accepted-limits).

‎home/.omp/agent/config.yml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ bash:
5252
# shim; clearing or reassigning the four exports undoes the fence for one
5353
# command. Reading them (`echo $GIT_CONFIG_GLOBAL`, the documented session
5454
# check) stays allowed: only unset, assignment and env-scrubbing match.
55+
# Tradeoff: this repo's own smoke tests use `env -i HOME=… PATH=…` and
56+
# `GIT_CONFIG_GLOBAL=… <cmd>` probes. `env -i` is therefore `prompt` - a
57+
# person approves it, and yolo still stops instead of failing silently -
58+
# while assigning an export stays `deny`: a probe can write a throwaway
59+
# HOME and let the launcher set the variable instead.
5560
- match: '*/bin/gh *'
5661
approval: deny
5762
- match: '*/bin/gh'
@@ -61,7 +66,7 @@ bash:
6166
- match: '*env --unset*'
6267
approval: deny
6368
- match: '*env -i *'
64-
approval: deny
69+
approval: prompt
6570
- match: '*unset *GIT_CONFIG_GLOBAL*'
6671
approval: deny
6772
- match: '*unset *GIT_SSH_COMMAND*'

0 commit comments

Comments
 (0)