feat(agent-isolation): expose harness-agnostic agent-iso entry point#764
Conversation
potiuk
left a comment
There was a problem hiding this comment.
Approving — a solid, well-tested extension of the isolation launcher to arbitrary harnesses. The credential-strip (env -i allowlist) is sound, the -w control-flag stripping for non-Claude agents is a nice touch, and coverage is strong (both entry points, symlink, strip, SSH_AUTH_SOCK passthrough, exit codes).
A few small fixups to fold in — none blocking:
- Make the "generic harness = no push gate" posture prominent. The Layer 0 / Layer 3 split is now well-explained in the
agent-iso.shcomment, but the net consequence — a runtime with no Layer 3 adapter (codex/aiderviaagent-iso) gets the live ssh-agent socket with no push gate — deserves top-billing in the README's generic-entry-point section and the PR description, so nobody reads "same credential-strip posture" as "same net protection." (inline) - Skip the wasted git resolution for non-Claude
-w. (inline suggestion) - Add a claude-
-w-preserved regression test. The suite proves-wis stripped for non-Claude; a mirror asserting it's preserved for claude (and that banner/settings injection stays claude-only) would lock down both sides of the branch.
Thanks @justinmclean.
This review was drafted by an AI-assisted tool and confirmed by a Magpie maintainer. The maintainer approving this PR has read the findings and signed off. If something feels off, please reply on the PR and a maintainer will follow up.
More on how Magpie handles maintainer review: CONTRIBUTING.md.
The env-isolation core of agent-iso.sh already worked for any CLI; this makes that capability explicit and documented: - Add `agent-iso()` shell function (sourced) and a sub-command mode `bash agent-iso.sh agent-iso <cli> [args]` (direct exec) so any harness CLI can be launched with the same credential-strip posture that claude-iso and opencode-iso provide. A symlink named `agent-iso` (no .sh extension) also works — first positional arg is the CLI name. - The Claude-specific --settings sandbox allowRead injection continues to be skipped for all non-claude agents (guard was already in place). - Change `**Harness:** Claude Code, OpenCode` → `**Harness:** agnostic` in tools/agent-isolation/README.md; the env-isolation layer is now available for Codex, Cursor, Gemini CLI, Aider, and any future CLI. - Update docs/vendor-neutrality.md harness table and harness index to reflect agent-isolation moving from portable to agnostic; the hook regenerates the score section automatically. - Update docs/adapters/add-a-harness.md Step 2 and Step 4 to document `agent-iso <cli>` as the ready-made layer-0 wrapper for runtimes without a built-in hook API. - Add tests/test_generic_iso.py covering both the direct-exec and sourced entry points: credential strip, no --settings injection, banner, missing-CLI exit-127, no-CLI-arg usage message, and multiple harness names (codex/cursor/gemini). All 72 agent-isolation tests pass; vendor-neutrality-score and skill-and-tool-validate both pass. Generated-by: Claude (claude-sonnet-4-6)
48bc3ae to
7f7fed8
Compare
…o-push-gate caveat for generic harnesses
|
I applied both review fixups directly and rebased onto latest
Resolving my threads and merging. Thanks @justinmclean. |
…heck/--exec (apache#765) and agnostic agent-isolation (apache#764); fix CodeQL dual-import in test_kiro
Summary
The env-isolation core of agent-iso.sh already worked for any CLI; this makes that capability explicit and documented:
agent-iso()shell function (sourced) and a sub-command modebash agent-iso.sh agent-iso <cli> [args](direct exec) so any harness CLI can be launched with the same credential-strip posture that claude-iso and opencode-iso provide. A symlink namedagent-iso(no .sh extension) also works — first positional arg is the CLI name.**Harness:** Claude Code, OpenCode→**Harness:** agnosticin tools/agent-isolation/README.md; the env-isolation layer is now available for Codex, Cursor, Gemini CLI, Aider, and any future CLI.agent-iso <cli>as the ready-made layer-0 wrapper for runtimes without a built-in hook API.All 72 agent-isolation tests pass; vendor-neutrality-score and skill-and-tool-validate both pass.
Generated-by: Claude (claude-sonnet-4-6)
Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)Test plan
prek run --all-filespassesuv run pytest/ruff check/mypypasses(
PYTHONPATH=tools/skill-evals/src python3 -m skill_evals.runner tools/skill-evals/evals/<skill>/)(a regression test for the bug fixed / the behaviour added — see CONTRIBUTING.md)