# Check AI Agent Commits for Deleted Tests and Leaked Keys

> Checks your branch's commits once: runs your tests itself, flags removed or skipped tests, and finds keys added in any commit, even if deleted later. Observation mode. No model, no network.

Check AI Agent Commits for Deleted Tests and Leaked Keys is a free AI agent skill on Agensi by Nicolas Baranov, in Code Quality & Review. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Nicolas Baranov](https://www.agensi.io/creators/creator-1633)
- Category: [Code Quality & Review](https://www.agensi.io/skills/code-quality-review)
- Version: 1.0
- Last updated: 2026-12-05
- Security: scan passed (2026-12-05); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/check-ai-agent-commits-for-deleted-tests-and-leaked-keys
- Tags: code-review, testing, security, python, git, ai-agents

## What it does

- Runs your tests itself and reports the command, the exit code and the result
- Flags tests and assertions the change removed or skipped, in Python and JS/TS
- Finds keys added in any commit on the branch, even if a later commit deleted them
- Reports changes to the paths your policy protects
- Writes a receipt of every check, and blocks nothing
- Never reports a check that could not run as a pass

## Who it's for

- **Developers who merge what an AI agent wrote:** Before merging, see whether the agent's "all tests pass" came from deleting the tests that failed. Try: "Check my agent's branch against main before I merge it."
- **Team leads trying out AI coding agents:** One run on a real branch shows what a required check would have stopped, with no CI changes. Try: "Run the SkillLayer gate once on this branch in observation mode."
- **Anyone who pasted a key and removed it in the next commit:** The key is still in the history that gets pushed. The gate checks every commit, not only the final diff. Try: "Did any commit on this branch add a key, even one I deleted later?"

## About this skill

Your agent says "done, all tests pass". Sometimes that is true because it deleted the test that
failed. This skill checks the commits themselves, without trusting anyone's account of the work.

It runs SkillLayer's change gate once on the commits between your base branch and the current
checkout, in observation mode: nothing is blocked and no git state changes.

### What it checks

| Check | What it looks at |
|---|---|
| Tests | Runs your test command itself (pytest, unittest or `npm test` are found automatically) and reads the real exit code |
| Test integrity | Fewer tests or assertions, added `skip`/`xfail`, deleted test files (Python, JavaScript/TypeScript) |
| Secrets | Every added line of every commit, so a key deleted in a later commit is still found |
| Protected paths | Paths listed in your `.skilllayer-policy.yml`, if you have one |

The result is one verdict, `VERIFIED`, `BLOCKED` (what would have been stopped), `UNVERIFIED`
(a check could not run; never counted as a pass) or `NO_CHANGES`, plus a receipt in
`.skilllayer-receipts/`.

Test integrity compares counts for the whole change, so a test deleted in a branch that also adds tests can go unflagged. Read the diff of changed test files too.

No model and no network are involved, so the same commits always get the same verdict.

### Which keys it finds

AWS access keys, GitHub tokens, Anthropic keys, OpenAI keys in the classic `sk-` format, private key blocks, bearer tokens,
database URLs with a password, and assignments such as `api_key = "..."`, `token = "..."` or
`password = "..."` with a long value. It does not yet find Stripe, Slack or Google keys, or
prefixed names such as `DB_PASSWORD = "..."`. Use a dedicated secret scanner if those matter.

### What it does not do

- It does not look for vulnerabilities, review design, or replace code review.
- A passing suite is not proof the code is right. A test whose expected value was changed is
  reported as a changed test file, not judged.
- Weakened-test detection is for Python and JavaScript/TypeScript. Tests in other languages
  still run.

### 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.

## Requires

- Python 3.10+
- Git

Your test command is your own code and runs as it normally does.

## Known limitations

Secret formats: finds AWS, GitHub, Anthropic and classic OpenAI keys, private key blocks, bearer tokens, database URLs with a password, and api_key/token/password assignments; not yet Stripe, Slack or Google keys, or prefixed names like DB_PASSWORD. One run in observation mode only; making it a required check in CI is a separate setup. Weakened-test detection covers Python and JavaScript/TypeScript. Needs a base branch to compare against, usually origin/main. It does not find vulnerabilities or review design.

## Technical details

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 and installs nothing. SKILL.md gives its SHA-256, and the agent checks its copy before running it; if the skill arrives through a connector, the agent writes the file unchanged to a temporary path and deletes it afterwards unless you agree to keep a checked copy in ~/.skilllayer/tools/.

Needs Python 3.10+ and git. The agent asks before running anything, then runs: python3 <tool> gate --base origin/main --mode warn --receipt-dir .skilllayer-receipts. The gate reads git read-only and runs your project's own test command. It writes only the receipt and a run log to .skilllayer-receipts/ in the repository. In observation mode the exit code is 0 whatever the verdict; 1 means the tool itself failed. --lang ru gives the report in Russian.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Check AI Agent Commits for Deleted Tests and Leaked Keys skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### Will it block my merge or change my repository?

No. It runs once in observation mode, changes no git state, and writes only a receipt to .skilllayer-receipts/.

### Does it send my code anywhere?

No. The tool has no network code and uses no model. It runs locally with your Python and git.

### My tests pass. Why would it say BLOCKED?

Because passing can come from removing tests. The gate compares the test suite on your base branch with the suite after the change, and reports removed tests, removed assertions and added skips.

### Why does it check every commit and not just the final diff?

A key added in one commit and deleted in the next is still in the history that gets pushed. The gate scans every added line of every commit.

### What does UNVERIFIED mean?

A check could not run, for example no tests were found or they timed out. That is never counted as a pass.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
