Repository navigation
Include Development AI agents in Sail #62404
Unanswered
mshamaseen
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Yesterday, I ran Claude Code on my host machine to work on a Laravel project. I had the bash sandbox option turned on in Claude’s settings so it wouldn't mess with anything outside, but it couldn't launch the sandbox because of Ubuntu AppArmor. So, running in auto-permission mode, it just went ahead and read my kernel logs and other system logs outside the project folder without even asking me. Realizing Claude Code still has full OS access even with the sandbox turned on was pretty terrifying.
After looking into it more, it seems the best way to properly lock it down is by using a VM or a Docker container—like Laravel Sail, which we're already using anyway. I tried setting up a dedicated AI container inside Docker Compose and linking it to the main app container, but it turned out to be really tricky and full of security risks.
Here’s why it’s vulnerable and needs super careful setup:
The .git folder isn't read-only by default: Sail mounts folders with write access, including .git. If an AI gets tricked into doing something malicious, it could inject bad code or hooks right into .git. Then, as soon as a developer runs a git command on the host (or an IDE triggers one automatically), that code gets executed on the host machine.
Missing read-only rules: The AI container really needs read-only access to sensitive stuff like vendor, node_modules, and .env files so it can't tamper with them.
No safe way to run host commands: The AI container still needs to run certain commands on the host (like git). There should be a secure bridge—maybe over SSH—where the AI container can only trigger a specific file on the host, letting the developer explicitly whitelist which restricted commands it's allowed to run.
Other hidden risks: I’m pretty sure there are plenty of other security edge cases to consider, but these are the main ones on my radar right now.
Solving this and building proper AI isolation into Sail would be a huge step for Laravel, especially with AI tools becoming such a big thing while security is still a huge concern.
All reactions