v0.44.0 — CodeGuard security rules
Consumers act once: run /marvin:upgrade-agent-os. It asks once for security_rules: kit | codeguard; no answer writes kit and installs nothing. See upgrades/v0.44.0.md.
Why. The kit's security checklist is short and generic. Project CodeGuard (CoSAI / OASIS, CC BY 4.0) is a maintained, industry-backed set of security rules that ships as a Claude Code plugin. Teams that want it now get it in the review loop, added on top of the kit's checklist, without the kit copying third-party rules and without making them mandatory.
What changed.
security_rulesis a newPROJECT-INFO.mdkey. Install (step 6e) and upgrade ask once (no answer or unattended:kit);project-infovalidates it;/marvin:inforeports it with the CodeGuard status. A yes installscodeguard-security@project-codeguardat project scope, pinned to v1.5.0, so teammates are offered it too; it is active from the next session. A failed install writeskitand the install continues; a re-install keeps a committed value..marvin/agents/codeguard.mdis the one owner of how the kit uses CodeGuard:- availability — one notice per session when the plugin is missing, then the kit checklist alone, never a FAIL;
- rule selection — the brief names the three always-apply rules plus the topic rules whose tags match the task, within the stack's language row, never the whole row;
- builders load only the named rules; the security validator checks them and the always-apply rules, and may scan the rest of the row for notes;
- precedence — CodeGuard adds checks and never softens a kit rule; grading by the kit's severity scale; license — rules are named, never copied.
- The Codex security lane receives the named and always-apply rules as a transient
### Rulesblock, so both validators grade the same rules the same way. - Factory:
scripts/marvin-codeguard.sh(read-only status check) withscripts/test-codeguard.sh;mh_enabled_pluginsin the hook library, shared with the style-plugin finder;validate-kitcheckcodeguard-grading(27 checks); the new suite runs in CI (20 suites). - Docs site: a CodeGuard concept page, a Home card, a Getting started entry and the
security_rulesSettings entry.
Acceptance. Documentation, checked (repo rule 10):
- README: inventory (
codeguard.md, the check script and its suite, the hook-lib reader), the gate count (27) and list, the suite count (20). - Docs site (rule 11):
site/concepts/codeguard.html(registered insite/pages.json, linked from Home, Getting started, Around the loop and Settings);site/settings-install.mddescribessecurity_rules;build-docs.sh --checkclean. CodeGuard adds nothing visible in Claude Code, so no screenshots. CLAUDE.mdandAGENTS.md: rule 8's suite list.- The
PROJECT-INFO.mdtemplate, the install, upgrade andproject-infoskills,/marvin:info. upgrades/v0.44.0.mdand theCHANGELOG.mdsection.
Behaviour:
scripts/validate-kit.sh(27 checks) and the 20scripts/test-*.shsuites: green.- Host facts verified before the build was finalised (Claude Code 2.1.318, scratch config): the
#v1.5.0tag pin works; the project-scope settings entries, theinstalled_plugins.jsonproject entry and the exit codes match what the skill and the check script assume. - Offline scratch installs, each with a logging
claudestand-in: B (decline:kit, no plugin command), C (unanswered:kit, recordedno answer → kit) and D (accept, offline failure: the pinned add attempted, no install after it, failure reported,kit, install completed): PASS. - Network runs against the release candidate: A (accept:
security_rules: codeguard,check→ready 1.5.0 project, the settings carryref: v1.5.0andenabledPlugins), E (upgrade after a real uninstall: exactly one issue callout, the setting stayscodeguard); a live session on A briefed a small auth task whose item 4 namedcodeguard-0-authentication-mfaplus the three always-apply rules, and its security validator failed a planted hard-codedSESSION_SECRETcitingcodeguard-1-hardcoded-credentials, with the finding-tag format unchanged; onsecurity_rules: kitthe same session named no rules: PASS. - The Codex
### Ruleshand-off was verified by composition only (the Codex handover was off in the scratch repo); a test for it is filed as a follow-up.
This note's scope: was derived over v0.43.1..HEAD (git log --no-merges), each subject's leading key deduplicated. AOS-308 is v0.43.1's live-acceptance record, which landed after the v0.43.1 tag.
Upgrade
Consumer-facing: a new security_rules: kit | codeguard setting offers Project CodeGuard's security rules on top of the kit checklist. Rules: .marvin/agents/codeguard.md.
- Update the plugin, then run
/marvin:upgrade-agent-os. It asks the CodeGuard question ONCE whensecurity_rulesis missing and inserts the key in.marvin/PROJECT-INFO.mdright aftercodex_evidence; no answer or an unattended run writeskit(today's behaviour, nothing installed). - A yes runs
claude plugin marketplace add 'cosai-oasis/project-codeguard#v1.5.0' --scope project(only when.claude/settings.jsondoes not already declareproject-codeguard) andclaude plugin install codeguard-security@project-codeguard -s project, writessecurity_rules: codeguard, and the plugin is active from the next session. A failed install writeskitand the upgrade continues. - The install changes
.claude/settings.json(extraKnownMarketplaces,enabledPlugins): commit it, so teammates are offered the plugin when they trust the folder. - A teammate without the plugin on a
codeguardproject gets one notice per session and runs the kit checklist alone; the absence never fails or blocks a task. - Later upgrades only check: on a
codeguardproject a disabled, removed or drifted plugin is an issue callout, and the key is never changed. To switch later, editsecurity_rules; forcodeguard, install the plugin with the fix command incodeguard.md. - New cascade file
.marvin/agents/codeguard.md; refreshed (with backups)security.md,briefing.md,validation-agent.md,codex.md,codex/security.mdand the kit coreCLAUDE.marvin.md. - No migration script.
Changes
Added
security_rules: kit | codeguardinPROJECT-INFO.md: install and upgrade ask once (no answer or unattended:kit),project-infovalidates it,/marvin:inforeports it with the CodeGuard status..marvin/agents/codeguard.md: how the advisor, builders, the security validator and the Codex security lane use Project CodeGuard (CoSAI / OASIS, CC BY 4.0, validated v1.5.0) on top of the kit checklist; a missing plugin never fails or blocks a task.- Install step 6e offers CodeGuard and, on a yes, installs
codeguard-security@project-codeguardat project scope pinned to v1.5.0; a re-install keeps a committedsecurity_rules. - Codex security lane: a
### Rulesblock (the orchestrator'srulesDATA, transient) carries the brief's named rules and the always-apply rules. - Docs site: the CodeGuard concept page and the
security_rulesSettings entry. - Factory:
scripts/marvin-codeguard.sh, a read-only install/enable check (ready/disabled/not-installed/error <reason>), withscripts/test-codeguard.sh(inline mutation check, run in CI; 20 suites). - Factory:
mh_enabled_pluginsin the hook library, one reader of the effectiveenabledPlugins, shared with the style-plugin finder. - Factory:
validate-kitcheckcodeguard-grading(27 checks): the grading sentence is identical incodeguard.md,validation-agent.mdandcodex/security.md.
Changed
briefing.mditem 4 names the always-apply rules plus the topic rules whose tags match the task, within the stack's language row;security.md,validation-agent.md,codex.md,codex/security.mdand the kit core citecodeguard.md.- The upgrade's clean-path refusal names
.claude/settings.jsonwith a commit-or-restore instruction (the plugin CLI rewrites that committed file).
Security
- A CodeGuard violation is graded by the kit's severity scale and is a FAIL only when it is itself an exploitable defect at the stage's must-fix bar; CodeGuard adds checks and never softens a kit rule.
Action needed
- Run
/marvin:upgrade-agent-os: it asks once whether to install CodeGuard (no answer:kit); after a yes, commit the.claude/settings.jsonchange.