diff --git a/ci/images/scan.sh b/ci/images/scan.sh
index ad25dd9..e5abc45 100755
--- a/ci/images/scan.sh
+++ b/ci/images/scan.sh
@@ -7,16 +7,27 @@
# - a fail-closed provenance check that consumers pin immutable tags
#
# Usage:
-# ci/images/scan.sh [--out docs/evidence/ci-image-scan]
+# ci/images/scan.sh [--out
]
+# Output is a CI/local artifact directory only. Do not commit scan reports into
+# the repository; record results on the tracking Issue or as pipeline assets.
set -euo pipefail
root="$(cd "$(dirname "$0")/../.." && pwd)"
registry="${MARQDO_CI_REGISTRY:-git.cflmy.cn/cflmy}"
version="${MARQDO_CLI_VERSION:-3.0.0-rc.5}"
-out="${1:-$root/docs/evidence/ci-image-scan-$version}"
+out="$root/.build/ci-image-scan-$version"
if [[ "${1:-}" == "--out" ]]; then
out="${2:?}"
+elif [[ -n "${1:-}" ]]; then
+ out="$1"
fi
mkdir -p "$out"
+# Refuse to write under tracked docs/ — that inflates the repository.
+case "$out" in
+ "$root/docs"|"$root/docs"/*)
+ echo "scan.sh: refuse output under docs/; use .build/ or a CI workspace" >&2
+ exit 2
+ ;;
+esac
images=(
"marqdo-ci-shell:$version"
"marqdo-ci-rust:$version"