cgagentharness-invariant-guard

Validates CG-agent-harness security invariants against the current tree or a diff using Rust integration tests.

Updated Sep 7, 2026
One-click install
npx skills add https://github.com/cgfixit/CG-agent-harness --skill cgagentharness-invariant-guard-cgfixit
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cgagentharness-invariant-guard
Source: https://github.com/cgfixit/CG-agent-harness/tree/main/.claude/skills/cgagentharness-invariant-guard
Command: npx skills add https://github.com/cgfixit/CG-agent-harness --skill cgagentharness-invariant-guard-cgfixit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Changes to security-critical paths in the CG-agent-harness codebase (shim, guards, writer, sandbox, workspace, default config) can silently weaken shipped security gates. This Skill provides a repeatable procedure to assert that documented security invariants still hold before merging such changes. ## Core Features & Use Cases - Invariant contract review: Reads INVARIANTS.md and the core-path list in AGENTS.md to establish the security contract before testing. - Targeted Rust test execution: Runs the narrowest applicable integration test suites (invariant_guard, shim_and_agent_routes, real_repo_loop, agentic_foundations, auth_guards, security_headers) with cloud API keys blanked. - Structural boundary inspection: Manually diffs imports across src/server and src/agentic, verifies REGISTERED_PATHS, shim::ACTIONS whitelist updates, and fail-closed config defaults. - Use Case: Before merging a pull request touching src/agentic/writer.rs, run this Skill to confirm write gates, kill-switch AND-semantics, and approval binding still hold, then report PASS/FAIL per invariant section with test evidence. ## Quick Start Ask the AI to check whether the harness security invariants still hold for the current diff touching src/shim and assets/config.default.yaml.

Frequently Asked Questions about cgagentharness-invariant-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check security invariants before merging a pull request?▼

Read INVARIANTS.md and the AGENTS.md core-path list, then run the narrowest applicable cargo integration tests such as invariant_guard or shim_and_agent_routes with API keys blanked. Finish with a manual diff of the server-agentic import boundary and report PASS/FAIL per invariant section.

Which code changes trigger an invariant guard review?▼

Any change to src/shim, src/server/guards.rs, src/server/headers.rs, src/agentic/writer.rs, src/agentic/executor/sandbox.rs, src/agentic/workspace.rs, or assets/config.default.yaml triggers this review. Shared routing, config, or security changes require expanding the test set.

What Rust tests verify the CG-agent-harness security gates?▼

The main suites are invariant_guard, shim_and_agent_routes, real_repo_loop, agentic_foundations, and auth_guards plus security_headers. Each maps to specific concerns like the I6 spawn boundary, write-policy kill switch, approval binding, and clone jail.

Can I skip or loosen a failing invariant test to get a green run?▼

No. A failing assertion is a blocking finding and tests must never be deleted, skipped, or weakened to obtain a pass. Quarantine is allowed only with an explicit human decision and a tracked follow-up.

Does a green invariant_guard test run equal a full security review?▼

No. Structural passes must be paired with behavioral tests for the changed path, and a green invariant_guard alone is not a complete security review. The skill also does not authorize push, merge, or release.