- Home
- Skills
- Code Quality & Review
- Verify AI Agent Changes: Tests, Secrets, CI Gate
Verify AI Agent Changes: Tests, Secrets, CI Gate
This skill sets up a required check for AI-written code that runs the tests itself instead of trusting anyone's account of the work.
$10
What it does
- Runs the gate once in observation mode and explains each check and the verdict
- Adds and validates a repository policy from a template (Python, JS/TS, or per-agent scopes)
- Adds a CI job for GitHub Actions or GitLab CI that a pull request cannot rewrite
- Adds an optional git pre-push check
- Runs a two-week rollout and reports what would have been stopped and the false-positive share
- Runs your tests itself, flags weakened tests, and finds keys even if a later commit deleted them
Who it's for
Engineering leads using AI coding assistants
Set up a safety net that catches broken tests or leaked secrets before AI code gets merged.
Try asking: “Set up the change gate for our GitHub repo.”
Founders building with AI agents
Know when your AI agent deleted tests, added skips or committed a key, before the change is merged.
Try asking: “I want to start a two-week rollout for the code gate.”
DevOps freelancers managing team workflows
Add a deterministic check to CI that flags weakened tests and leaked keys in agent commits, starting in observation mode.
Try asking: “Add the gate check to our GitLab pipeline in observation mode.”
Verify AI Agent Changes: Tests, Secrets, CI Gate
Example session with this skill installed
Our agent pushed agent/fix-discount, which caps the discount at 50%. Before I review it, run the gate against main in observation mode. Tests run with python3 -m unittest.
- Read your context and instructions
- Compiled the verify ai agent
Summary
The gate would
block this branch. The tests pass, but only because the suite was weakened, and a token was committed and then deleted in a later commit. This is observation mode, so nothing was blocked.
(Real run of the bundled gate on a small demo repository. The token was random and is shortened here.)
skilllayer gate — ✗ BLOCKED
change set: 4af71cbd8f..8beacd1417 (2 commits, 0 marked AI-assisted, 2 files)
✓ protected paths: none changed
✗ secrets: 1 added — pricing.py:1 (github_token, commit b9961614c2b3)
✗ test integrity: signs the suite was weakened: 3 (test functions +0/−1, assertions +0/−1)
skip/xfail added — test_pricing.py:8 (@unittest.skip("flaky"))
fewer tests by 1 — test_pricing.py:8
fewer assertions by 1 — test_pricing.py:9
✓ tests: python3 -m unittest -q -> Ran 2 tests in 0.000s (exit 0, 0.0s)
note: test files changed — test_pricing.py
receipt: .skilllayer-receipts/20261204T224605838136Z-8beacd14177b-BLOCKED.json (sha256:fec8298f02b9138c…)
Not accepted: a required check failed on the commits that would land. Fix it and push again.
(warn mode: reported only, nothing was blocked)
What each check means
| Check | Result | Why it matters |
|---|---|---|
| Tests | ✓ 2 ran, exit 0 | The gate ran them itself; it did not take the agent's word for it |
| Test integrity | ✗ | test_discount was deleted (the test for the code that changed) and test_empty was skipped as "flaky" |
| Secrets | ✗ | A GitHub token was added in commit b9961614 and removed in the next one. It is still in the history, so it should be revoked |
| Protected paths | ✓ | No protected files changed |
Next steps
- Revoke the token; deleting it in a later commit does not remove it from git history.
- Ask the agent to restore
test_discount, add a test for the new 50% cap, and remove the skip, then run the gate again. - When you are ready, I can add a policy from
templates/policy/python.ymland a GitHub Actions job in observation mode. I will ask before writing any file.
Connects securely to your tools. The creator never sees your data.
About this skill
Your agent says "done, all tests pass". This skill sets up a required check for AI-written code that runs the tests itself instead of trusting anyone's account of the work.
What the gate checks
- Tests. It runs your tests itself and records the command, the exit code and the result.
- Weakened tests. It flags removed tests, removed assertions and added skips (Python, JavaScript/TypeScript). It compares counts for the whole change, so a test deleted in a branch that also adds tests can go unflagged.
- Keys and tokens. It scans every added line of every commit, so it finds a key even if a later commit deleted it. Formats it knows: AWS access keys, GitHub tokens, Anthropic keys, OpenAI keys in the classic
sk-format, private key blocks, bearer tokens, database URLs with a password, andapi_key,tokenorpassword = "..."with a long value. Not yet: Stripe, Slack or Google keys, or prefixed names such asDB_PASSWORD; use a dedicated secret scanner if those matter. - Protected paths. It reports changes to paths your policy protects, and per-agent path scopes.
- Receipts. Each run writes a receipt: base, head, each check and its result. Receipts can be signed with a key kept in a masked CI secret.
No model and no network are involved in the check, so the same change always gets the same verdict.
How the skill sets it up
- First run in observation mode, with each check and the verdict explained.
- Policy from a template, validated. The gate reads the policy from the base commit, so a change cannot loosen its own rules.
- CI job for GitHub Actions or GitLab CI, in observation mode. The job takes the gate from the base commit, so a pull request cannot rewrite the checker that judges it. CI needs no network access to install it.
- Pre-push check, optional.
- Two-week rollout: collect the receipts, label each stop as right or wrong, and end with four numbers: what would have been stopped, why, the false-positive share, and the minutes spent.
Evidence
On 1,800 recent changes of six open-source projects, 0.7% were flagged without reason. Most flags were real test removals that a person should approve. This was not measured on agent-written code.
What it does not do
It does not find vulnerabilities (it can require your scanner to run), review design, or replace code review. The CI templates start in observation mode because they have not yet run in your CI.
Licence
The bundled source is under the Business Source License 1.1 (full text in the package). Use is free for non-commercial use, for an evaluation or pilot of up to 90 days per organisation, and in an organisation where up to 10 developers use it or have their changes checked by it.
Test weakening checks are for Python and JS/TS only. CI templates start in warn-only mode. Does not check for design quality or logic errors.
Version 1.1 (in review; buyers get 1.0 until it is approved): the whole tool is one file, scripts/skilllayer.py, 182 KB of Python, standard library only, cut from SkillLayer v0.3.1. It contains no network code. SKILL.md gives its SHA-256, and the agent checks its copy before running it. CI setup copies it to tools/skilllayer/skilllayer.py in your repository; the CI job takes it from the base commit, so a pull request cannot rewrite the checker. Version 1.0 bundles the same tool as about 85 .py files with a launcher; the commands the skill runs (gate, policy check, cases, --version) make no network calls. Both need Python 3.10+ and git, install nothing and change no environment variables. Runs git and your project's own test command as subprocesses. Writes receipts to .skilllayer-receipts inside the repository. Reads a few of its own optional environment variables, such as a receipt-signing key. Includes policy templates, CI templates (GitHub Actions, GitLab CI, pre-push) and references (GATE.md, POLICY.md, ROLLOUT.md).
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed today
- Software
Git
Python 3.10+
Version 1.1 has no network code. Version 1.0, served until 1.1 is approved, bundles an update check and package-registry lookups that the skill never runs.
Permissions
File Scopes
Terminal: runs the skill's Python tool, git and your own test command. Read Files: reads git history, the policy and test files. Write Files: only with your yes, adds the policy file, the tool in tools/skilllayer/, a CI job and an optional pre-push hook; receipts go to .skilllayer-receipts. Environment Variables: reads its own optional settings, such as the gate mode and a receipt-signing key. No network: version 1.1 has no network code; version 1.0's bundled source contains an update check and package-registry lookups for commands this skill never runs.
What's inside
Frequently Asked Questions
New in Code Quality & Review
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.