Skip to content

fix: always prefer sandbox IPC when enabled#57

Merged
F16shen merged 2 commits intoAI-Shell-Team:mainfrom
F16shen:fix/sandbox-ipc-selection
Mar 17, 2026
Merged

fix: always prefer sandbox IPC when enabled#57
F16shen merged 2 commits intoAI-Shell-Team:mainfrom
F16shen:fix/sandbox-ipc-selection

Conversation

@F16shen
Copy link
Copy Markdown
Collaborator

@F16shen F16shen commented Mar 17, 2026

Summary

Fix sandbox path selection so privileged sandbox uses IPC consistently for both root and non-root callers.

Previously, the security manager only selected SandboxSecurityIpc when the caller was non-root. That caused root callers to bypass the sandbox daemon and execute the local sandbox path directly, which diverged from the intended design where root is only responsible for starting the sandbox service process.

Problem

The current implementation introduced an unintended split:

  • non-root callers used the sandbox daemon through IPC
  • root callers bypassed IPC and used the local sandbox path

This was inconsistent with the intended design and made root-path failures harder to reason about and reproduce consistently across environments.

Changes

  • update src/aish/security/security_manager.py so IPC is always preferred when privileged sandbox is enabled
  • add regression tests in tests/security/sandbox/test_ipc.py to verify:
    • root callers still select SandboxSecurityIpc when privileged sandbox is enabled
    • local SandboxSecurity is only used when privileged sandbox is explicitly disabled

Validation

Passed:

  • pytest tests/security/sandbox/test_ipc.py

@F16shen F16shen merged commit 90b22f6 into AI-Shell-Team:main Mar 17, 2026
9 checks passed
@F16shen F16shen deleted the fix/sandbox-ipc-selection branch March 18, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant