Borrowing it
Nothing to install: this file belongs to docker/cagent-action. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/docker/cagent-action/main/AGENTS.mdgit clone --depth 1 https://github.com/docker/cagent-actionWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/docker/cagent-action/agents-md)<a href="https://agentmods.dev/instructions/docker/cagent-action/agents-md"><img src="https://agentmods.dev/badge/instructions/docker/cagent-action/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/docker/cagent-action/agents-md"><img src="https://agentmods.dev/badge/instructions/docker/cagent-action/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.04717 | $0.04717 |
| Opus 5.5 | $0.01887 | $0.01887 |
| Sonnet 5.5 | $0.00943 | $0.00943 |
| Haiku 4.5 | $0.00472 | $0.00472 |
Grade A, and why
cagent-action AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 244 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
Guide for AI agents and LLMs working in this repository. Read this before exploring the codebase or proposing changes.
What this repo is
docker/cagent-action — a GitHub Action (and a family of sub-actions) that runs Docker Agent AI agents inside GitHub Actions workflows. It is published to the GitHub Marketplace and consumed by other repos as uses: docker/[email protected].
The repo ships three things:
- Root composite action (
action.yml) — downloads thedocker-agentbinary, optionally installsmcp-gateway, validates inputs, runs the agent securely (auth checks, prompt injection detection, secret-leak scanning), and exposes outputs. review-pr/— a higher-level composite action and reusable workflow (.github/workflows/review-pr.yml) that orchestrates a multi-agent PR review pipeline (drafter → verifier → poster) with a learning loop driven by reviewer feedback.- TypeScript helpers in
src/— bundled todist/*.jsand invoked by internal sub-actions (e.g.,setup-credentials, security primitives, signed commits via the GitHub API).
Anything else here (workflows under .github/workflows/, scripts, tests) exists to develop, test, release, or self-test these three artifacts.
Repo layout
.
├── action.yml # ← Root action ("cagent Runner"). Composite. Source of truth for inputs/outputs.
├── DOCKER_AGENT_VERSION # Pinned docker-agent version (currently v1.54.0). Read at runtime by action.yml.
├── package.json # pnpm workspace root. Scripts: build, test, lint, format, actionlint.
├── tsup.config.ts # Bundles src/<name>/index.ts → dist/<name>.js (ESM, Node 24, fully bundled).
├── tsconfig.json # TS config. rootDir=src, target ES2024, strict.
├── vitest.config.ts # Two projects: "unit" and "integration".
├── biome.json # Formatter + linter (Biome). 100 char width, 2 spaces, single quotes, semicolons.
│
├── src/
│ ├── add-reaction/ # Adds emoji reactions to issue/PR comments.
│ │ ├── index.ts # Entry → bundled to dist/add-reaction.js
│ │ └── __tests__/
│ ├── check-org-membership/ # Verifies a user belongs to a GitHub org; also resolves PR author via pulls.get.
│ │ ├── index.ts # Entry → bundled to dist/check-org-membership.js (standalone CLI + library).
│ │ └── __tests__/
│ ├── credentials/ # Fetches AWS secrets via OIDC, exports PAT and AI keys.
│ │ ├── index.ts # Entry → bundled to dist/credentials.js
│ │ ├── ai-keys.ts
│ │ ├── aws-credentials.ts
│ │ ├── github-app.ts # Reads docker-agent-action/github-app from Secrets Manager; exports GITHUB_APP_TOKEN (a PAT) + ORG_MEMBERSHIP_TOKEN.
│ │ └── __tests__/
│ ├── filter-diff/ # Strips excluded-path sections from a unified diff.
│ │ ├── index.ts # CLI entry → bundled to dist/filter-diff.js
│ │ ├── filter-diff.ts # Core filterDiff() pure function + applyFilter() I/O wrapper.
│ │ └── __tests__/
│ ├── score-risk/ # Per-file risk scoring for the PR review pipeline.
│ │ ├── index.ts # CLI entry → bundled to dist/score-risk.js
│ │ ├── score-risk.ts # Core scoreFiles() pure function.
│ │ └── __tests__/
│ ├── get-pr-meta/ # Fetches PR metadata (title, body, author, base branch) used by review-pr.
│ │ ├── index.ts # Entry → bundled to dist/get-pr-meta.js
│ │ └── __tests__/
│ ├── mention-reply/ # Handles @docker-agent mention events: parses context, verifies org membership, builds prompt.
│ │ ├── index.ts # Entry → bundled to dist/mention-reply.js
│ │ └── __tests__/
│ ├── post-comment/ # Posts comments to PRs/issues.
│ │ ├── index.ts # Entry → bundled to dist/post-comment.js
│ │ └── __tests__/
│ ├── security/ # Security primitives consumed by action.yml.
│ │ ├── index.ts # CLI dispatcher → bundled to dist/security.js.
│ │ │ # Subcommands: check-auth <association> <allowed-roles-json>
│ │ │ # sanitize-input <inputPath> <outputPath>
│ │ │ # sanitize-output <filePath>
│ │ ├── check-auth.ts # author_association-based authorization.
│ │ ├── sanitize-input.ts # Detects prompt injection patterns. Sets risk-level output.
│ │ ├── sanitize-output.ts # Scans agent output for leaked API keys / tokens.
│ │ ├── patterns.ts # Single source of truth for SECRET_PATTERNS, SECRET_PREFIXES, CRITICAL_PATTERNS.
│ │ └── __tests__/security.test.ts # Vitest unit tests (replaces former test-security.sh / test-exploits.sh).
│ └── signed-commit/ # CLI tool that creates verified commits via GitHub's GraphQL API.
│ ├── index.ts # Entry → bundled to dist/signed-commit.js
│ ├── signed-commit.ts
│ └── __tests__/
│
├── review-pr/ # PR-review action + agents.
│ ├── action.yml # Composite: orchestrates diff fetching, chunking, risk scoring, review, learning.
│ ├── README.md # User-facing docs for the PR review feature.
│ ├── reply/action.yml # Sub-action: replies to feedback on review comments.
│ └── agents/
│ ├── pr-review.yaml # Root reviewer agent (cagent YAML).
│ ├── pr-review-feedback.yaml # Processes captured feedback into memory.
│ ├── pr-review-mention-reply.yaml # Handles @docker-agent mention-reply responses.
│ ├── pr-review-reply.yaml # Replies in-thread to reviewer comments.
│ ├── refs/ # Reference docs passed to agents (posting format, code-review style).
│ └── evals/ # cagent eval JSON files (success-*, security-*, marlin-*, etc.).
│
├── setup-credentials/ # Composite action: fetches AWS creds via OIDC, exports GITHUB_APP_TOKEN +
│ └── action.yml # ORG_MEMBERSHIP_TOKEN. At root so consumers can use
│ # docker/cagent-action/setup-credentials@VERSION directly.
│ # Also exports CAGENT_ACTION_ROOT (repo root of the downloaded action copy)
│ # for subsequent run: steps that need to invoke dist/ bundles.
│
├── .github/
│ ├── actions/
│ │ └── mention-reply/ # Internal-only JS action (node24). main = dist/mention-reply.js.
│ │ └── action.yml # Only used by review-pr.yml; not intended for external consumers.
│ ├── workflows/ # CI + self-test + release workflows (see "Workflows" below).
│ └── CODEOWNERS
│
├── scripts/
│ ├── act-local.sh # Helper for running workflows locally with `act`.
│ └── debug-permissions.ts
│
└── tests/ # Shell-based integration tests for action.yml bash logic.
├── test-job-summary.sh
├── test-output-extraction.sh
├── out.diff # Fixture used by test-output-extraction.sh
└── test.diff # Fixture used by test-output-extraction.sh
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 244 lines · 4,717 tokens per session scan A 33b91ea20dc0
cagent-action AGENTS.md is an instructions file published in the GitHub repository docker/cagent-action (19 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 4,717 tokens to every session, about $0.0189 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
cagent-action AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| cagent-action AGENTS.mddocker/cagent-action | Instructions file | 19 | 4mo ago | Apache-2.0 | A | 4,717 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |