Skip to content

Opt-in redaction of credentials in everything the server returns - #312

Merged
GavinLucas merged 14 commits into
mainfrom
feature/credential-redaction
Nov 9, 2026
Merged

GavinLucas merged 14 commits into
mainfrom
feature/credential-redaction

Conversation

@GavinLucas

@GavinLucas GavinLucas commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

This adds an opt-in mode that keeps credentials out of everything the server returns, while still letting an agent use them in writes. It follows from #300, which reported that container_list handed an agent every container's environment. #301 already made list output compact by default; this is the masking half of that request.

This mode reduces accidental exposure. It is not access control. An agent that can run commands in a container can still read a credential. Run it with DOCKER_MCP_SERVER_READONLY, or mark a redacted host (ro,redact). REDACTION.md documents what the mode does, what it misses, what it costs and the boundary it protects.

Turning it on

What How
Every host DOCKER_MCP_SERVER_REDACT=1
Chosen hosts, for example production only (redact) on a host in DOCKER_MCP_SERVER_HOSTS, such as prod=ssh://ops@prod(ro,redact)
Extra variable names to treat as credentials, or ! to exclude one DOCKER_MCP_SERVER_REDACT_NAMES

The .mcpb bundle and the Claude Code plugin offer the same settings. host_list and tool_list report the effective settings, and the server warns at startup about a redacted host that is not read-only.

What it does

  • Every tool result, resource body and error message from a redacted host is redacted. Output from a host that is not redacted is never touched.
  • Two sources of credentials:
    • values read from the daemon under credential-like names: container, image and service environments, build arguments in image history, Compose .env files and credential-named Swarm configs. These are matched raw and in their encoded forms.
    • values found by their shape or context: private keys, known token formats, URL passwords, the value after a credential-named flag such as --password, and long random runs.
  • Each replacement is a marker, [REDACTED:<token>]. No two markers can be linked, and a marker reveals nothing about the value it replaces.
  • On a redacted host that accepts writes, a marker passed to a write is swapped back for the real value, so an agent can use a credential it never sees.
    • A marker from another host, from an earlier server run, altered, or for a value that was never stored is refused before anything runs. The error names the argument, never the value.
    • A marker is also refused where a credential could leak: names, image metadata, build arguments and a CLI's command line. The error gives the secure route instead (env or vars).
  • A file or archive the write reads that holds a marker is refused, since a marker means nothing outside this server.
  • Credentials passed to the CLI-backed tools never go on a command line, on either machine. The tools gain a vars argument, and env and build_args values reach the CLI through its environment, delivered on stdin when the SSH fallback runs the CLI on the remote host. This holds whether or not redaction is on.
  • Raw bytes can't be redacted without corrupting them. container_archive_get, and the in-band forms of container_export and image_save, are withdrawn under the global switch and refused on a redacted host.

Also in this PR

  • An SSH host's key is now checked by its name. Previously, when a connection fell back to another address, docker-py's client was checked against known_hosts by that address. So a host whose first address times out failed against a stale entry, while ssh connected. The fix reaches past docker-py's public API, approved and recorded in Measure redaction on real daemons, offer it in the install dialogs, and cut its false replacements #309 and in architecture/docker-sdk.md.
  • MCP_VS_SKILLS.md is regenerated. scripts/measure-comparison-figures.py now prints every figure the document quotes, including the summary ranges that were previously worked out by hand.
  • Smaller fixes from the weekly audits: two tool descriptions (image_push, compose_exec), four recorded SDK choices, and _wait_stack reading one service's tasks through Service.tasks.

How it was built

Merged PR What it built
#303 settings and the per-host option
#304 credentials off command lines (vars)
#305 the core: store, markers, forms, shape rules, matcher
#307 redacting output, with a fresh harvest
#308 swapping markers back, and the refusals
#309 measurement and the install dialogs
#310 pre-merge fixes and figures
#311 testing in every configuration

Testing

  • Unit: 2,216 passed. ruff, pyright and pydoclint are clean.
  • Integration against Docker Desktop: 108 passed, 30 skipped. The skips are environmental: no Swarm, Scout not logged in, no SSH test host.
  • Redaction sweep in every configuration (scripts/measure-redaction.py sweep --configuration all), on a throwaway Docker daemon with Swarm. It covers per-host and global redaction, each writable and read-only. In all four:
    • The agent is told and offered the right things: the instructions pointer, the host_list notes, and the tools withdrawn.
    • Every planted credential redaction could reach was caught, except the misses REDACTION.md documents.
    • No real content was replaced by mistake.
  • A real agent (scripts/measure-redaction.py agents): a headless Claude Code with only this server's tools ran eight everyday requests, read-only and writable.
    • All 16 runs came out as expected, and no credential appeared anywhere in any transcript.
    • Read-only writes were declined cleanly.
    • Writable writes carried the credential through a marker.
    • Triage found the real fault and did not blame a correct password it could not compare.
  • Real daemons:
    • Docker Desktop.
    • Docker 26.1 and 28 daemons, with Swarm.
    • A large throwaway daemon of 2,000 containers and 500 images, for cost.
    • A real stack_deploy on Swarm, with a marker passed in vars.
  • Remote:
    • The sweep against a remote Docker 29 daemon over SSH.
    • Swap-back through the SSH remote-exec fallback, from a host with no docker CLI.
    • vars delivery on a FreeBSD 15 host's sh: values with newlines, quotes and shell metacharacters arrived intact, and appeared in no process's command line.

Accepted limitations

These are stated in REDACTION.md:

  • Misses:
    • a word-like secret with no credential name beside it;
    • a random value with no name beside it, which the shape rules catch only most of the time;
    • anything transformed before it is printed.
  • Cost: a few tens of milliseconds per call on a small daemon, about 140 ms on a large one, and more on large results. scripts/measure-redaction.py cost regenerates these figures.

Size

About 3,300 lines of new package code, 3,800 of tests, 1,100 of measurement scripts and 800 of docs. Around a third of the package (swap-back, the refusals and the file search) serves a redacted host that accepts writes. The docs advise against that setup, but without it an agent could not recreate a container or run a write that needs a credential it has only seen as a marker.

…#303)

* Bump version to 2.3.0

2.3.0 is the release scheduled for opt-in credential redaction, built on this
feature branch.  Bumped first so every artefact built from the branch carries
the version it will ship as.  All five declaring files and the lock self-entry
move together; the pin tests and preflight fail on any disagreement.

* Read and report the redaction settings and the per-host redact option

Adds the configuration surface opt-in credential redaction is built on.
Nothing is redacted yet: the settings are read, validated and reported, and
while any host is configured for redaction the server warns at startup that
this build returns output unredacted, so the setting cannot be mistaken for
protection before the redactor exists.

DOCKER_MCP_SERVER_REDACT turns the mode on for every host, and a host in
DOCKER_MCP_SERVER_HOSTS can carry a redact option instead.
DOCKER_MCP_SERVER_REDACT_NAMES adds names to the built-in credential-name
globs, with ! to exclude.  A malformed entry stops the server, and the error
gives the entry's position rather than its text, because the likeliest
mistake is NAME=value and repeating it would log a credential.

Host options can now go in one comma-separated bracket, (ro,redact), as
well as one per bracket, and the two mix.  That needs the host list split
only on commas outside brackets, and the bare single-host form recognised
by an = outside brackets.  The second also fixes an existing bug: a bare
endpoint with (tls=<dir>) failed to parse, because the = inside the
bracket made the value read as a label=endpoint list.  tls= takes the rest
of its bracket so a directory containing a comma still parses, and so has
to come last in a list.  Unbalanced, nested and empty brackets, and an
option bracket anywhere but the end of the endpoint, are refused at
startup naming the host: left in the URL, a misplaced redact would be
silently ignored.

The effective settings appear in tool_list and the tool catalog switches,
and per host in host_list, the hosts resource and the startup roster.
settings.redacts() is the one place the global switch and a host's option
are combined.  Startup warns when the switch is on without READONLY, for
each host marked redact without ro, and when names are set with redaction
on nowhere.

The built-in name globs are a judgement from the words the design names
(password, passwd, secret, token, key, cert): the spike measured with a
pattern it did not record.  They are re-measured against real daemons
once the redactor exists.  A test keeps the list in REDACTION.md equal to
the code's.

* Report redaction warnings where the disable warnings go, and judge them per host

Review of the settings slice found the redaction warnings reached stderr
only.  An MCP client rarely shows a server's stderr to anyone, which is why
DOCKER_MCP_SERVER_DISABLE mistakes are also reported in tool_list and by a
pointer at the top of the instructions.  configuration_warnings() now joins
the two sources and feeds all three places, and the pointer line is reworded
to cover both.

The global-switch warning claimed exec and the file-writing tools stayed
available even when every host was ro, where per-host ro removes them as
READONLY does.  Warnings are now judged per redacted host, whichever way it
is redacted.

The interim "nothing is redacted yet" warning and the status note in
REDACTION.md are tied to one flag, OUTPUT_REDACTED, and a test holds the note
to it, so neither can outlive the other.

Also: an unbalanced or nested bracket in a host list now names the host it is
in rather than the variable; conftest clears the two new variables so a shell
value cannot pin redaction on or abort collection; the hosts resource
description lists the redact flag; the redaction variables move to their own
README paragraph, since they do not restrict which tools are registered; and
the server.py comment restating the variables becomes a pointer.

* Quote only the offending entry when a host-list bracket is unbalanced

