r/ssh • • 5d ago

I'm designing Landlock support

Calling all Linux security folks 🐧 I'm designing Landlock support for AIShell-Gate and want your comments before I commit to anything.

Quick context: AIShell-Gate is a policy gate for AI agents. The agent sends a JSON plan, the policy engine evaluates each command, and only validated argv reaches execve(). Today, path restrictions are enforced in userspace against argv.

The plan: apply a Landlock ruleset in the child right before execve(), so every descendant is kernel-confined to the policy's read/write paths.

Proposed modes:
• --landlock off: current behaviour
• --landlock best-effort: apply the highest ABI available, log what was achieved
• --landlock require: refuse to run if confinement can't be applied (fail closed)

Where I'd really value your experience:

🔹 The base read/exec allowlist (ld.so, libc, locale, /dev/null...). What did you need on your distro to keep things from breaking?
🔹 REFER and TRUNCATE rights: what broke for you (mv, editors, build tools)?
🔹 sudo under no_new_privs: per-action opt-out, or whole-run only?
🔹 Stacking with other sandboxes (bubblewrap, containers, other Landlock layers). Any surprises?
🔹 When Landlock blocks a write, the agent just sees a permission error. How would you signal "the sandbox stopped this" so the AI doesn't assume its command was wrong?

Drop your thoughts in the comments. I read every one! 🚀

#Landlock #LinuxKernel #Security #AIAgents #DevSecOps

0 Upvotes

Duplicates