Repository navigation
Refuse host shell on Docker agents by default, and always for fork pull requests - #168
Merged
Merged
Conversation
…'s pull request A Docker agent ran a step in a container only when the step named an image and dropped every other step to its own shell, with no way to refuse. On the agent-docker Compose profile that shell is root beside the engine's socket, so a project writer, or a fork's author through an imageless step, had root on the host. FIBER_AGENT_ALLOW_HOST_SHELL now decides it: unset, it is false on a Docker agent and true on a shell agent, and anything but true/false/1/0 stops the agent at startup. The offer carries `untrusted` (serde default), and the agent never runs such a step on its host shell whatever the flag says, so a fork's pull request fails on a shell agent. The decision is one pure function, execution_mode, taken before any workspace prep. PROTOCOL_VERSION is 3. The agent-docker profile pins the flag to false and adds the docker=true label. smoke-runs expects the refusal and runs the fork's pull request in a container where an engine is available. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ell for it An agent below protocol revision 3 ignores `untrusted` on the offer and would run the fork's step on its host. The scheduler now keeps the agent's Hello revision and leaves untrusted steps out of the candidates for a project agent below UNTRUSTED_OFFER_PROTOCOL: filtered in the query, before the scan limit and before any lease, so the steps stay queued for an agent that qualifies and the trusted steps behind them are still offered. The session warns once when such an agent connects. The plain Compose agent gains the executor=shell label, because docker=true on the Docker agent only lets an image step opt in: a step matches any agent holding every label it asks for. The docs say that, that the agent-docker pin needs an agent image of this release, and that a refused step with retries may land on a different agent. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Audit finding SEC-1 (11 Nov). Breaking for imageless steps on a Docker-enabled agent.
The bug
A step with no
image:ran on the agent's host shell even when the agent hadFIBER_AGENT_USE_DOCKER=true, and nothing could refuse it. On theagent-dockerCompose profile that shell is root with the host Docker socket mounted, so any project writer — or a fork PR author, through any imageless step that runs repo scripts — reached the Docker host and, from there,FIBER_SECRETS_KEY.The fix
FIBER_AGENT_ALLOW_HOST_SHELLon the agent. Default: on for a shell agent, off for a Docker agent. Parsed strictly at startup. A refused step fails before any checkout or restore, with the remedy in its error.untrustedonServerMessage::Offer(serde(default)), set from the run row. The agent refuses host shell for a fork PR's step regardless of the flag — including on a pure shell agent, where the step now fails rather than running on the host.Hellodeclared protocol revision 3 (this release); older agents ignoreuntrusted. The steps stayqueueduntil one is online. Filtered in SQL ahead of the scan limit so they cannot hide trusted steps.PROTOCOL_VERSION2 → 3. Nothing compares for equality; old agents and old servers interoperate.agent-dockerpins the flag tofalseand addsdocker=true; the plain agent gainsexecutor=shellso an imageless step can ask for it. The pin only takes effect with an agent image from this release — the docs say how to confirm from the startup log.FIBER_AGENT_ALLOW_HOST_SHELLline across re-runs.agents.md,triggers.md,pipeline-yaml.md,configuration.md,SECURITY.md) and CHANGELOG.Decision table
Verified
make checkgreen;cargo test --workspacegreen (458 tests), including a 16-row table test over the decision, theserde(default)forward-compat test, and the eligibility test. Each was broken, seen red, and restored.docker compose configrenders the expected labels and flags.Not verified locally
scripts/smoke_runs.pywas rewritten (shell agent must refuse; Docker agent must run the step without the secret) and has only been syntax-checked —smoke-hoston this PR is its first real run.agent-dockerCompose profile end to end.🤖 Generated with Claude Code