Deliver env to every exe session, and document the sbx policy rule - #33
Conversation
|
Acceptance rerun on this branch, image built from
Each passing run, from inside the box: the placeholder and the exchange URL in the session, a model call through the exchange answering 200 with one fetch at the issuer, the placeholder refused straight at Anthropic with 401, a wrong placeholder refused with 403, an exchange restart costing one fetch and no failure, and a clean delete. On exe the fix in this branch does what it should. A plain SSH session now shows |
|
exe passes too, 11 of 11, after one tailnet grant: All three providers pass the same sequence from inside the box on this branch. |
exe puts --env in /etc/profile.d, which only a login shell reads. A plain SSH command session, which is how an agent runs, saw nothing. exe's own sshd has no PAM, so /etc/environment does nothing there. A plain session does read ~/.bashrc. The exe adapter now always sends a setup script when env is given. The script puts the exports at the top of ~/.bashrc with a heredoc, then runs the body. --env stays for login shells and the exe UI. The writer is environment.bashrc. The exchange is the first flow from a sandbox to drukbox. The network needs one rule for it: one address, one port, every sandbox. The deploy doc gives it as a tailnet grant, and as the sbx policy rule next to the daemon start. Verified on three beds from inside the box: docker on the production host, docker-sbx on a KVM host, exe on the production host. Each run saw the placeholder in a plain session, a model call through the exchange with one fetch at an issuer, 401 for the placeholder at Anthropic, 403 for a wrong placeholder, one fetch after an exchange restart, and a clean delete.
f994997 to
1855cec
Compare
Summary
--envlands in/etc/profile.d/exe-env.sh. Only a login shell reads it. A plain SSH command session, which is how an agent runs, saw no variables. exe's own sshd has no PAM, so/etc/environmentdoes nothing there. A plain session does read~/.bashrc. The adapter now always sends a setup script when env is given. The script puts the exports at the top of~/.bashrcwith a heredoc, then runs the body.--envstays for login shells and the exe UI. The writer isenvironment.bashrc, besidepersist.sbx policy allow networkline next to the daemon start. No provider code.Verification
uv run ruff check,uv run ruff format --check,uv run pyrightuv run pytest: 555 passed. The exe tests compare the setup script line by line.tcp:8880