Skip to content

feat(sandbox-lint): add --any-harness posture check; declare harness agnostic#839

Merged
potiuk merged 2 commits into
apache:mainfrom
justinmclean:sandbox-lint-any-harness
Jul 12, 2026
Merged

feat(sandbox-lint): add --any-harness posture check; declare harness agnostic#839
potiuk merged 2 commits into
apache:mainfrom
justinmclean:sandbox-lint-any-harness

Conversation

@justinmclean

Copy link
Copy Markdown
Member

Summary

For runtimes without a dedicated settings file (Codex, Cursor, Gemini CLI,
Kiro, and others), the security posture comes from the two OS-level
enforcement components that are now harness-agnostic:

  • Layer 0 — clean-env credential strip: tools/agent-isolation/agent-iso.sh
    (made harness-agnostic by harness-posture-portability)
  • Layer 3 — action guard harness-neutral path: tools/agent-guard/ dispatch
    core with --exec (added by harness-guard-exec-mode)

sandbox-lint --any-harness [FRAMEWORK_ROOT] checks that both components are
present in the framework tree. FRAMEWORK_ROOT defaults to the nearest ancestor
directory containing tools/agent-isolation/ (auto-detected by walking up from
CWD). Exits 0 when both are present, 1 otherwise.

Changes:

  • New tools/sandbox-lint/src/sandbox_lint/posture.py: PostureViolation,
    check_posture_violations(), find_framework_root()
  • New tools/sandbox-lint/tests/test_posture.py: 12 tests (unit + CLI)
  • tools/sandbox-lint/src/sandbox_lint/init.py: --any-harness flag wired
    to _lint_any_harness(); argparse uses nargs="?" const=True / default=None
  • tools/sandbox-lint/README.md: Harness: agnostic, new "Harness-neutral
    posture check (any runtime)" section with layer table
  • docs/vendor-neutrality.md: refresh generated block (sandbox-lint moves
    from portable → agnostic, any-harness count 17 → 18)

All 77 tests pass. mypy clean. ruff clean.

Generated-by: Claude (claude-sonnet-4-6)

Type of change

  • Skill change (.claude/skills/<name>/) — eval fixtures updated below
  • Tool / bridge contract (tools/<system>/*.md)
  • Python package (tools/*/ with pyproject.toml)
  • Groovy reference impl
  • Cross-cutting (RFC, AGENTS.md, sandbox, privacy-LLM)
  • Documentation (docs/, README.md, CONTRIBUTING.md)
  • Project template (projects/_template/)
  • CI / dev loop (prek, workflows, validators)
  • Other:

Test plan

  • prek run --all-files passes
  • For Python packages touched: uv run pytest / ruff check / mypy passes
  • For Groovy bridges touched: command-line invocation tested end-to-end
  • For skill changes: eval suite passes for the affected skill
    (PYTHONPATH=tools/skill-evals/src python3 -m skill_evals.runner tools/skill-evals/evals/<skill>/)
  • For skill behaviour changes: a new or updated eval fixture is included in this PR
    (a regression test for the bug fixed / the behaviour added — see CONTRIBUTING.md)
  • Other:

@justinmclean justinmclean self-assigned this Jul 12, 2026
@justinmclean justinmclean changed the title Sandbox lint any harness feat(sandbox-lint): add --any-harness posture check; declare harness agnostic Jul 12, 2026
…agnostic

For runtimes without a dedicated settings file (Codex, Cursor, Gemini CLI,
Kiro, and others), the security posture comes from the two OS-level
enforcement components that are now harness-agnostic:

* Layer 0 — clean-env credential strip: tools/agent-isolation/agent-iso.sh
  (made harness-agnostic by harness-posture-portability)
* Layer 3 — action guard harness-neutral path: tools/agent-guard/ dispatch
  core with --exec (added by harness-guard-exec-mode)

sandbox-lint --any-harness [FRAMEWORK_ROOT] checks that both components are
present in the framework tree. FRAMEWORK_ROOT defaults to the nearest ancestor
directory containing tools/agent-isolation/ (auto-detected by walking up from
CWD). Exits 0 when both are present, 1 otherwise.

Changes:
- New tools/sandbox-lint/src/sandbox_lint/posture.py: PostureViolation,
  check_posture_violations(), find_framework_root()
- New tools/sandbox-lint/tests/test_posture.py: 12 tests (unit + CLI)
- tools/sandbox-lint/src/sandbox_lint/__init__.py: --any-harness flag wired
  to _lint_any_harness(); argparse uses nargs="?" const=True / default=None
- tools/sandbox-lint/README.md: **Harness:** agnostic, new "Harness-neutral
  posture check (any runtime)" section with layer table
- docs/vendor-neutrality.md: refresh generated block (sandbox-lint moves
  from portable → agnostic, any-harness count 17 → 18)

All 77 tests pass. mypy clean. ruff clean.

Generated-by: Claude (claude-sonnet-4-6)
@potiuk potiuk force-pushed the sandbox-lint-any-harness branch from 4306e0f to c0f8e90 Compare July 12, 2026 18:45

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased onto latest main (regenerated docs/vendor-neutrality.md to resolve the sole conflict). sandbox-lint tests, ruff, mypy, and the vendor-neutrality regen all pass locally. Clean, well-tested addition of the --any-harness posture check. Approving.

@potiuk potiuk merged commit d931ccb into apache:main Jul 12, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants