Repository navigation
Conversation
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
7 similar comments
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
5 similar comments
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
bd36bc1 to
14774a4
Compare
The sandbox hides whole credential homes (~/.docker, ~/.kube, ...) from every agent. That is the right default, but a deployment whose operators want agents to pull from a private registry has no lever short of turning the sandbox off, and no edition can add one without patching the launcher. Add SandboxPolicy.credential_file_grants(): an edition names $HOME-relative files to restore for one ACP agent spawn. The core resolves it off-loop on every spawn (never cached), refuses anything under the crew data home or the kiro trees, and the Linux namespace launcher restores each granted file as a read-only snapshot on a tmpfs private to the sandbox's mount namespace -- not the host-visible stand-in that extra_expose_files copies into -- while the rest of the hidden parent stays hidden. Reads use O_NOFOLLOW with type and size checked on the opened descriptor. Seatbelt and Windows drop the grant with a warning. The Default adapter grants nothing and a companion without the method grants nothing, so the public edition is unchanged. Consent, duration and storage of a grant stay with the edition.
14774a4 to
25df576
Compare
Problem / Motivation
Goal: Let an edition give an agent session read-only access to specific credential files (for example
~/.docker/config.json) while the sandbox keeps the rest of their directory hidden.The sandbox hides credential directories such as
~/.dockerfrom agent sessions. A downstream edition that needs an agent to use one of those files today has to disable the sandbox or carry its own launcher patches. There is no narrow, per-file way to grant access.This adds an optional
SandboxPolicy.credential_file_grants() -> List[str]method. The edition owns consent, duration and grant storage; core validates the paths and supplies the Linux namespace mechanism. Default and legacy adapters grant nothing.Why it matters
Without it, an edition whose users need agents to run authenticated tools (an image pull from a private registry, for example) can only turn the sandbox off or patch core. Both widen the agent's access far beyond the one file it needs, and patching core breaks on every upgrade.
Not a goal
credsStore/credHelpers).What changed (motivation → approach → change)
Hidden credential directories → let the edition name individual files, resolved once per spawn, and restore only those files as read-only snapshots inside the namespace → the changes below.
acp/launch.pypath. Client and runtime supply the resolver throughLaunchTools.extra_secret_filesthrough the sandbox wrapper and namespace planner. Accept normalized HOME-relative file names, reject crew data homes and kiro trees, and fail closed on malformed adapter results.O_NOFOLLOW, descriptor type checks and a 256 KiB limit.The implementation follows upstream's current planner/staged-launcher/shared-ACP-launch design. The branch contains one conventional commit.
Backwards compatibility
Compatible: every new parameter defaults to empty, and the default edition and companions without the method grant nothing, so sandboxed spawns behave exactly as on main.
Removes nothing: the change only adds an opt-in way to expose named files; every directory that is masked today stays masked unless an edition grants a file inside it.
Tests
Local validation of the published code tree:
The author/committer amendment preserves the exact tested tree:
4404e71a512bd92f01389b8362018a5e1b4a2e53. CI on the published head remains required.Manual verification
Passed on 2026-10-09 in a real Linux user/mount namespace, outside the nested agent sandbox. The test used a throwaway HOME, a generated test login, and a password-protected registry bound to
127.0.0.1:5055; personal credentials were not used.Control without a grant:
~/.dockerwas empty.With
.docker/config.jsongranted:config.jsonwas visible./run/user/<uid>,/dev/shmand/tmp.Related Issues
Supersedes the mechanism half of #6663 (closed). Related: #9131, #9010.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.