Security
Move to Enforce
In audit, CargoWall records what it would deny and lets it through. In enforce, it blocks it. Move a scope to enforce once its policies allow everything it needs, so that enforcing blocks only what it shouldn't reach.
Modes
Each level has a CargoWall Mode:
| Level | Options | Starts on |
|---|---|---|
| Organization | Enforce, Audit | Audit |
| Repository, workflow, job | Inherit, Enforce, Audit | Inherit |
A job runs in the mode of the most specific level that sets one: its own, else its workflow's, else its repository's, else the organization's. Inherit shows the mode it inherits, such as Inherit (Audit).
To change a mode, open the Policy Manager, select the level under Entities, and choose its CargoWall Mode under Settings in the Chain view. The next run uses it. An organization admin sets the organization's mode. A repository's, workflow's or job's needs an organization admin or write access to the repository.
The mode you set in CodeCargo overrides the mode input of the CargoWall step. See How the Step Gets Its Policy.
Enforce One Scope at a Time
You don't have to enforce everywhere at once. Set enforce on the repositories or workflows that are ready, and leave the organization in audit. Or set the organization to enforce and pin a workflow that isn't ready to Audit.
Changing a mode in CodeCargo doesn't check readiness first. Use the Overview's Audit Readiness view, the scope's runs, and the checks below to decide.
Ready to Enforce
CodeCargo has one answer to whether a scope (the organization, a repository, a workflow, or a job) is ready to move from audit to enforce. An AI assistant connected through an MCP credential reads it with cargowall_check_enforcement_readiness. cargowall_set_enforcement_mode refuses to switch a scope to enforce unless that same verdict says it is ready, and gives the same reasons. Changing a mode over MCP needs a credential with write access to CargoWall.
A scope is ready to enforce when all four hold:
- It runs the CargoWall action. Without the action in the workflow, enforcing changes nothing.
- Its jobs ran only where CargoWall can run in the last 30 days. None ran on macOS or Windows, none ran on a runner whose operating system CodeCargo hasn't recorded, and there is job history to judge from. See Runner Labels.
- Its traffic is covered. The effective policy allows every destination the scope connects to. For a repository, workflow, or job, that means every destination in a stable baseline for exactly that entity, so the check needs one. For the organization, it's the organization's traffic over the days the check reads, 30 by default.
- It has been quiet for 14 days. CargoWall watched it for the whole window, it ran in the window, and nothing it did would have been blocked. A workflow counts as watched for the whole window when it ran in the window and also in the 7 days before it, so one run months ago never stands in for the last two weeks.
Each reason a scope falls short is given in plain words, with what to do about it. The check is read-only and judges the repositories you can open. Switching the whole organization to enforce judges every repository the change would move, so someone who can't open them all is refused.
Only uncovered destinations can be accepted: with acknowledge_uncovered, the switch goes ahead knowing connections to them will be blocked. Nothing else readiness finds can be overridden.
What Counts Toward a Scope
- At repository and organization scope, every inheriting workflow that runs CargoWall is judged on its own, so one that falls short holds the scope back and is named.
- A workflow that doesn't run, because it's off the default branch or run only by hand, still holds the scope back. Let it run in audit, or give it a mode of its own (pin it to audit), so the rest of the scope can enforce.
- A workflow or job with its own mode below the scope is left out of the runner and quiet-window checks, and so are skipped jobs.
- A pinned job's runs are found by the name its file gives it: its
name:, or its key when it has none, including each matrix leg of that name. A job whose name has${{ }}in it is named only when it runs, so its runs still count. Pin the workflow instead of the job.
Runner Labels
CodeCargo reads a runner's operating system from the first label that starts with linux, ubuntu, windows, or macos. Without one, beside self-hosted it reads a label naming a Linux distribution as Linux: rhel, centos, rocky, rockylinux, alma, almalinux, fedora, debian, amazonlinux, ec2-linux, oraclelinux, sles, suse, opensuse or alpine, with or without a version; al or ol, with a version; arch or archlinux, as the whole label.
A version follows the name directly (rhel9, alpine3.19, al2023, ol8) or after a - or _ (rhel-9, al-2023, ol_8). Any name but arch and archlinux may end in a - or _ and more (rhel9-x64, centos-stream-9, al2023-arm64). No distribution is read when any label mentions macOS or Windows.
So [self-hosted, rhel9] reads as Linux, while my-linux, al-arm64, arch-x64 (a CPU label), and a bare rhel9 without self-hosted aren't read. When a runner's operating system isn't recorded, name it in runs-on, such as [gpu-box, linux] for a self-hosted runner, or give a larger runner a name that starts with it, then run the workflow once.
Mode History
Each mode change is recorded in the organization's Audit Log as cargowall.mode.changed, with who changed it, which entity, and the mode before and after, such as Audit → Enforce. A change made over MCP is recorded as the agent's. A change that leaves the effective mode as it was, such as from Inherit (Audit) to Audit, records nothing.
The log records the entity you changed. It doesn't list the workflows and jobs that inherit from it.
Mean Time in Audit
The Overview's Trends view shows Mean time in audit: the average number of days a scope spent in audit before it switched to enforce, within your plan's CargoWall history. Every switch from audit to enforce counts, at any level, including one a scope inherited. Scopes still in audit, or that left audit without enforcing, don't count. A project's Overview counts only the project's repositories.
