docs: optimize AI agent sandbox instructions#1041
Conversation
- Map host user to 'ubuntu' user (UID 1000) for consistent permissions - Use '--type native' for Multipass mounts to avoid Errno 75 - Explicitly forbid 'snapcraft --destructive-mode' - Add CRAFT_VERBOSITY_LEVEL=debug for better build visibility - Add troubleshooting for nested snapd/LXD issues
There was a problem hiding this comment.
Pull request overview
Adds a new .github/CLANKERS.md guide intended for AI agents contributing to craft-application, with a strong focus on consistent local sandbox/VM setup for Snapcraft-based end-to-end testing.
Changes:
- Introduces AI-agent oriented repository context (architecture, workflow, standards, testing strategy).
- Documents manual sandbox setup for LXD (
lxcCLI) and Multipass, including UID/GID mapping and recommended environment variables. - Adds a troubleshooting checklist for nested snapd/LXD issues inside the sandbox.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Restore accidentally-removed documentation commands (make docs, make lint-docs) - Fix Multipass bootstrap section (had launch/mount/start duplicated instead of the actual bootstrap commands) - Add one-time snapcraft LXD profile setup instructions with the actual fix for the nested CAP_MAC_ADMIN/AppArmor issue - Add structured snap build troubleshooting section - Provide snark credit where snark credit is due Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix malformed > [!IMPORTANT] admonition syntax - Document why security.privileged=true is required (CAP_MAC_ADMIN delegation for nested snapcraft containers) - Rename 'LXC' labels to 'LXD' throughout — the lxc CLI is the LXD client, not LXC; using LXC terminology is confusing - Fix prose: 'cd (multipass)' → '--working-directory (multipass)' - Add HYPOTHESIS_SUPPRESS_HEALTH_CHECK=too_slow to Multipass example to match the existing note about it Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - `security.privileged=true` / `security.nesting=true` — allow the nested build container to run snaps. | ||
| - `lxc.apparmor.profile = unconfined` — removes AppArmor confinement from the build container so `snapd` can operate. | ||
| - `lxc.cap.drop =` (empty) — clears LXD's default capability drop list, restoring `CAP_MAC_ADMIN` and `CAP_MAC_OVERRIDE` so `apparmor_parser` can load profiles inside `snapd`. | ||
|
|
There was a problem hiding this comment.
The instructions here explicitly disable AppArmor confinement (lxc.apparmor.profile = unconfined) and clear the capability drop list for nested build containers. That materially weakens sandbox isolation; the doc should add a clear WARNING about the security implications and steer readers toward safer alternatives (e.g., prefer host builds on Linux / avoid inside-container builds unless strictly necessary).
| **WARNING:** The above LXD profile settings significantly weaken the isolation of the nested build container by disabling AppArmor confinement and restoring powerful capabilities on the inner container. Only use this configuration in disposable, trusted environments where you fully control both host and guest. Prefer building snaps directly on a Linux host or in a dedicated VM, and avoid running nested privileged build containers inside another sandbox unless it is strictly necessary for your workflow. |
security.privileged=true and security.nesting=true were only ever needed for running snapcraft pack from inside the container. Since snapcraft now runs on the host, a plain unprivileged container is sufficient for all dev/test tasks. Document this clearly. Also: counter-counter-snark applied. The wall is gone. So is the room it was guarding. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Authored by a clanker.
- Added Cursor-specific snark regarding rule-file hierarchies. - Made snapcraft installation optional in the sandbox container since packing is now primarily host-based. Authored by a clanker.
Discovered during container validation that omitting security.nesting=true causes LXD integration tests to hang silently forever rather than failing with a useful error. Since nesting carries no meaningful security cost (unlike security.privileged), just include it unconditionally. Also: warned Gumloop agents about their operator's wallet. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Proof that LLMs were trained on facebook and nextdoor comments |
Updates
CLANKERS.mdto improve the AI agent sandbox configuration instructions.Changes: