Repository navigation
Confirm policy and assurance level: close completion, history recall and forged confinement - #2
Merged
Merged
Conversation
Under --policy confirm only the first Enter an agent types is held; every byte before it reached the shell at once. Tab therefore ran shell completion in the person's unconfined shell, and bash-completion runs project files to complete (./configure --help, make -npq evaluating $(shell ...)), so an agent that wrote such a file got code execution with no approval (review COT-1). Up and Down recalled commands typed in private mode onto the screen, where the agent could read them (COT-3). The allowed keys are now decided per key from the default readline and zle bindings (emacs and vi mode), with the reasoning in keys.go: Tab, BTab, Up, Down, PgUp and PgDn are refused; text may no longer hold tabs, history expansion (! and ^, which magic-space expands without an Enter and which change the line that runs after approval) or, outside a UTF-8 locale, bytes above 0x7f (readline's convert-meta reads them as Meta keys, and M-C-e runs command substitutions). Private mode cannot keep a line out of every shell's history, and under the auto policy an agent can always run `history`; README and docs/broker.md now state that where private mode is described, with the shells the confirm refusals cover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agentAssurance reported an agent `confined` for being in another user or pid namespace, or in a cgroup named cotty-agent*, and `strong` once the guard also had a tag for it. Any process can give itself all three (`unshare -U`, a cgroup in its delegated subtree, the guard's tag-self), so an unconfined agent could pass --require-confined and hide the person's red warning (review COT-2). The broker now checks what a process cannot give itself: pid 1 of the peer's pid namespace must be the broker's own root-owned cotty binary running cotty agent's init stage, and the peer must be in that namespace's user namespace and mount view (a process that entered the namespaces from outside is not), with no_new_privs and, where cotty has a seccomp filter, one in place. Everything that cannot be verified is weak: an invisible pid, unreadable /proc entries, a user-writable cotty binary. A guard tag only lifts a verified agent to strong; a self-tag never raises the level, so tag-self can stay open to everyone. The docs say what the level still cannot tell: it describes the MCP server process that connects, and a program that already has all of the person's rights can start a confined MCP server for itself. The broker matrix gains rows for unshare and tag-self forgeries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Landlock absent from the kernel (ABI 0), ApplyLandlock returned an error the exec stage ignored, and on a host without a display or bus the launcher accepted ABI < 6 with no flag, so the agent ran with only the mount view, seccomp and its cgroup while the session reported it `confined` (review COT-4). The launcher now refuses ABI 0 unless the person passes --allow-no-landlock, and records that decision in the spec; the exec stage goes on without Landlock only with it and stops on any other Landlock failure. The broker treats a kernel without Landlock as no confinement, so --require-confined refuses such agents, and cotty doctor reports sessions as weak there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI installs exactly the go line of go.mod, which said 1.26.0, so the binaries were built with an old standard library; it now names 1.27.4, the current release. The workflow's actions were pinned by tag and are now pinned by commit SHA (checkout v7.0.1, setup-go v7.0.0) with persist-credentials off, and a Dependabot config keeps Go modules and actions current, matching the sibling repos (review COT-5). No CI check that the committed BPF object matches bpf/guard.bpf.c is added: CI has no clang/llvm toolchain today and the object is regenerated by hand in a lab VM (make bpf). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TestShortHelperDoesNotStickLock and TestLateExecPromptDetected copied the system's sleep to pinentry-tty to stand for a listed prompt program. GitHub's ubuntu-latest moved to Ubuntu 26.04, where sleep is the uutils multicall binary: it picks the utility from its own name, so the copy exits at once as "pinentry-tty" and the lock never lights (CI run 43477142151; the last green run on main used ubuntu-24.04). The copy is now of the test binary, which TestMain turns into sleep(1) when started under that name. The assertions are unchanged. Co-Authored-By: Claude Opus 5.5 <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.
Title: Confirm policy and assurance level: close completion, history recall and forged confinement
Fixes from an outside review of cotty (findings COT-1 to COT-5), one commit per area.
Confirm policy (COT-1, COT-3)
history. README and docs/broker.md now say so where private mode is described, with the shells the confirm refusals cover (bash and zsh, default bindings).Assurance level (COT-2)
No Landlock (COT-4)
Build (COT-5)
Behaviour changes
Tests
🤖 Generated with Claude Code