An entry with no = before the bad bracket made the error quote the rest of
the value, neighbouring entries included.  The label is now cut at the
entry's first comma.
…s command line (#304)

* Pass credentials to the CLI-backed tools in its environment, never its command line

Six CLI-backed tools gain `vars`: compose_up, compose_run, compose_build,
stack_deploy, buildx_build and buildx_bake.  It sets variables in the docker
CLI's own environment, for Compose and stack `${VAR}` substitution, bake
variables and a build secret's env=, none of which had a way in other than the
server's own environment or a file.  The values of compose_run/compose_exec
`env` and buildx_build `build_args` move the same way, as a bare `--env NAME`
or `--build-arg NAME` the CLI resolves from its environment, so none of them
shows in any process list.  Verified against compose 5.6.1, buildx 0.38.1 and
docker stack 29.9: each bare form, bake variables, secret env= and stack
substitution all read the CLI's environment, values with newlines, quotes and
$(...) intact.

Only CLI-backed tools need this: SDK-backed tools send values to the Engine
API in a request body.  Every tool given `vars` is a write, so READONLY drops
all of them; a test holds the exact set and its absence under READONLY.

A name the CLI acts on would let a caller retarget it past host pinning
(DOCKER_HOST), run code in it (LD_PRELOAD, DYLD_*, GIT_SSH_COMMAND), redirect
its traffic (*_PROXY) or break its credential helpers (PATH).  `vars` refuses
those names; `env` and `build_args` keep passing them as NAME=VALUE, since a
container's PATH or HTTP_PROXY is legitimate.  A name set in both `vars` and
`env` with different values is refused.  Errors never repeat a value.

Over the SSH fallback the values travel on the channel's stdin, each byte as a
\0ddd escape decoded by POSIX printf %b (base64's decode flag differs between
GNU, macOS and the BSDs).  The wrapper reads them in the foreground into
reserved-prefix variables and assigns the caller's names only inside the
subshell that execs the command: an earlier draft assigned them in the main
shell, where a caller's `m` would have redirected the trap's rm -f.  Checked
under dash, busybox ash, bash and macOS sh, including a value named `m`.

Adding six parameters costs 1,296 bytes on every session after trimming the
descriptions; the tool ceiling, which had 398 bytes left, the total and
buildx_build's per-tool ceiling are raised with the usual two per cent.

* Check the remote process list without the probe matching its own pattern

The first version grepped the far host's process list for the value's text,
and that text was in the probe's own `sh -c` script, so every process carrying
the script (the wrapper, its shell, the probe) matched: four hits on a real
host with no value exposed.  The pattern is now written `s3[ ]cret`, which
matches the value but not itself, matching lines are printed so a failure
names them, and a control test puts the value on a command line deliberately
and requires the same check to find it.  Both pass against a real ssh:// host.

* Keep shell-special names off the remote path, and say where values still show

Review found that bash running as `sh`, the default /bin/sh on the Fedora
family and macOS, makes UID, EUID and PPID read-only and ends a POSIX-mode
script on a failed assignment, so `vars={"UID": ...}` or `env={"UID": ...}`
worked through a local CLI and returned "UID: readonly variable" over the SSH
fallback; RANDOM, SECONDS and the like were silently replaced by the shell's
own values.  Confirmed with `bash --posix` and Fedora's `sh`; dash and busybox
accept the assignment, which is why the shell tests, running bash as itself,
missed it.  Such names now take the same route as a dotted name: refused in
`vars`, passed on the command line by `env`/`build_args`, on both backends so
local and remote agree.  The shell test matrix adds `bash --posix` and Fedora's
`sh`.

The reserved list gains BASH_ENV and ENV, which run code in any shell script
the CLI starts, and XDG_CONFIG_HOME, which moves git's config; it is described
as a best-effort denylist.  The tool descriptions and README now name every
kind of name whose value still reaches the command line; the README describes
the reserved categories and points at the function instead of copying a list
that had already drifted; a test holds the docs' list of `vars` tools to the
code's.  compose_exec gains a real-CLI integration test.  A test that could
not fail is removed, and recorded state in comments and the architecture note
becomes references to the tests that hold it.

* Sort the _ssh_proxy imports in _cli.py
…d matcher (#305)

* Add pyahocorasick, and declare cryptography, for the redaction core

The redactor has to find every stored value's encoded forms in each result
in one pass.  Measured with the forms the design lists, Python's re cannot:
500 values (3,500 literal alternatives) took 3.2 s to scan 120 KB and 24 s
for 1 MB, and 5,000 values did not finish.  Aho-Corasick scans 1 MB in 72 ms
at 5,000 values and 189 ms at 100,000.  pyahocorasick was chosen over
ahocorasick_rs, which matches about twice as fast, for its wider wheel set
(musllinux and universal2 macOS for 3.14), its more recent release, and
needing only a C compiler if a wheel is ever missing.  The floor is the
release verified to provide Automaton.iter_long.

cryptography was transitive through paramiko; the markers now import it for
AES, so it is declared, deliberately without a bound, as AGENTS.md records for
this package.  Each gets a guard test for the API the code relies on in place
of a cap.

* Build the redaction core: value store, markers, forms, shape rules and matcher

Nothing calls it yet; the change that wraps tool and resource output does.

The store holds each redacted value once per host, harvested or discovered,
with every limit as a named constant: discovered values matched up to 16 KB
and stored up to 100,000 or 64 MB, then redacted but not stored, logged once
per host; a 256 MB overall budget that refuses every call once a harvested
value would pass it.  Values sit in a type that never prints and refuses to
be pickled.  Nothing is evicted.

A marker is one AES block under a per-process key holding the value's
identifier, form, host, a 5-byte counter and a check field, so two markers
for one credential are unrelated and an unstored value's marker looks like
any other.  An altered marker and one from an earlier process cannot be told
apart; both fail the check field, and the refusal says so.

Forms cover raw, base64 (standard and URL-safe, whole and inside a blob at
every alignment), base32, hex and URL-encoding.  Writing the tests found two
bugs in the first draft: trailing padding agreed between the two encodings
used to find a blob-independent core, stretching the core over neighbour
bits, and padding counted towards the minimum form length.

The shape rules follow the list in the redaction design, plus the
credential-named flag rule, including where Docker reports a command as a
list, which a check against a real container showed the text rule alone
missed.  An intermittent test failure turned out to be a product defect: the
generic rule treated any run containing `//` as a path, which random base64
does about one time in five at 800 characters.

The MCP SDK runs sync tools on worker threads concurrently (four calls on four
threads, checked), so the store and counter take locks and the matcher swaps
in a new index whole.  The matcher adds new forms to a small automaton and
merges into the large one at a quarter of its size, since a full rebuild takes
19 s at 100,000 values.  Running out of identifiers or counter starts a new
generation; a redaction caught by that is refused rather than finished
against the empty store, where an unmatched value would come back unredacted.

* Fix the redaction core's concurrency, overlap and performance faults found in review

Concurrency: a value is indexed outside the store's lock, and a second add of
the same value returned before the first had indexed it, so a concurrent call
could redact against an index without it and return it in clear.  A second
add now waits until the value is indexed, a value that fails to index is
removed again, and checking for and storing a value happen in one locked
block: splitting them, as the first fix did, let the concurrency test store
one value twice.

Overlaps: the redactor kept the longer of two overlapping spans, leaving the
head of the other in the text, and the matcher's longest-match iteration never
reported the tail of a value overlapping an earlier one.  The matcher now
reports every match and the redactor replaces each overlapping cluster whole,
as one discovered value where no single span covers it.

Performance: the assignment and URL rules opened with an unanchored repeated
class, so `re` re-scanned a long run from every position: 48 s for one 50 KB
base64 line, measured.  They now start only where a run starts and repeat
possessively; the same input takes 10 ms.  The matcher rebuilt its whole small
automaton on every add, quadratic overall; it is now size-tiered levels merged
at a ratio of four, about log4(n) rebuilds per form, and adding nothing new
rebuilds nothing.

Errors: the budget refusal is a ToolRefusalError and a rotation a new
RedactionResetError, both with messages, so the wiring cannot turn them into a
bare "Error executing tool".  A rotation while storing is now refused too,
since the values stored before it are gone.

Also: the cryptography guard test is dropped, as AGENTS.md's settled entry
says not to assert it in CI, and that entry is corrected to say it is now
direct; a redundant credential-word set that bypassed `!` exclusions is gone;
a test holds REDACTION.md's limits table to the constants; recorded figures
and fix history are out of the prose.

* Close the remaining gaps in the redaction core's concurrency and name matching

A call waiting on another's indexing of the same value returned that value's
entry even when the indexing had failed and rolled it back, so it reported a
value neither stored nor indexed.  It now re-checks after the wait and stores
the value itself if it is gone.  The rollback now undoes the accounting of
whatever is stored at that point, since a concurrent harvested add may have
promoted the entry meanwhile.

The look-behind added to make the assignment rule linear stopped it matching
a name after a digit: `2FA_SECRET=<random>` was missed.  The name is now the
whole run, digits included, which the `*WORD*` credential globs still match,
and the scan stays linear.

The pyahocorasick guard and its pyproject comment now describe what the
matcher relies on, `Automaton.iter` reporting overlapping matches, rather than
`iter_long`, which it no longer uses.  The linear-time test compares two input
sizes instead of asserting a wall-clock bound, and stale prose and list
numbering in the architecture note are corrected.
* Redact tool, resource and error output from redacted hosts, with a fresh harvest

Every registered tool and resource is now wrapped, outermost and outside the
failure translation, so results, resource bodies and error text from a
redacted host are redacted.  Each call is judged by the host it reaches: a
tool by its host argument or the default host, a resource by the host in its
URI or the default host.  An unfiltered host's output passes through
untouched.  Tools that reach no daemon are listed, and a test holds the list
to the registered tools without a host argument; resources must declare their
scope when registered.

The harvest reads credential-named values from container, image and service
environments, image history build arguments, credential-named Swarm configs
and a Compose project's .env.  It stays fresh with a bounded events query per
call rather than a background thread, re-harvesting only on the events that
can bring a new value (a container created; an image pulled, loaded,
imported, tagged or built; a service created or updated; a config created):
harvesting on every container event cost a full harvest per call, because a
running container emits exec, attach and health events.  The query's `until`
must not be in the future, or the daemon holds it open until then, which
cost every call a second; measured against Docker Desktop, a redacted call
now costs about 10 ms over an unfiltered one after a first harvest of about
1 s.

A harvested value under eight characters is matched only as a whole token,
so `pw` is not replaced inside `pwd`, where the context would give it away.

Under the global switch container_archive_get is not registered and
container_export and image_save advertise dest_path as required; on a
redacted host their in-band forms are refused.  host_list reports each
redacted host's store state; the instructions say markers are valid only as
tool arguments in this session; core dumps are switched off at startup while
redaction is on.  The interim "not redacting yet" warning and status note go.

* Point the instructions at host_list for redaction, and tighten the CLI caveat

The redaction rules differ per host: whether output is redacted, and
whether files written to disk escape it, depend on the host's redact and
read-only options as well as the global switches.  Spelling that out in
the server instructions pushed the worst case past the 2048 UTF-16 units
Claude Code keeps, which it truncates silently, and every later addition
would have to evict something else.  The instructions now carry one
pointer line, only when some host is redacted, and host_list carries a
"redaction" entry per redacted host with the notes that apply to it and
the value store's state.  The note about files on disk is left out for a
read-only host, where no tool writes one.

The CLI caveat says the same in fewer words, which brings the longest
rendering to 2043 units.

_prepare's propagated-exception marker now sits on a documented Raises
section, as the docstring guard test requires: the marker suppresses
only pydoclint's inability to resolve error_cls to a type.

* Keep the harvest fresh by ID snapshots, and close the gaps review found

The harvest no longer depends on the daemon's event history.  moby keeps
only the last 256 events (eventsLimit in daemon/events/events.go), and a
host running a few healthchecked containers emits that many in minutes,
so a container's `create` could fall out of the window between two calls
and its credentials go out unredacted.  The window was also judged by the
daemon's clock against this server's, so skew either opened the same gap
or held every call open until the daemon caught up.  Each call now
compares a snapshot of container, image, service-version and config IDs
with the last one and harvests again when it differs; the snapshot is
taken before harvesting, so an object created in between is seen as a
change next time rather than counted as harvested.  Against Docker
Desktop with 108 images this costs about 34 ms per redacted call, against
about 9 ms for the events query; most of it is the image listing.

A result naming an ID the snapshot has not seen now prompts one snapshot
comparison, once per ID, rather than a full harvest every time: network
and plugin IDs and removed containers' IDs look the same.

A harvest failure was raised raw, outside the failure translation, so it
reached the client as a bare crash, and system_reconnect could not
recover a redacted host whose client was wedged.  A library failure in
the harvest now refuses the call with the daemon's own message (output
that might hold an unread value is never returned), the connection-
control tools run no harvest, and containers or images removed while the
harvest runs are skipped rather than failing it.

A short harvested value counted as a whole word only between a fixed list
of characters, so it escaped in `[pw]`, `pw.` or `user@pw`; any non-word
character now bounds it.  The Compose `.env` reader follows Compose's own
rules for quotes and inline comments, and reads the file beside the first
compose file when files are named.

The host_list notes are built from BYTE_TOOLS and the new FILE_TOOLS,
naming only tools registered and allowed on that host, and tests hold the
REDACTION.md lists to both and to NO_DAEMON_TOOLS.  The marker note and
REDACTION.md now say plainly that markers passed to a tool are not
swapped back yet.  The interim OUTPUT_REDACTED flag, its warning, tests
and architecture paragraph are gone, and architecture/server.md describes
the redaction wrapper outside the failure translation.

* Follow Compose's .env quoting, bound the checked IDs, and state limits as they stand

The .env reader now applies compose-go's dotenv rules as its parser
does: a backslash before the closing quote escapes it in either quote
style, any other backslash is kept, an unquoted value ends at " #" only,
and an unterminated quoted value yields nothing, since Compose refuses
the file.  Previously `KEY="a\"b"` was harvested as `a\`, so the real
value went unredacted.  Escape-sequence expansion in double quotes,
variable interpolation and multi-line values are not followed, and
REDACTION.md says so.

The IDs a result names that are not containers or services were kept
for the life of the process.  They are external input, so they are now
forgotten whenever the snapshot changes and capped at 10,000 between
changes; forgetting one costs only a repeated snapshot comparison.

The docs and the host_list note describe the marker limitation as it is
today, without "yet" or "until", and the architecture note keeps the
reason not to use the daemon's event history without the history of the
design or another project's constant.  The host_list paragraph in
REDACTION.md had become ungrammatical and is a plain list again.

* Hold the checked-ID set to its bound for any one result, and rewrap REDACTION.md

The set was cleared when an addition would pass the bound, but then took
every unseen ID, so one result naming more than the bound left it above
it until the next snapshot change.  IDs beyond the bound are now left
unrecorded and simply checked again later.  Two REDACTION.md lines that
ran past the paragraph width are rewrapped.
…t cannot be (#308)

* Swap markers in writes back for their values, and refuse the ones that cannot be

An agent copies what it reads into writes: Env from container_inspect into container_create, a
marker into a psql command.  Without swapping back, the container starts with a literal marker as
its password and fails somewhere unrelated.  Before a tool that is not read-only runs, every marker
in its arguments is now resolved: on a redacted host that accepts writes, one this process issued
for that host becomes exactly the text it replaced, in its encoded form where that was replaced;
any other marker refuses the whole call before it runs, naming the argument and the reason.  On an
unfiltered host every marker is refused, since none was issued for it and a production marker must
not be swapped in there.  A read-only host is left to the host guard, whose message says why.

The guardrail refuses markers in names, labels, build arguments and bake overrides, where a
credential is never legitimate and would spread to listings, image metadata or a command line.  A
table classifies every text argument of every write tool, and a test fails for one left out, so a
new argument cannot take a marker without a decision.

Files are never swapped back: a marker in one means nothing to Docker or to a later process, and
rewriting a user's file or an archive member is not this server's place.  So the files a write
reads are searched first and the call refused on a match, naming the file: the Compose project
directory, a stack's or bake's directory and a build context (with .dockerignore honoured), which
are what the SSH fallback copies for the same calls, with the fallback's limits.  The cost was
measured at about 3 s for 8,900 files and 103 MiB with no marker, on the first read.  Archives for
container_archive_put are searched as bytes, naming the member; a compressed one is refused, with
one step per compression so a streaming search can be added later.

Marker tokens are now read only in the spelling issue writes.  22 base64 characters carry 4 spare
bits that the decoder ignores, so an altered last character could read back as the original
marker; a test found it while checking that an altered marker is refused.

host_list's notes now tell an agent on a writable redacted host that it can pass a marker to a
write and must never put one in a file; a read-only host keeps the note that markers are not
swapped back.

* Cap the file search on bytes read, guard nested network names, and refuse markers in login to a read-only host

The byte limit was charged from the size a file reports, so a procfs file (size 0, endless content)
or a log growing during the read was read without bound; a Compose call with no project_dir under a
systemd unit, whose working directory is /, would walk into /proc.  Bytes are now charged as they
are read, and the limits are held equal to the SSH fallback's staging limits by a test rather than
by a comment.

The nested guardrail keys were a hand-copied subset of the refused arguments and had already missed
`network` and `networks`, so a marker in extra_kwargs could be swapped into a network name.  They are
now derived from the refused arguments, with the Engine spec's capitalised forms, and a test holds
the relationship.

A read-only host was skipped for the host guard to refuse, but the guard exempts connection
control, so system_login to a read-only host sent a literal marker as the password.  Only writes the
guard refuses are skipped now; anything else on a read-only host has its markers refused, since such
a host never swaps one back.

Also: os.path.expanduser in place of pathlib's, which raises a bare RuntimeError for an unknown
~user; an absolute Dockerfile inside the context made relative before exclusion, as docker-py does,
so a .dockerignore'd Dockerfile is still searched; and the documentation now states the directories
searched as the ones the CLI resolves relative paths against, which differ from what the fallback
stages for Compose and stacks.

* Read a ~ Dockerfile as docker-py does, and test the nested keys that can drift

docker-py's process_dockerfile treats `~/Dockerfile` as relative to the context and never expands it,
and image_build does not either.  Expanding it named a different file whenever the home directory
held the context, so a .dockerignore'd Dockerfile docker-py reads went unsearched; the new test
fails without this change.

The test of the nested guardrail keys was true by construction, since they are derived from the
argument table.  It now pins the parts that can drift: the docker-py keys with no top-level argument
and the Engine spec's capitalised forms.  Also rewords and rewraps the search-limits sentence in
REDACTION.md.

* Refuse markers bound for the docker CLI's command line in the CLI-backed tools

A swapped-back value in a CLI-backed tool's argument lands on the docker CLI's command line, where
other users of the machine, or of the remote host under the SSH fallback, can read it in the process
list.  Bake overrides were refused for exactly that reason while compose_exec's and compose_run's
`command` were swapped back onto the same command line.  A secure route always exists, since `vars`
and `env` reach the CLI through its environment, so a credential is refused anywhere else.

In the Compose, stack and buildx tools a marker is now swapped back only in `vars`, and in an `env`
value whose name the CLI's environment can carry; everything else, `command` and `env` names that
_cli.values_by_name passes as `--env NAME=VALUE` (reserved or not a plain shell name) included, is
refused with a pointer to `env` and `vars`.  server.tool() marks the CLI-backed domains, and a test
calls the registered compose_exec to hold that wiring; it fails without it.

Checked against Docker Desktop through an MCP client: a marker in compose_exec's `env` reached the
container as the real value (by its md5 sum), and one in its command or under a DOCKER_ name was
refused.

* Swap markers back in container labels, and spell out the routes for an env name the CLI cannot carry

The guardrail exists to stop a credential leaking beyond the host, never to stop it reaching where a
container needs it.  Labels were refused everywhere, but some containers read a credential from
their own labels (a Traefik or caddy-docker-proxy basic-auth label), and a container's, service's,
network's or volume's labels stay on the host.  Only image metadata leaks: the labels image_build and
buildx_build give an image, annotations, container_commit's message and author and the labels in its
`conf`, which image_push publishes.  Those stay refused, as IMAGE_LABEL; every other label, including
inside extra_kwargs and updates, is swapped back.

An `env` name the docker CLI's environment cannot carry (reserved, such as GIT_*, or not a plain
shell name, such as app.password) goes on the command line, so a marker in it stays refused, but the
refusal now names the variable and gives two routes that set it inside the container from a plain
name: `env` VALUE with `sh -c 'exec env "NAME=$VALUE" <command>'`, and `vars` VALUE with
`NAME: ${VALUE}` in the compose file.  `exec env` is used rather than a shell assignment because a
dotted name is not a valid one.

Both routes were run against Docker Desktop through an MCP client for GIT_TOKEN and app.password:
compose_exec with the env route, and compose_run and compose_up with the vars route, each setting
the variable to the real value (checked by md5 sum).  A container label holding a marker was stored
as the real value, and an image label was refused.

* Rewrap the architecture note's swap.py and checklist passages, and name ENV_NAME there

Lines edited in this branch ran past the file's wrap width.  The swap.py summary now also names the
ENV_NAME refusal, which carries the routes that set such a variable inside the container.
…nd cut its false replacements (#309)

* Offer redaction in the install dialogs, warn and link wherever it is mentioned, and record what it misses

The .mcpb bundle and the Claude Code plugin gain `Redact credentials` and `Redacted variable names`,
passed as DOCKER_MCP_SERVER_REDACT and DOCKER_MCP_SERVER_REDACT_NAMES, and the host setting mentions
`(redact)`.  Their descriptions carry the warning that redaction reduces accidental exposure and is
not access control, with an absolute link to REDACTION.md, because the dialogs render outside the
repository.  Unset, they reach the server as "false" and "", which leave redaction off and raise no
warning; checked by starting the server with those values.

SECURITY.md, DOCKERHUB.md (absolute link), MCP_VS_SKILLS.md (as something only the server can do),
the switches comment in server.py and architecture/server.md now carry the same warning and link.
tests/test_docs.py holds every listed mention to the warning and the link, the two settings files to
the absolute URL, and fails on a new mention in a shipped document that is not listed.

REDACTION.md gains what the mode misses and what it replaces by mistake, measured by planting
credentials and decoys on Docker Desktop and on a Docker 26.1 daemon with Swarm and comparing a
redacted host's output with an unfiltered one on the same daemon.  It also says that markers change
on every read and that an agent cannot tell two credentials match, which can look like a
misconfiguration in triage.

* Leave public keys and absolute paths alone, which were most of the false replacements on real content

Planting decoys on Docker Desktop and comparing a redacted host's output with an unfiltered one on the
same daemon found nine false replacements on real content and one decoy, all public or not secret:
the signing-key fingerprints official images publish in GPG_KEY, certificate paths in SSL_CERT_FILE
and DOCKER_TLS_CERTDIR, and an SSH public key.  A value read under a credential name is replaced
wherever it appears, so a path was also lost from mounts and commands.

- Names whose values are public are left alone by default: *PUBLIC_KEY*, *PUBKEY*, *_PUB_KEY*,
  GPG_KEY and GPG_KEYS.  GPG is matched exactly, so GPG_KEY_PASSPHRASE is still harvested.  A name the
  names setting adds overrides these; its `!` entries still win over everything.
- A value under a credential name that is an absolute path (path characters only, from / or ~/) is
  not harvested: it says where a credential is, as SSL_CERT_FILE or POSTGRES_PASSWORD_FILE do.
- The generic shape rule skips the body of an OpenSSH public key and the inside of a PEM public key or
  certificate block.  The PEM rule still catches a private key, and a random run beside a public key
  is still found.

Re-measured on Docker Desktop after the change: no false replacements on real content, two of seven
decoys (SORT_KEY by name, a subresource-integrity hash by shape), and every planted credential caught
as before except the word-like secret in a file, which the design accepts.

* Match known IDs by prefix index, and state what redaction costs, measured on a large daemon

On a throwaway daemon of 2,000 containers and 501 images, the check of which IDs a result names took
120 ms for a full container list: each mentioned ID was compared with every known one by prefix.  The
known IDs are now indexed by their first 12 characters, the shortest Docker abbreviates to, which
brings the check to under a millisecond.

REDACTION.md gains what the mode costs, measured on that daemon and on Docker Desktop with the same
script, redacted against unfiltered on the same daemon (medians of 15 calls):
- first call to a host: about 2 s on Desktop, 12.5 s on the large daemon;
- every call: about 40 ms and 140 ms, for the snapshot that keeps the harvest fresh, which lists every
  container and image;
- redacting a result: about 1.3 ms per KB of output, so container_list of 2,000 containers (1.4 MB)
  takes about 1.7 s more than unfiltered.
The redaction walk is the largest cost on big results; the snapshot is the cost on every call.

* Treat a path after a credential flag as a path, commit the measurement script, and order the settings

- The absolute-path rule now covers the flag rule too, in text and in exec-form lists: a value after
  `--password-file`, `--tlscert` or `--tlskey` that is an absolute path is where a credential is, and
  taken as one it was stored and replaced in every mount and command on the host.  `rules.is_absolute_path`
  is the one test, used by the harvest and the flag rule alike.
- The public-key exclusions are anchored at the end (`*PUBLIC_KEY`, `*PUBKEY`, `*_PUB_KEY`), so a
  credential word after the public-key one (`SIGNING_PUB_KEY_PASSWORD`) is still harvested.
- scripts/measure-redaction.py regenerates the figures REDACTION.md quotes: `sweep` plants credentials
  and decoys and compares a redacted host with an unfiltered one on the same daemon; `cost` times calls
  on a daemon filled with containers and images.  Both use a throwaway dind daemon unless given
  --docker-host, report only, and never print a replaced value.  REDACTION.md's two measured sections
  now say how the cost grows and what is missed as rules, point to the script for the figures, and say
  the figures move with the code; the history of earlier measurements is in the commit messages.
- The unwarned-mention scan covers every markdown file under claude-plugin/ and skills/, which ship.
- The prefix-index test uses random IDs and asserts one ID per bucket, so it fails if the index
  degrades to a scan; the measured figure is out of the code comment.
- The redaction settings come after the three settings that decide which tools register, in the
  bundle, the plugin and its README.

* Check an SSH host's key by its name, not by the address the connection fell back to

A docker-py client for an ssh:// host whose first address did not answer had the answering address
spliced into its URL, to get past paramiko's narrow address fallback (it moves on only after a
refusal, so a black-holed IPv6 route failed a host reachable over IPv4).  paramiko then checked the
host key against `[address]:port` in known_hosts rather than the hostname.  A host listed only by name
was refused, and one whose address carried a stale entry from an earlier machine was refused with
"Host key ... does not match", while `ssh`, which checks by name, connected.  That was seen on a host
whose IPv6 route times out.

The client now uses a subclass of docker-py's SSHHTTPAdapter whose `_connect` opens the socket itself
through every resolved address and hands it to paramiko with the original hostname, as
connect_ssh_client already does for the CLI-backed tools.  docker-py builds the adapter inside APIClient
and connects in its constructor, so the adapter name in docker.api.client is swapped only while
_build_client runs, under a lock; the client keeps the subclass, so its reconnects use it too.  A
ProxyCommand from ~/.ssh/config is left alone.  The splice and its function are gone.

Checked against the host that failed: system_info now connects, as `ssh` does.

* Say plainly that random values with no credential name are missed by chance, as a remote run showed

The sweep against a Docker 29 daemon over SSH missed, in some runs, a random credential under an
innocuous name and a random value printed at container start, which the local runs had always caught.
The script now reports a missed value's length and bits per character (never the value), and the miss
it caught was a 39-character value at 4.48 bits per character, just under the generic rule's 4.5: the
threshold working as designed, not a remote-specific fault.  A local simulation of the same rule
catches 97.7% of 40-character random alphanumerics.  Four further runs over SSH missed nothing else
of note.

REDACTION.md listed those values as caught.  They now sit under what is missed, sometimes, with the
Swarm secret: only the shape rules can catch a random value with no credential name or known format
beside it, and a random value falls under their threshold by chance.  The sweep's results also name
the daemon reached over SSH.

* State REDACTION.md's limits as rules, and guard the SSH adapter against a docker-py upgrade

REDACTION.md's "What it misses" still described particular runs: which engines were measured, that a
value was missed at least once, and which decoys were left alone.  Those now read as behaviour: the
odds of missing a random value with no credential name are tied to the shape rules' threshold constant,
and what is left alone is said with the reason.  The runs themselves are in the commit messages and
come back from scripts/measure-redaction.py.

_FamilyFallbackSSHAdapter overrides docker-py's private `_connect` and reads `ssh_params`, which the
adapter's constructor sets and then connects through.  A new test builds the adapter for real, with
only the network and the user's SSH files kept out, so a docker-py release that renames either or stops
connecting in the constructor fails it rather than silently bypassing the fallback.

* List the SSH adapter reach-in as approved, and note the window its swap opens

architecture/docker-sdk.md lists reach-ins past the public SDK that have a recorded decision, so a later
audit does not re-propose or undo them.  _FamilyFallbackSSHAdapter is now listed there, with why the
public paths fail, the public alternative rejected (use_ssh_client=True, which moves every SSH host onto
the local ssh binary), the guard test, and when to remove it.

architecture/hosts.md now says the swap is serialised only among callers of _build_client, so a docker-py
client built elsewhere in the process meanwhile would get the subclass too; nothing else in the server
builds one.
…comparison figures once (#310)

* Record four deliberate SDK choices the weekly audit keeps re-raising

The docker-py audit re-derives its candidates from a grep each week and has no memory, so a
deliberate choice missing from the exclusions list is proposed again every run.  Two runs raised
these:
- every `api.tasks()` call, not only service_ps's: stack_ps and _wait_stack make three more, for the
  same reason (docker-py has no task collection at all);
- image_list's `api.images()`: the compact default is the daemon's list as it sends it, where the
  high-level call inspects every image;
- APIClient.reload_config: it reaches no daemon and would wipe what system_login cached;
- PUT /volumes/{name}: no docker-py surface; declined as the config and secret updates are.
Checked against the installed docker-py 7.2.0: no update_volume or Volume.update, reload_config
exists, and DockerClient has no tasks.

* Say what image_push returns, and when to prefer compose_exec over container_exec

image_push's Returns said only "a string".  It is the daemon's newline-delimited JSON progress
records, and a push the registry refuses still returns, with `errorDetail` in its last record:
docker-py 7.2.0's push raises only for an HTTP error status (checked in its source), and a refused
push arrives with 200.  An agent reading "a string" had no reason to look for the failure.

compose_exec named container_exec without saying when to prefer which; container_exec already said
the reverse.  It now says: a service in a Compose project, by name and index, here; a container
known by name or ID, or outside a project, there.

* Print the summary ratio ranges from the comparison script, so they are copied rather than worked out

The "So the honest summary is" bullets in MCP_VS_SKILLS.md were the only figures worked out by hand
from the per-task table, and they went stale twice, while architecture/agent-skill.md said the script
emitted every figure the document quotes.  The script now computes them (lowest and highest across the
chosen tasks: the server's eager floor over the skill's cost, the skill's cost over the server's lazy
cost, and both eager floors over what the skill costs to advertise), rounds them to two significant
figures and prints them in the form the bullets use; --json carries them under summary_ratios.  Run on
the code before this branch's changes it reproduced every range the document quoted.

* Refresh MCP_VS_SKILLS.md from the comparison script

Regenerated after this feature's changes to the tool surface (the `vars` arguments, the redaction
notes) and the two docstring fixes, so the figures move once.  Every figure is copied from
scripts/measure-comparison-figures.py: the five configurations, the idle table, the per-task table,
the parameter count (589), the definition sizes and now the summary ranges.  Some had drifted before
this branch too: the router and the resources row.  No conclusion changes.

* Read one service's tasks through Service.tasks, and print every derived figure the comparison quotes

_wait_stack read one service's running tasks with `client.api.tasks(filters={"service": ...})`, while
it held the Service.  `Service.tasks(filters=...)` is docker-py's public path for that, sending the
same request with the service filter added (checked in docker-py 7.2.0's source), as service_ps
already uses it.  The exclusion added for `api.tasks()` had wrongly covered this call; it now covers
only calls not scoped to one service, so the audit can still raise a scoped one.  The redaction
harvest's ID lists, which stay low-level to avoid an inspect per object, are recorded there too.  The
reload_config entry now rests on redundancy: system_reconnect and system_close drop a login as it would.

The comparison script now also prints the figures the prose works out from the configuration table
(the eager and lazy spreads, the triage cut, the lazy drop, the share of a 128k window), so
agent-skill.md's "every figure" is true; the idle range says it spans configurations, not tasks.
MCP_VS_SKILLS.md names the command that regenerates its figures, and is refreshed for image_push's
description, whose refused-push note moved into the usage paragraph (7 tokens; no rounded figure
moves).
…yday requests (#311)

* Sweep every way redaction can be switched on, and score a real agent's everyday requests

The sweep compared a redacted label with an unfiltered one in one server, so it could only measure a
per-host `redact` on a writable host: one server cannot be both globally redacted and unfiltered, nor
read-only and writable.  It now runs two server processes, a redacted one configured as asked and an
unfiltered writable reference, and `--configuration` covers per-host and global redaction, each
writable and read-only.  Each run also checks what the agent is told and offered there: the
instructions pointer, the host_list notes (swap-back on a writable host, not on a read-only one),
container_archive_get withdrawn under global redaction and container_exec under READONLY.  Error text
is searched for planted values too.

Run against a throwaway Docker 28 daemon with Swarm, all four configurations had the agent-facing
surface right; the misses were the word-like secret in a file (not reachable read-only, where exec is
refused or withdrawn) and the Swarm secret, a random 32-character value at 4.30 bits per character,
under the shape rules' 4.5; no false replacements on real content; two of seven decoys replaced.

`agents` gives a headless Claude Code, with only this server's tools and a dollar cap, eight everyday
requests on a small planted app, read-only and writable, and scores whether each was done (or declined,
for a write under READONLY), any planted value anywhere in the transcript, the errors it met, and
whether it blamed a correct password in triage.  Run with Sonnet: all sixteen came out as expected,
nothing leaked, the triage found the wrong host rather than blaming the password in both modes, every
read-only write was declined without a workaround, and every writable write carried the credential
through a marker; $1.29 in all.

* Report a value only a refused call showed as not reached, and score psql on tool output alone

- Under a read-only configuration the reference server, always writable, reached the files in an image
  through container_exec, which the redacted server refuses or does not offer.  The PEM key and both
  file secrets were then reported as caught although redaction never saw them.  A value that surfaced
  only through calls the redacted server refused is now NOT REACHED; re-run on (ro,redact), all three
  show that way.
- The psql judgement searched the whole transcript, so the agent's own SELECT, or a mention in its
  answer, could pass it.  It now searches only error-free tool results.  Re-scored from the saved
  transcripts, the writable run still listed the roles and the read-only one did not.
- A hung run is recorded as timed out, with its partial transcript, instead of raising and losing the
  runs already paid for; each run is reported as it finishes, and the transcript directory up front.
- The docstring describes the two-process sweep and the agents mode; --only rejects an unknown
  scenario; the section headers are in place.  architecture/redaction.md no longer copies the
  configuration list or the number of requests, which the script holds, and says which modes to run
  after a change.
Comment thread docker_mcp/redaction/markers.py Dismissed
Comment thread docker_mcp/redaction/markers.py Dismissed
Comment thread scripts/measure-redaction.py Dismissed
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Claude review: changes requested

Summary

This range adds credential redaction (docker_mcp/redaction/), moves CLI credentials into the CLI's environment (vars, and env/build_args passed by name, sent over SSH on stdin), adds the comma-separated host option grammar, and replaces the SSH family-fallback URL splice with an adapter subclass. Overall it is careful work: it fails closed, a test holds every table to the registered tools, and the docs mostly agree with the code. Three findings should be fixed before merge: a parsing bug that leaks most of a build argument containing spaces, a file search on Compose writes that is far too broad, and a measurement script that can leave a privileged container running.

Findings

1. Bug: a build argument with a space is cut to its first word, so most of it is left in clear

docker_mcp/redaction/harvest.py:79: history_build_args does match.group(2).split() and keeps tokens[:count]. BuildKit and the classic builder both write CreatedBy as RUN |N KEY=value ... joined with single spaces and no quoting. So --build-arg PASSPHRASE="correct horse battery staple" is recorded as |1 PASSPHRASE=correct horse battery staple /bin/sh -c ....

  • The harvest stores only correct (7 characters, so it is replaced only where it stands alone).
  • image_history on a redacted host then returns PASSPHRASE=[REDACTED:...] horse battery staple, which is three-quarters of the credential.
  • Every word correct that stands alone on that host is also replaced from then on.

The assignment rule does not help either: _ASSIGNMENT also stops at whitespace. A tighter parse would take each value up to the next NAME= token, and the last one up to the shell or command prefix. Failing that, list it under "Missed" in REDACTION.md. The sweep's planted build argument has no space in it, which is why the "Caught" list includes build arguments.

2. Bug (guard too broad): every Compose write walks the whole working directory, up to 50,000 files or 200 MB per call

In docker_mcp/redaction/disk.py:195-196, inputs_for sends every compose_* write to _compose_inputs. That function falls back to os.getcwd() when project_dir and files are not given, and _file_entries then walks it all (os.walk). The affected tools include compose_down, compose_stop, compose_kill, compose_pause, compose_restart, compose_start, compose_pull and compose_exec. None of them copies a file into a container or an image, so the stated reason ("since any file in it can end up in a container or an image", disk.py:9-11, REDACTION.md:229-230) does not apply to them.

Failure scenario: a host marked (redact) that accepts writes, and a server whose working directory is a repository with node_modules or .git packs, or /. Then compose_down(project_name="app") reads up to 200 MB before every call, or is refused with "past the limit of the search ... Point the call at a smaller directory", even though the call reads nothing but a compose file. This is the over-broad guard SU.7.2 warns against. One fix is to search the whole tree only for the tools that send files (compose_up, compose_build, compose_run, compose_create if added, and compose_cp's source), and only the compose files and .env for the rest. The search mirrors SSH staging by design, but locally nothing is staged, so the coupling only costs here.

3. Bug (dev tooling): measure-redaction.py leaves a privileged dind container running when startup fails

In scripts/measure-redaction.py:140-178, Daemon.__enter__ starts docker run -d --privileged ... and then can raise SystemExit in three places: the 60-second wait loop, self.docker("pull", "-q", "alpine:3"), and swarm init. When __enter__ raises, Python never calls __exit__, so the docker rm -f at line 183 never runs. Port 23760 is also left bound, so the next run fails too. The module docstring promises "measures against it and removes it, so nothing is left", and RP.5.2/RP.5.3 require cleanup that runs on a failure partway through. Wrap the steps after docker run in try/except BaseException: rm -f; raise.

4. Maintainability (efficiency, and docs understate it): any daemon change re-reads every container and image

HostHarvest._refresh (harvest.py:143-159) calls _harvest. That runs a non-sparse containers.list(all=True), which inspects every container, and an images.get for every image, every time the ID snapshot differs. Only histories are cached.

So each container_run or container_create on a large redacted host costs a full harvest in its own harvest_if_unseen: about 12.5 s at 2,000 containers by the PR's own figure. REDACTION.md:273-279 says only that "the first call ... takes longest" and that every call adds a cheap listing. Container environments cannot change under the same ID, so the snapshot difference already names exactly what to read. Either harvest just the new container, image and service-version IDs, or state the per-change cost in REDACTION.md.

5. Maintainability: the *PASS comment claims a word boundary the glob does not have

docker_mcp/redaction/settings.py:23-25 says "PASS is matched only as a whole trailing or inner word, because *PASS* would harvest PASSTHROUGH and BYPASS_*". But fnmatchcase("CACHE_BYPASS", "*PASS") is true, and so is COMPASS. CACHE_BYPASS=1 therefore harvests 1, and every 1 that stands alone in that host's output becomes a marker. tests/test_redaction_settings.py:83 checks only BYPASS_CACHE and COMPASS_URL, which *PASS does not reach anyway. Either correct the comment (and REDACTION.md:36), or use PASS plus *_PASS and add CACHE_BYPASS to the leave-alone cases.

6. Maintainability (a test that tests something else): test_updates_labels_are_swapped_back never passes updates

tests/test_redaction_swap.py:301-304 calls the fake tool with extra_kwargs={"Labels": ...}, and that fake has no updates parameter. No test in the file passes updates. So deleting "updates": _NESTED_KEYS from _NESTED_KEYS_BY_ARGUMENT (swap.py:217) would let service_update(updates={"Name": <marker>}) or node_update(updates={"Name": ...}) swap a credential into a name, and nothing would fail. Give the fake an updates argument, and assert both that a label is swapped back and that Name is refused there.

7. Maintainability (docs): a rule's find is remembered raw and replaced everywhere afterwards, not just "its encoded forms"

redactor.py:242 stores every shape-rule span as a discovered value, and the matcher then replaces its raw form wherever it stands alone, on that host, for the life of the process. The flag rule takes the value after a credential-named flag "whatever it looks like" (rules.py:185-200). So a container running app --token-ttl 3600 (TOKEN_TTL matches *TOKEN*) makes every string 3600 on that host a marker from then on.

REDACTION.md:124 says only "so its encoded forms are matched from then on", and the "Replaced by mistake" list (REDACTION.md:162-167) leaves out this case. Say it there, with !TOKEN_TTL-style exclusions as the remedy.

8. Maintainability, and an open question for the owner: the SDK reach-in records its own approval

architecture/docker-sdk.md:47-48 calls _FamilyFallbackSSHAdapter "a blessed reach-in, approved by the owner when it was introduced". It subclasses a private _connect, reads ssh_params, and rebinds docker.api.client.SSHHTTPAdapter. AGENTS.md says "Reaching past the public SDK is not an agent's call to make". Under CR.1.4, a departure the author records is documented, not authorised. Owner: please confirm the sign-off exists on the tracker or this PR.

Either way, "approved ... when it was introduced" is a record of what was done. It belongs in the PR or commit message; the note should state the decision and its reason. I checked the subclass against docker-py from memory, not against the installed package; the PR's test_docker_py_still_builds_and_connects_its_ssh_adapter_the_way_the_subclass_relies_on is the guard.

9. Maintainability: recorded state in prose

Each item below records something the system or a test can already answer:

  • REDACTION.md:136-148 (the "Caught" list) and REDACTION.md:282-292 (the cost table, "As it last reported, on a Mac") are measurement results. The source is uv run scripts/measure-redaction.py sweep|cost. Unlike MCP_VS_SKILLS.md, nothing watches these for drift. The table also disagrees with itself: the text says 500 images and the column header says 501.
  • architecture/hosts.md:27 says "Nothing else in the server builds one." That is answerable by grep for DockerClient(/from_env(, and could be a test asserting that _build_client is the only builder, which is what keeps the adapter swap safe.
  • architecture/cli-shell-out.md:49,56 list which tools and shells the tests cover. The test files themselves are the source; a pointer to them is enough.
  • scripts/measure-redaction.py:35-36 says "with seven decoys", which is len(DECOYS).
  • tests/test_surface_budget.py:44-53 has comments carrying measured sizes ("buildx_build, 4,780", "229,161"). This is the file's existing convention, but those figures belong in the commit message that raises a ceiling, as AGENTS.md says.

10. Preference: the refusal for a marker in context_create points to routes that tool does not have

In swap.py:333-334, every swap-kind argument of a CLI-domain tool becomes COMMAND_LINE, and _resolve (swap.py:383-387) reports the guardrail reason before it checks label is None. So a marker in context_create(description=...) is refused with "Pass the value ... in env on compose_run and compose_exec ... or in vars", none of which applies to a context tool. REDACTION.md:183-185 instead files context_* markers under "issued for another host". Check label is None first for the NO_DAEMON scope.

What I checked

  • Every file in the range, at least at diff level:
    • I read all the docker_mcp/ changes in full: the redaction package, server.py, _hosts.py, _cli.py, _ssh_proxy.py, system.py, compose.py, buildx.py, stack.py, resources.py and images.py.
    • I read REDACTION.md, architecture/redaction.md, the other architecture, README, SECURITY, DOCKERHUB, plugin and manifest diffs, and both scripts.
    • Tests:
      • In full: test_redaction_wire.py and the integration tests.
      • Most of: test_redaction_swap.py and test_redaction_disk.py, and the diffs of test_cli.py, test_remote_exec.py, test_system.py, test_stack.py, test_hosts.py, test_buildx.py, test_compose.py, test_docs.py, test_pyproject_pins.py and test_surface_budget.py.
      • The fake client in test_redaction_harvest.py, and the test inventories (names and selected bodies) of the rules, store, redactor, markers, forms, matcher and settings suites.
  • I checked these against the code and found them sound:
    • The wire ordering (swap, then the budget, byte refusal, file search, harvest, call, redact).
    • That only ToolError text is redacted, with other failures withheld by the SDK.
    • That image_build refuses a Dockerfile outside its context, so the context search is complete there.
    • The marker codec's canonical-spelling check.
    • The store's concurrent-add and rollback paths.
    • The printf %b stdin protocol, and that caller names cannot reach the wrapper's own variables.
    • That reserved names never enter extra_env.
    • The NO_DAEMON and byte-tool lists against REDACTION.md.
    • The version bump across pyproject.toml, server.json, manifest.json, the plugin and uv.lock.

What I did not check

  • I ran nothing. Python and uv could not be executed here, so no test, pyright or ruff results are behind this review.
  • docker-py is not installed in this checkout, so the SSHHTTPAdapter internals and the harvest's SDK calls were checked from memory of docker-py 7.x, not against the installed package.
  • I did not confirm against the real CLIs that --env NAME and --build-arg NAME read the CLI's environment; the PR's integration tests claim to.
  • I did not confirm the CreatedBy format in finding 1 against a live daemon (it is from memory of moby and BuildKit), nor the working directory a particular MCP client starts servers in (finding 2).
  • I did not judge whether JSON- or YAML-escaped credentials in raw CLI text output are caught. REDACTION.md already lists "encoded some way not listed above" as missed.

full review of 3368e3efd6f0..dcfcaf51776b. Run.

… when the daemon changes

A build argument's value can hold spaces, and an image's history records it unquoted:
`RUN |2 PASSPHRASE=correct horse battery staple OTHER=a=b c /bin/sh -c ...`, checked against a real
BuildKit build.  The parser split on whitespace, so it stored `correct` and left three quarters of the
passphrase in image_history.  It now reads an image's whole history: every value but the last ends where
the next `NAME=` begins, and the last, which runs into the command, comes from the image's own `ARG`
entry (`ARG PASSPHRASE=correct horse battery staple`), ending where another argument begins.  Checked on
Docker Desktop: no word of a spaced value is left in a redacted image_history.

A changed snapshot used to re-read every container and image, about 12.5 s on a daemon of 2,000
containers, so every container_run there paid it.  An environment cannot change under the same ID and
a service's entry carries its version, so the snapshot difference already says what to read; only those
objects are read now.  On a throwaway daemon of 2,000 containers, a new container then cost 0.12 s.
Every Compose write searched the whole project directory, or the server's working directory when none
was given, for up to 50,000 files or 200 MB a call; compose_down could be refused for a large unrelated
directory although it reads only the compose file.  compose_up, compose_build and compose_run, which can
put any file in the project into a container or image, still search it whole; the other Compose writes
search only the compose files and `.env` they read, and compose_cp its local source.
…y 1 a marker

`*PASS` matched CACHE_BYPASS and COMPASS, despite the comment saying PASS was matched only as a whole
word; a harvested `1` from CACHE_BYPASS=1 would then be replaced wherever it stood alone.  The patterns
are now `PASS`, `*_PASS` and `*_PASS_*`, and the leave-alone cases include CACHE_BYPASS and COMPASS.
…ccurate docs, safer script startup

- A marker in a tool that reaches no daemon is refused for having no host before any guardrail reason,
  so context_create's refusal no longer points to `env` and `vars`, which it does not have.
- The `updates` test now passes `updates`, asserting a label is swapped back and a name refused there;
  it fails if `updates` is dropped from the nested table.
- A test holds that only the client builders construct a docker-py client, which is what keeps the SSH
  adapter swap safe, in place of a sentence saying so.
- A test holds that a flag-name exclusion reaches the flag rule, which REDACTION.md now gives as the
  remedy for a remembered non-credential such as `--token-ttl 3600`; REDACTION.md also says a rule's
  find is replaced wherever it appears afterwards, not just in its encoded forms.
- measure-redaction.py removes its throwaway daemon when startup fails partway, and names `DECOYS`
  rather than counting them.
- docker-sdk.md states the reach-in decision with a pointer to where it is recorded; cli-shell-out.md
  says how a remote shell such as FreeBSD's is checked; REDACTION.md's cost table agrees on the image
  count.
@GavinLucas

Copy link
Copy Markdown
Collaborator Author

Addressed in 44086fa, 41b9a55, e8013e2 and 101a890. Each finding was checked against the code and, where possible, a real daemon first.

  1. Fixed (44086fa). The parser now reads each image's whole history.
    • I checked the CreatedBy format against a real BuildKit build: RUN |N values are unquoted and joined by spaces, and each argument also gets its own ARG NAME=value entry.
    • Every value except the last ends at the next NAME=. The last value is read from its ARG entry, ending where another known argument begins.
    • On Docker Desktop, no word of a spaced build argument is left in a redacted image_history.
  2. Fixed (41b9a55). Only compose_up, compose_build and compose_run, which can put any project file into a container or image, search the whole project. The other Compose writes search the compose files and .env, and compose_cp its source.
  3. Fixed (101a890). __enter__ removes a daemon it started when anything after docker run fails.
  4. Fixed in code (44086fa), not just documented. A changed snapshot now reads only the new entries: containers, images, configs, and services whose version changed. On a throwaway daemon of 2,000 containers, a new container cost 0.12 s instead of a full re-read.
  5. Fixed (e8013e2). The patterns are now PASS, *_PASS and *_PASS_*. CACHE_BYPASS and COMPASS are in the leave-alone cases.
  6. Fixed (101a890). The fake now takes updates. The test asserts that a label is swapped back and that Name is refused. Removing updates from the nested table makes it fail.
  7. Fixed in the docs (101a890). REDACTION.md says a rule's find is replaced wherever it appears afterwards, and lists the --token-ttl 3600 case with !TOKEN_TTL as the remedy. A new test checks that exclusion reaches the flag rule. I tried leaving numbers alone after credential flags and reverted it, because --password 123456 would then be missed.
  8. The decision is on Measure redaction on real daemons, offer it in the install dialogs, and cut its false replacements #309 (the owner's comment approving option (a)). The docker-sdk.md entry now states the decision and points there, rather than describing itself as approved.
  9. Partly fixed, partly declined.
    • Declined: the measured "Caught" list and the cost table stay. The story's acceptance requires them in REDACTION.md. Each is marked as moving with the code and names the command that regenerates it.
    • Fixed:
      • the 500/501 mismatch;
      • hosts.md's claim is now held by test_only_the_client_builders_construct_a_docker_py_client;
      • cli-shell-out.md's out-of-date FreeBSD sentence now points to the SSH-host integration tests;
      • the script names DECOYS instead of counting them.
    • Left as is: the measured sizes in test_surface_budget.py's comments follow that file's existing convention, outside this change.
  10. Fixed (101a890). A tool that reaches no daemon now refuses for that reason before any guardrail reason, with a test.

Unit: 2,213 passed. ruff, pyright and pydoclint are clean.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Claude review: changes requested

Resolved

  • 1 (build argument with spaces cut to its first word): history_build_args now takes each value up to the next NAME=. The last value comes from an ARG entry. See New 1: the ARG fallback may undo part of this fix.
  • 2 (every Compose write walks the working directory): only compose_up, compose_build and compose_run search the tree (disk.py _COMPOSE_CREATING). The other writes read only the compose files and .env. A test covers it, and REDACTION.md is updated.
  • 3 (measurement script leaves a privileged container running): Daemon.__enter__ now wraps _prepare and calls __exit__ on any failure.
  • 4 (every daemon change re-reads everything): _refresh now reads only snapshot - self._harvested. REDACTION.md and architecture/redaction.md say so, and the tests assert client.reads.
  • 5 (*PASS comment): the patterns are now PASS and *_PASS, and CACHE_BYPASS and COMPASS are in the leave-alone test.
  • 6 (updates test): the fake takes updates. The test asserts both that a label is swapped back and that a Name is refused.
  • 7 (remembered flag values): REDACTION.md now states it, gives !TOKEN_TTL as the remedy, and a test holds that the exclusion reaches the flag rule.
  • 9, in part: architecture/hosts.md now points to test_only_the_client_builders_construct_a_docker_py_client. scripts/measure-redaction.py no longer says "seven decoys". The cli-shell-out.md list of which shells the tests cover is trimmed.
  • 10 (refusal for a marker in context_create): _resolve checks label is None first. See New 3 for a side effect.

Still open

  • 9 (maintainability): REDACTION.md still carries measured results ("As it last reported, on a Mac", the cost table and the "Caught" list). The "500 images / 501" mismatch is now explained in the text, but the figures are still recorded state. The source is scripts/measure-redaction.py sweep|cost.
  • 9 (maintainability): tests/test_surface_budget.py:44-53 still has measured sizes in comments. They belong in the commit message.
  • 8 (maintainability): architecture/docker-sdk.md still carries a record of what was done: "the owner's decision is recorded on PR Measure redaction on real daemons, offer it in the install dialogs, and cut its false replacements #309". I could not check that record. The note should state the decision and its reason, and leave the pointer to the PR.

Declined

None.

New

  1. Bug (plausible; checked from memory, not against a live daemon): the ARG entry holds the Dockerfile's declaration, not the --build-arg value. In harvest.py, _arg_entry_value and history_build_args take the last build argument from an ARG history entry and use the first word from the RUN entry only as a fallback.
    • As I remember BuildKit, a history ARG line records the Dockerfile text: ARG PASSPHRASE or ARG PASSPHRASE=<default>. It does not record the value passed with --build-arg.
    • Failure scenario: ARG TOKEN=changeme in the Dockerfile, built with --build-arg TOKEN="real secret words". The RUN |1 TOKEN=real secret words ... entry gives real as the first word. The ARG entry gives changeme, which is non-empty, so or first_word never applies. The harvest then stores changeme and drops real. Before this commit the first word was kept, so this is a regression.
    • The test comment says "as a real BuildKit build records ... each also in its own ARG entry". That is a prose claim nothing checks, and AGENTS.md priority 1 covers it. The fixtures were written to match the parser.
    • Fix: harvest both, or use the ARG value only when it starts with the first word from the RUN entry. Verify the format against a real docker history --no-trunc before relying on it.
  2. Bug: a failed Swarm read is now permanent. In harvest.py, _harvest_swarm_object logs and swallows any APIError that is not NotFound, and _refresh then sets _harvested = snapshot.
    • The swallow exists for "not a Swarm manager". With one read per object, a transient 500 or timeout on one service or config now means that object is never read again, because its snapshot entry is already marked done. Its credential then goes unredacted for the life of the process.
    • Before this commit the next change re-read everything, so the failure was retried. Fix: swallow only the "not a manager" refusal, for example a 503 or "not a swarm manager". Let other errors propagate so _harvested is not advanced. Or leave a failed entry out of _harvested.
  3. Preference: label is None also covers an unknown host label. _label_for returns None for an unknown label as well as for NO_DAEMON tools. A marker in a guardrail argument on, for example, compose_run(host="typo", env=...) is now refused as "by a tool that reaches no daemon". Before this commit it got the more useful guardrail reason. Check scope is Scope.NO_DAEMON rather than label is None.
  4. Preference: PASS is now whole-word only. DBPASS, SMTPPASS and ADMINPASS are no longer harvested (*PASS used to match them), and PASS_FILE is not matched either. That is a deliberate trade, but REDACTION.md's "Missed" list does not say so, and users should know to add the name to DOCKER_MCP_SERVER_REDACT_NAMES.
  5. Preference: _compose_inputs default file list. The default-file list omits compose.override.yaml and docker-compose.override.yml, which Compose reads automatically. A marker in an override file is not searched for the non-creating writes. That is harmless for tools that create nothing, but it makes "only the compose files and .env they read" slightly untrue.

What I checked

  • The full delta diff of disk.py, harvest.py, settings.py, swap.py and measure-redaction.py.
  • The doc diffs in REDACTION.md and architecture/.
  • The delta diffs of the tests: test_redaction_disk.py, test_redaction_harvest.py, test_redaction_rules.py, test_redaction_settings.py, test_redaction_swap.py and test_system.py.
  • I read _take_snapshot and the wire.py label handling around the changes.
  • The history_build_args parse of the new test fixture: the empty B= value, and the a=b value that is not misread as a name.

What I did not check


delta review of dcfcaf51776b..101a8909a08c. Run.

…nd read override files

- A service or config read that failed with anything but NotFound was logged and swallowed, and the
  snapshot then marked read, so a transient daemon error left that object unharvested for the life of
  the process.  It now propagates like a container's, so the call is refused and the next one reads it
  again.  A node that is not a Swarm manager lists no services or configs in the snapshot, so there is no
  refusal left to tolerate there.
- The last build argument is taken from the image's ARG entry only where that entry begins with the
  same first word as the RUN entry.  BuildKit records the value passed in both, checked against a real
  build with and without --build-arg; a builder recording the Dockerfile's declaration instead falls
  back to the first word rather than storing a default.
- The non-creating Compose writes also search the override files Compose reads by default
  (compose.override.yaml and the rest).
- REDACTION.md lists names `PASS` no longer reaches, such as DBPASS, under what is missed, with the
  names setting as the remedy.
@GavinLucas

Copy link
Copy Markdown
Collaborator Author

Addressed in 3f8221c. Each point was checked against the code, and New 1 against a real daemon.

New 1: checked, and BuildKit records the value passed; guarded anyway. On Docker Desktop, with ARG TOKEN=changeme in the Dockerfile:

Build RUN entry ARG entry
with --build-arg 'TOKEN=real secret words' RUN |1 TOKEN=real secret words /bin/sh -c ... ARG TOKEN=real secret words
without --build-arg RUN |1 TOKEN=changeme ... ARG TOKEN=changeme

So the ARG entry carries the value passed. Even so, it is now trusted only where it begins with the same first word as the RUN entry. A builder that recorded the declaration falls back to the first word rather than storing a default. A test covers it, and it fails on the previous code.

New 2: fixed. A Swarm read that fails with anything but NotFound now propagates, as a container read does. The snapshot is not marked read, so the call is refused and the next call reads the object again. A node that is not a manager has no services or configs in its snapshot, so there is no refusal left to tolerate there. A test covers it, and it fails on the previous code.

New 3: no change, because an unknown host never reaches the swapper. wire._swap returns before calling swap_markers when label is None and the scope is not NO_DAEMON, leaving the refusal to the host guard (wire.py, just after the NO_DAEMON branch). So _Swapper sees label is None only for a NO_DAEMON tool, and checking the scope there would test the same thing.

New 4: fixed. REDACTION.md's "Missed" list now says PASS matches only as a whole word, so DBPASS and SMTPPASS are not credential names, and to add such names to DOCKER_MCP_SERVER_REDACT_NAMES.

New 5: fixed. The default list now includes the override files Compose reads.

Still open 9 and 8: declined, for the reasons already given.

  • The measured results stay in REDACTION.md because the story's acceptance requires them there. They are marked as moving and name the command that regenerates them.
  • The measured sizes in test_surface_budget.py's comments follow that file's existing convention, outside this change.
  • docker-sdk.md states the decision and its reasons: why the public paths fail, the public alternative rejected, the guard test, and when to remove it. It points to Measure redaction on real daemons, offer it in the install dialogs, and cut its false replacements #309 for the owner's sign-off, which is the comment there approving option (a).

Unit: 2,215 passed. ruff and pyright are clean.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Claude review: approve

Resolved

  • New 1 (ARG entry trusted over the RUN entry): history_build_args now uses the ARG value only when its first word equals the RUN entry's first word, and otherwise falls back to that word (harvest.py ~l.104-108). A test covers it (test_an_arg_entry_that_disagrees_with_the_run_entry_falls_back_to_the_first_word).
  • New 2 (a failed Swarm read became permanent): _harvest_swarm_object no longer swallows APIError, so only NotFound is skipped, in _harvest. A failed object is not marked read, so the next call retries it. The "not a manager" refusal is still tolerated in _take_snapshot, so a non-manager has no service or config entries to read. The new test reads the object again after a failure.
  • New 3: the earlier review's concern doesn't hold. An unknown host is refused before the swapper, as the author says. I did not re-read wire.py in this round, so I'm relying on the author's account and my reading in the previous round.
  • New 4: REDACTION.md now states that PASS matches only as a whole word and names DOCKER_MCP_SERVER_REDACT_NAMES as the remedy.
  • New 5: _COMPOSE_DEFAULT_FILES now includes the four override files.

Still open

Declined

  • 9 and 8, declined by @GavinLucas. The measured results in REDACTION.md are required by the story's acceptance. The test_surface_budget.py sizes follow that file's existing convention. docker-sdk.md already states the decision and its reasons. These are not raised again.

New

  1. Maintainability: a code comment records what was tested. harvest.py ~l.104 says "(checked against a real build, with and without --build-arg)". That is a record of what was done, which belongs in the commit message or PR, and it will go stale. Keep the rule and its reason: BuildKit's ARG entry carries the passed value, and the entry is trusted only where it agrees with the RUN entry. The verification table already sits in the PR comment.
  2. Preference: the fallback is first-word-deep. When a builder records a declaration whose first word equals the passed value's first word, for example default real thing against passed real secret, the declaration is stored and secret is dropped. This only affects a builder that records declarations, which the author says BuildKit does not. If you want to close it, keep both values, or fall back unless whole equals the full RUN tail. I don't consider this blocking.
  3. Preference: one persistently failing object blocks every call. A Swarm service or config that always returns a non-NotFound error now makes every call refuse, because the snapshot is never marked read. This matches how a container read behaves and is the intended trade. If it is meant to be accepted, add a sentence to REDACTION.md or architecture/redaction.md saying so as an accepted limitation.

What I checked

  • The full delta diff: REDACTION.md, disk.py, harvest.py and test_redaction_harvest.py.
  • _take_snapshot, _harvest and _log_swarm_refusal. _log_swarm_refusal is still used by _take_snapshot, so removing the call in _harvest_swarm_object leaves no dead code.
  • The two new tests, by reading them.

What I did not check

  • I ran no tests, ruff or pyright. The sandbox denied the pytest command.
  • I did not verify the BuildKit ARG format against a live daemon. I'm relying on the table in the author's comment.

delta review of 101a8909a08c..3f8221c1f823. Run.

…d state the fail-closed trade

The last build argument's ARG entry was trusted where its first word matched the RUN entry's, so a
builder recording a declaration such as `real thing` against a passed `real secret` would have stored
the declaration.  It is now trusted only where the RUN entry's text begins with the whole value; failing
that, the first word is kept.  The code comment keeps the rule and its reason, without the record of how
it was checked, which is in the PR.

architecture/redaction.md now says a harvest read that keeps failing refuses every call to that host
until the object is fixed or removed, accepted as the fail-closed choice.
@GavinLucas

Copy link
Copy Markdown
Collaborator Author

Taken in b0dc3d1:

  1. Fixed. The comment states the rule and its reason; the verification is in the PR comment above.
  2. Fixed. The ARG value is trusted only where the RUN entry's text begins with the whole value; otherwise the first word is kept. This is tested with your real thing / real secret case.
  3. Recorded as accepted. architecture/redaction.md now says that a read which keeps failing refuses every call to that host until the object is fixed or removed, as the fail-closed choice.

Unit: 2,216 passed.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Claude review: approve

Resolved

  • New 1 (comment recorded what was tested): the "checked against a real build" wording is gone from harvest.py. The comment now states the rule and its reason.
  • New 2 (fallback only first-word-deep): last now keeps the whole RUN tail. The ARG value is trusted only if tail == whole or tail.startswith(whole + " "). For real thing against real secret, tail is real secret /bin/sh -c make, so agrees is false and the first word is kept. test_an_arg_entry_sharing_only_the_first_word_is_not_trusted covers this.
  • New 3 (a failing object blocks every call): architecture/redaction.md now records this as an accepted fail-closed limitation, with the reason.

Still open

Declined

  • 9 and 8, declined by @GavinLucas. The measured results in REDACTION.md are required by the story's acceptance. The test_surface_budget.py sizes follow that file's existing convention. docker-sdk.md already states the decision and its reasons. I am not raising them again.

New

None.

  • Word boundary: the startswith(whole + " ") check matches on a word boundary, so ARG real does not agree with a RUN value of realistic.
  • Empty or missing whole: this falls back to the first word, as before. The and whole guard stays in the final expression, so the agrees result matters only when whole is non-empty.

What I checked

  • The delta diff: harvest.py, architecture/redaction.md and the new test.
  • The new agrees logic traced by hand against the test input.
  • The added documentation text, which states a rule and records no measured state.

What I did not check

  • I ran no tests, ruff or pyright. The author reports 2,216 unit tests passing.
  • I did not verify the BuildKit ARG entry format against a live daemon.

delta review of 3f8221c1f823..b0dc3d16b85f. Run.

@GavinLucas
GavinLucas merged commit 1b293bb into main Nov 9, 2026
22 checks passed
@GavinLucas
GavinLucas deleted the feature/credential-redaction branch November 9, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants